Add navigate test

This commit is contained in:
Shin'ya Ueoka 2018-05-12 23:21:16 +09:00
parent c6c885345e
commit 82aad419a7
6 changed files with 78 additions and 6 deletions
e2e/ambassador/src/background

View file

@ -1,6 +1,6 @@
import {
WINDOWS_CREATE, WINDOWS_REMOVE, WINDOWS_GET,
TABS_CREATE, TABS_SELECT_AT, TABS_GET_ZOOM, TABS_SET_ZOOM,
TABS_CREATE, TABS_SELECT_AT, TABS_GET, TABS_GET_ZOOM, TABS_SET_ZOOM,
EVENT_KEYPRESS, EVENT_KEYDOWN, EVENT_KEYUP,
SCROLL_GET, SCROLL_SET,
} from '../shared/messages';
@ -25,6 +25,8 @@ receiveContentMessage((message) => {
windowId: message.windowId,
index: message.index,
});
case TABS_GET:
return browser.tabs.get(message.tabId);
case TABS_GET_ZOOM:
return browser.tabs.getZoom(message.tabId);
case TABS_SET_ZOOM:

View file

@ -5,7 +5,7 @@ const create = (props = {}) => {
if (tab.url !== 'about:blank' && tabId === createdTab.id &&
changeInfo.status === 'complete') {
browser.tabs.onUpdated.removeListener(callback);
resolve(tab);
setTimeout(() => resolve(tab), 50) // wait for 50 milliseconds to ensure plugin loaded;
}
};
browser.tabs.onUpdated.addListener(callback);