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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 1224573006: Calling webview.focus() now works correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
index 976b997c0af9c13bf2769a3078e0c46c86791957..27030b040c7eb5fc6590903a32815e59387509ce 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -2706,6 +2706,23 @@ function testCloseNewWindowCleanup() {
});
}
+function testFocusWhileFocused() {
+ var webview = new WebView();
+ webview.src = 'about:blank';
+
+ webview.addEventListener('loadstop', function(e) {
+ // Focus twice, then make sure that the guest content is still focused.
+ webview.focus();
+ webview.focus();
+ webview.executeScript({code: 'document.hasFocus()'}, function(result) {
+ embedder.test.assertTrue(result[0]);
+ embedder.test.succeed();
+ });
+ });
+
+ document.body.appendChild(webview);
+}
+
embedder.test.testList = {
'testAllowTransparencyAttribute': testAllowTransparencyAttribute,
'testAutosizeHeight': testAutosizeHeight,
@@ -2805,7 +2822,8 @@ embedder.test.testList = {
'testZoomBeforeNavigation': testZoomBeforeNavigation,
'testPlugin': testPlugin,
'testGarbageCollect': testGarbageCollect,
- 'testCloseNewWindowCleanup': testCloseNewWindowCleanup
+ 'testCloseNewWindowCleanup': testCloseNewWindowCleanup,
+ 'testFocusWhileFocused': testFocusWhileFocused
};
onload = function() {

Powered by Google App Engine
This is Rietveld 408576698