Chromium Code Reviews| OLD | NEW |
|---|---|
| (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>'); | |
| OLD | NEW |