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

Unified Diff: chrome/test/data/extensions/api_test/automation/tests/desktop/focus_iframe.js

Issue 1761633002: One accessibility tree per frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix is-richly-editable test Created 4 years, 9 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/api_test/automation/tests/desktop/focus_iframe.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/desktop/focus_iframe.js b/chrome/test/data/extensions/api_test/automation/tests/desktop/focus_iframe.js
new file mode 100644
index 0000000000000000000000000000000000000000..ee69b37a627837d63170739640cf3b39495c5ed5
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/automation/tests/desktop/focus_iframe.js
@@ -0,0 +1,37 @@
+// Copyright 2016 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.
+
+var allTests = [
+ function testFocusInIframes() {
+ chrome.test.getConfig(function(config) {
+ var url = 'http://a.com:' + config.testServer.port + '/iframe_outer.html';
+ chrome.tabs.create({url: url});
+
+ chrome.automation.getDesktop(function(rootNode) {
+ // Succeed when the button inside the iframe gets focus.
+ rootNode.addEventListener('focus', function(event) {
+ if (event.target.name == 'Inner')
+ chrome.test.succeed();
+ });
+
+ // Wait for the inner frame to load, then find the button inside it
+ // and focus it.
+ rootNode.addEventListener('loadComplete', function(event) {
+ if (event.target.url.indexOf('iframe_inner.html') >= 0) {
+ chrome.automation.getFocus(function(focus) {
+ // Assert that the outer frame has focus.
+ assertTrue(focus.url.indexOf('iframe_outer') >= 0);
+
+ // Find the inner button and focus it.
+ var innerButton = focus.find({ attributes: { name: 'Inner' } });
+ innerButton.focus();
+ });
+ }
+ });
+ });
+ });
+ },
+];
+
+chrome.test.runTests(allTests);

Powered by Google App Engine
This is Rietveld 408576698