Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4862)

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/focus/inject_input_method.js

Issue 376033002: Adding MimeHandlerView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pending-zork-patch2
Patch Set: add switch to control feature, remove a DCHECK from extension_message_filter Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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');

Powered by Google App Engine
This is Rietveld 408576698