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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var allTests = [
6 function testFocusInIframes() {
7 chrome.test.getConfig(function(config) {
8 var url = 'http://a.com:' + config.testServer.port + '/iframe_outer.html';
9 chrome.tabs.create({url: url});
10
11 chrome.automation.getDesktop(function(rootNode) {
12 // Succeed when the button inside the iframe gets focus.
13 rootNode.addEventListener('focus', function(event) {
14 if (event.target.name == 'Inner')
15 chrome.test.succeed();
16 });
17
18 // Wait for the inner frame to load, then find the button inside it
19 // and focus it.
20 rootNode.addEventListener('loadComplete', function(event) {
21 if (event.target.url.indexOf('iframe_inner.html') >= 0) {
22 chrome.automation.getFocus(function(focus) {
23 // Assert that the outer frame has focus.
24 assertTrue(focus.url.indexOf('iframe_outer') >= 0);
25
26 // Find the inner button and focus it.
27 var innerButton = focus.find({ attributes: { name: 'Inner' } });
28 innerButton.focus();
29 });
30 }
31 });
32 });
33 });
34 },
35 ];
36
37 chrome.test.runTests(allTests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698