OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var assertEq = chrome.test.assertEq; | 5 var assertEq = chrome.test.assertEq; |
6 var assertFalse = chrome.test.assertFalse; | 6 var assertFalse = chrome.test.assertFalse; |
7 var assertTrue = chrome.test.assertTrue; | 7 var assertTrue = chrome.test.assertTrue; |
8 | 8 |
| 9 var EventType = chrome.automation.EventType; |
| 10 var RoleType = chrome.automation.RoleType; |
| 11 var StateType = chrome.automation.StateType; |
| 12 |
9 var tree = null; | 13 var tree = null; |
10 | 14 |
11 function setUpAndRunTests(allTests) { | 15 function setUpAndRunTests(allTests) { |
12 chrome.test.getConfig(function(config) { | 16 chrome.test.getConfig(function(config) { |
13 assertTrue('testServer' in config, 'Expected testServer in config'); | 17 assertTrue('testServer' in config, 'Expected testServer in config'); |
14 var url = 'http://a.com:PORT/index.html' | 18 var url = 'http://a.com:PORT/index.html' |
15 .replace(/PORT/, config.testServer.port); | 19 .replace(/PORT/, config.testServer.port); |
16 | 20 |
17 function gotTree(returnedTree) { | 21 function gotTree(returnedTree) { |
18 tree = returnedTree; | 22 tree = returnedTree; |
19 tree.addEventListener('loadComplete', function() { | 23 tree.addEventListener('loadComplete', function() { |
20 chrome.test.runTests(allTests); | 24 chrome.test.runTests(allTests); |
21 }); | 25 }); |
22 } | 26 } |
23 chrome.tabs.create({ 'url': url }, function() { | 27 chrome.tabs.create({ 'url': url }, function() { |
24 chrome.automation.getTree(gotTree); | 28 chrome.automation.getTree(gotTree); |
25 }); | 29 }); |
26 }); | 30 }); |
27 } | 31 } |
28 | |
OLD | NEW |