aboutsummaryrefslogtreecommitdiff
path: root/e2e/ambassador/src/client
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-02-11 15:40:34 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-02-12 22:04:55 +0900
commit3f8bbe11d96b751affa9e2bf0a1995008f9e3220 (patch)
tree70a6f389331ca93bf51b4a5e46a1833817a4bfcf /e2e/ambassador/src/client
parentcf03d278eb8bb8f7544ae6395b76e1a1e0781053 (diff)
send press key to tabs
Diffstat (limited to 'e2e/ambassador/src/client')
-rw-r--r--e2e/ambassador/src/client/keys.js29
-rw-r--r--e2e/ambassador/src/client/tabs.js12
-rw-r--r--e2e/ambassador/src/client/windows.js5
3 files changed, 44 insertions, 2 deletions
diff --git a/e2e/ambassador/src/client/keys.js b/e2e/ambassador/src/client/keys.js
new file mode 100644
index 0000000..af0fb3d
--- /dev/null
+++ b/e2e/ambassador/src/client/keys.js
@@ -0,0 +1,29 @@
+import { EVENT_KEYPRESS, EVENT_KEYDOWN, EVENT_KEYUP } from '../shared/messages';
+import * as ipc from './ipc';
+
+const press = (tabId, key) => {
+ return ipc.send({
+ type: EVENT_KEYPRESS,
+ tabId,
+ key,
+ });
+};
+
+const down = (tabId, key) => {
+ return ipc.send({
+ type: EVENT_KEYDOWN,
+ tabId,
+ key,
+ });
+};
+
+
+const up = (tabId, key) => {
+ return ipc.send({
+ type: EVENT_KEYUP,
+ tabId,
+ key,
+ });
+};
+
+export { press, down, up };
diff --git a/e2e/ambassador/src/client/tabs.js b/e2e/ambassador/src/client/tabs.js
new file mode 100644
index 0000000..4db3c11
--- /dev/null
+++ b/e2e/ambassador/src/client/tabs.js
@@ -0,0 +1,12 @@
+import { TABS_CREATE } from '../shared/messages';
+import * as ipc from './ipc';
+
+const create = (windowId, url) => {
+ return ipc.send({
+ type: TABS_CREATE,
+ windowId,
+ url,
+ });
+};
+
+export { create };
diff --git a/e2e/ambassador/src/client/windows.js b/e2e/ambassador/src/client/windows.js
index 69b8905..c6ba37a 100644
--- a/e2e/ambassador/src/client/windows.js
+++ b/e2e/ambassador/src/client/windows.js
@@ -1,9 +1,10 @@
import { WINDOWS_CREATE, WINDOWS_REMOVE } from '../shared/messages';
import * as ipc from './ipc';
-const create = () => {
+const create = (url) => {
return ipc.send({
- type: WINDOWS_CREATE
+ type: WINDOWS_CREATE,
+ url,
});
};