diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-10-15 23:46:45 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-10-15 23:46:45 +0900 |
commit | 8d3b80af5333dfab1ea6d30d2407d5a45959896e (patch) | |
tree | 6d2386bab034edfb13224896fa8a413dac9ce03a /e2e/ambassador | |
parent | 9adf08bf953e217b419e0249a292102d769c1602 (diff) |
Add test cases for mark
Diffstat (limited to 'e2e/ambassador')
-rw-r--r-- | e2e/ambassador/src/background/index.js | 4 | ||||
-rw-r--r-- | e2e/ambassador/src/client/tabs.js | 11 | ||||
-rw-r--r-- | e2e/ambassador/src/shared/messages.js | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/e2e/ambassador/src/background/index.js b/e2e/ambassador/src/background/index.js index 046b8c1..ce21dc8 100644 --- a/e2e/ambassador/src/background/index.js +++ b/e2e/ambassador/src/background/index.js @@ -1,6 +1,6 @@ import { WINDOWS_CREATE, WINDOWS_REMOVE, WINDOWS_GET, - TABS_CREATE, TABS_SELECT_AT, TABS_GET, TABS_UPDATE, + TABS_CREATE, TABS_SELECT_AT, TABS_GET, TABS_UPDATE, TABS_REMOVE, TABS_GET_ZOOM, TABS_SET_ZOOM, EVENT_KEYPRESS, EVENT_KEYDOWN, EVENT_KEYUP, SCROLL_GET, SCROLL_SET, @@ -30,6 +30,8 @@ receiveContentMessage((message) => { return browser.tabs.get(message.tabId); case TABS_UPDATE: return browser.tabs.update(message.tabId, message.properties); + case TABS_REMOVE: + return browser.tabs.remove(message.tabId); case TABS_GET_ZOOM: return browser.tabs.getZoom(message.tabId); case TABS_SET_ZOOM: diff --git a/e2e/ambassador/src/client/tabs.js b/e2e/ambassador/src/client/tabs.js index 290428c..d0cd578 100644 --- a/e2e/ambassador/src/client/tabs.js +++ b/e2e/ambassador/src/client/tabs.js @@ -1,5 +1,5 @@ import { - TABS_CREATE, TABS_SELECT_AT, TABS_GET, TABS_UPDATE, + TABS_CREATE, TABS_SELECT_AT, TABS_GET, TABS_UPDATE, TABS_REMOVE, TABS_GET_ZOOM, TABS_SET_ZOOM, } from '../shared/messages'; import * as ipc from './ipc'; @@ -35,6 +35,13 @@ const update = (tabId, properties) => { }); }; +const remove = (tabId) => { + return ipc.send({ + type: TABS_REMOVE, + tabId + }); +}; + const getZoom = (tabId) => { return ipc.send({ tabId, @@ -50,4 +57,4 @@ const setZoom = (tabId, factor) => { }); }; -export { create, selectAt, get, update, getZoom, setZoom }; +export { create, selectAt, get, update, remove, getZoom, setZoom }; diff --git a/e2e/ambassador/src/shared/messages.js b/e2e/ambassador/src/shared/messages.js index d148ca0..35c41d7 100644 --- a/e2e/ambassador/src/shared/messages.js +++ b/e2e/ambassador/src/shared/messages.js @@ -7,6 +7,7 @@ const TABS_CREATE = 'tabs.create'; const TABS_SELECT_AT = 'tabs.selectAt'; const TABS_GET = 'tabs.get'; const TABS_UPDATE = 'tabs.update'; +const TABS_REMOVE = 'tabs.remove'; const TABS_GET_ZOOM = 'tabs.get.zoom'; const TABS_SET_ZOOM = 'tabs.set.zoom'; const EVENT_KEYPRESS = 'event.keypress'; @@ -29,6 +30,7 @@ export { TABS_SELECT_AT, TABS_GET_ZOOM, TABS_SET_ZOOM, + TABS_REMOVE, EVENT_KEYPRESS, EVENT_KEYDOWN, |