Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 function keyDown(key, modifiers) { | |
| 2 return new Promise(function(resolve, reject) { | |
| 3 if (window.eventSender) { | |
| 4 eventSender.keyDown(key, modifiers); | |
| 5 resolve(); | |
| 6 } else { | |
| 7 reject(); | |
| 8 } | |
| 9 }); | |
| 10 } | |
| 11 | |
| 12 function focus(selector) { | |
| 13 return new Promise(function(resolve, reject) { | |
| 14 document.querySelector(selector).focus(); | |
|
foolip
2017/06/01 13:54:21
Can you add a comment about why both this and keyD
chongz
2017/06/01 15:34:13
Yes I was thinking if we are going to use WebDrive
| |
| 15 resolve(); | |
| 16 }); | |
| 17 } | |
| 18 | |
| 19 { | |
| 20 const inputevent_automation = async_test("InputEvent Automation"); | |
| 21 // Defined in every test and should return a promise that gets resolved when i nput is finished. | |
| 22 inject_input().then(function() { | |
| 23 inputevent_automation.done(); | |
|
foolip
2017/06/01 13:54:21
optional nit: could make this inject_input().then(
chongz
2017/06/01 15:34:13
Done.
| |
| 24 }); | |
| 25 } | |
| OLD | NEW |