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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js

Issue 2648263006: <webview>: Synchronize WebViewFocusInteractiveTest.FocusAndVisibility (Closed)
Patch Set: Address ehsank's comments. Created 3 years, 11 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_visibility/guest.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js b/chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js
index aff72986ef253120836102d0b9e5a36489078cfa..1334066802c2a911e943b7dda04addd24c526fc2 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/focus_visibility/guest.js
@@ -1,27 +1,22 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+'use strict';
-var buttonWasFocused = false;
-
-
-function reset() {
- buttonWasFocused = false;
-}
+var embedder = null;
function onButtonReceivedFocus(e) {
- buttonWasFocused = true;
+ embedder.postMessage('focus-event', '*');
}
function onWindowMessage(e) {
switch (e.data) {
- case 'verify':
- e.source.postMessage(
- buttonWasFocused ? 'was-focused' : 'was-not-focused', '*');
+ case 'connect':
+ embedder = e.source;
+ embedder.postMessage('connected', '*');
break;
case 'reset':
- reset();
- e.source.postMessage('', '*');
+ embedder.postMessage('reset-complete', '*');
break;
}
}
@@ -32,3 +27,6 @@ function onLoad() {
window.addEventListener('message', onWindowMessage);
window.addEventListener('load', onLoad);
+window.addEventListener('keyup', function() {
+ embedder.postMessage('guest-keyup', '*');
+});

Powered by Google App Engine
This is Rietveld 408576698