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

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: Rebased. 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..9d43a2ba58806aff5c5c310966ccb0af1315cd95 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,22 @@ function testCloseNewWindowCleanup() {
});
}
+function testFocusWhileFocused() {
+ var webview = new WebView();
+ webview.src = 'about:blank';
+
+ webview.addEventListener('loadstop', function(e) {
+ // Focus twice, then make sure that the internal element is still focused.
+ webview.focus();
+ webview.focus();
+ embedder.test.assertTrue(document.activeElement = webview);
+ embedder.test.assertTrue(webview.shadowRoot.activeElement);
+ embedder.test.succeed();
+ });
+
+ document.body.appendChild(webview);
+}
+
embedder.test.testList = {
'testAllowTransparencyAttribute': testAllowTransparencyAttribute,
'testAutosizeHeight': testAutosizeHeight,
@@ -2805,7 +2821,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