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

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/desktop/load_tabs.js

Issue 667713006: Implement automatic load of composed/embedded automation trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 1 month 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 2014 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 testLoadTabs() {
7 function findAllWebAreas(node, nodes) {
8 if (node.role == chrome.automation.RoleType.webArea)
9 nodes.push(node);
dmazzoni 2014/10/29 06:53:30 nit: indent
10
11 var children = node.children();
12 for (var i = 0; i < children.length; i++) {
13 var child = findAllWebAreas(children[i], nodes);
14 }
15 }
16 var webAreas = [];
17 findAllWebAreas(rootNode, webAreas);
18 assertEq(2, webAreas.length);
19 var second = webAreas[1];
20 second.load(function() {
21 var subroot = second.firstChild();
22 assertEq(chrome.automation.RoleType.rootWebArea, subroot.role);
23 var button = subroot.firstChild().firstChild();
24 assertEq(chrome.automation.RoleType.button, button.role);
25
26 var para = subroot.firstChild().lastChild().previousSibling();
27 assertEq(chrome.automation.RoleType.textField, para.role);
28 chrome.test.succeed();
29 });
30 }
31 ];
32
33 setupAndRunTests(allTests,
34 '<button>alpha</button><input type="text">hello</input>');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698