diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-02-13 20:13:27 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-02-13 20:43:15 +0900 |
commit | 0904f8e1ebd61d425c3536a7dd02afbffaad0550 (patch) | |
tree | b95c476cabe2e519ab906ee9d3ec220b3551db86 /e2e/ambassador/src | |
parent | 3f8bbe11d96b751affa9e2bf0a1995008f9e3220 (diff) |
add tab delete test
Diffstat (limited to 'e2e/ambassador/src')
-rw-r--r-- | e2e/ambassador/src/background/index.js | 5 | ||||
-rw-r--r-- | e2e/ambassador/src/client/windows.js | 13 | ||||
-rw-r--r-- | e2e/ambassador/src/content/index.js | 4 | ||||
-rw-r--r-- | e2e/ambassador/src/shared/messages.js | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/e2e/ambassador/src/background/index.js b/e2e/ambassador/src/background/index.js index 9e64986..f9fda7e 100644 --- a/e2e/ambassador/src/background/index.js +++ b/e2e/ambassador/src/background/index.js @@ -1,5 +1,6 @@ import { - WINDOWS_CREATE, WINDOWS_REMOVE, TABS_CREATE, + WINDOWS_CREATE, WINDOWS_REMOVE, WINDOWS_GET, + TABS_CREATE, EVENT_KEYPRESS, EVENT_KEYDOWN, EVENT_KEYUP, } from '../shared/messages'; import * as tabs from './tabs'; @@ -11,6 +12,8 @@ receiveContentMessage((message) => { return browser.windows.create({ url: message.url }); case WINDOWS_REMOVE: return browser.windows.remove(message.windowId); + case WINDOWS_GET: + return browser.windows.get(message.windowId, { populate: true }); case TABS_CREATE: return tabs.create({ url: message.url, diff --git a/e2e/ambassador/src/client/windows.js b/e2e/ambassador/src/client/windows.js index c6ba37a..f92405a 100644 --- a/e2e/ambassador/src/client/windows.js +++ b/e2e/ambassador/src/client/windows.js @@ -1,4 +1,6 @@ -import { WINDOWS_CREATE, WINDOWS_REMOVE } from '../shared/messages'; +import { + WINDOWS_CREATE, WINDOWS_REMOVE, WINDOWS_GET +} from '../shared/messages'; import * as ipc from './ipc'; const create = (url) => { @@ -15,4 +17,11 @@ const remove = (windowId) => { }); }; -export { create, remove }; +const get = (windowId) => { + return ipc.send({ + type: WINDOWS_GET, + windowId, + }); +}; + +export { create, remove, get }; diff --git a/e2e/ambassador/src/content/index.js b/e2e/ambassador/src/content/index.js index 0931f93..8573d66 100644 --- a/e2e/ambassador/src/content/index.js +++ b/e2e/ambassador/src/content/index.js @@ -1,5 +1,6 @@ import { - WINDOWS_CREATE, WINDOWS_REMOVE, TABS_CREATE, + WINDOWS_CREATE, WINDOWS_REMOVE, WINDOWS_GET, + TABS_CREATE, EVENT_KEYPRESS, EVENT_KEYDOWN, EVENT_KEYUP, } from '../shared/messages'; import * as ipc from './ipc'; @@ -8,6 +9,7 @@ ipc.receivePageMessage((message) => { switch (message.type) { case WINDOWS_CREATE: case WINDOWS_REMOVE: + case WINDOWS_GET: case TABS_CREATE: case EVENT_KEYPRESS: case EVENT_KEYDOWN: diff --git a/e2e/ambassador/src/shared/messages.js b/e2e/ambassador/src/shared/messages.js index 1369260..32b7aa2 100644 --- a/e2e/ambassador/src/shared/messages.js +++ b/e2e/ambassador/src/shared/messages.js @@ -2,6 +2,7 @@ const METHOD_REQUEST = 'request'; const METHOD_RESPONSE = 'response'; const WINDOWS_CREATE = 'windows.create'; const WINDOWS_REMOVE = 'windows.remove'; +const WINDOWS_GET = 'windows.get'; const TABS_CREATE = 'tabs.create'; const EVENT_KEYPRESS = 'event.keypress'; const EVENT_KEYDOWN = 'event.keydown'; @@ -13,6 +14,7 @@ export { WINDOWS_CREATE, WINDOWS_REMOVE, + WINDOWS_GET, TABS_CREATE, |