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

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/common.js

Issue 304293002: Add human readable programmatic enum name/values to chrome.automation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last feedback. Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698