Chromium Code Reviews| Index: chrome/test/data/extensions/platform_apps/web_view/focus/inject_input_method.js |
| diff --git a/chrome/test/data/extensions/platform_apps/web_view/focus/inject_input_method.js b/chrome/test/data/extensions/platform_apps/web_view/focus/inject_input_method.js |
| index 9bfe484e5f620d417b9056ea8a1306ce91515fda..76c73905666aaa0a4c964c887e4285a13b39c6ab 100644 |
| --- a/chrome/test/data/extensions/platform_apps/web_view/focus/inject_input_method.js |
| +++ b/chrome/test/data/extensions/platform_apps/web_view/focus/inject_input_method.js |
| @@ -15,6 +15,18 @@ var sendMessage = function(data) { |
| embedder.postMessage(JSON.stringify(data), '*'); |
| }; |
| +var waitingForInput = false; |
|
Fady Samuel
2014/09/04 17:31:07
Why is this here?
lazyboy
2014/09/04 18:59:33
Somehow creeped in from my other CL, thanks for ca
|
| + |
| +var onInputFired = function() { |
| + sendMessage(['response-waitForOnInput', onInputState.value]); |
| + onInputState.fired = false; |
| + if (inputElement1.value == 'InputTest456') { |
| + // Prepare for next step, step 3. |
| + inputElement1.value = ''; |
| + } |
| + waitingForInput = false; |
| +}; |
| + |
| var onInputState = {fired: false, value: ''}; |
| // Waits for oninput event to fire on |inputElement1|. |
| // Upon receiving the event, we ping back the embedder with the value of |
| @@ -23,13 +35,9 @@ var waitForOnInput = function() { |
| var inputElement1 = document.querySelector('input'); |
| LOG('inputElement1: ' + inputElement1); |
| if (onInputState.fired) { |
| - sendMessage(['response-waitForOnInput', onInputState.value]); |
| - |
| - onInputState.fired = false; |
| - if (inputElement1.value == 'InputTest456') { |
| - // Prepare for next step, step 3. |
| - inputElement1.value = ''; |
| - } |
| + onInputFired(); |
| + } else { |
| + waitingForInput = true; |
| } |
| }; |
| @@ -41,6 +49,9 @@ var waitForFocus = function() { |
| LOG('inputElement1.oninput: ' + inputElement1.value); |
| onInputState.fired = true; |
| onInputState.value = inputElement1.value; |
| + if (waitingForInput) { |
| + onInputFired(); |
| + } |
| }; |
| var inputElement1FocusListener = function() { |
| LOG('inputElement1.focus'); |