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

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

Issue 1040863002: Revert "Enable chrome.automation.getDesktop on all aura platforms." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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; 9 var EventType = chrome.automation.EventType;
10 var RoleType = chrome.automation.RoleType; 10 var RoleType = chrome.automation.RoleType;
(...skipping 24 matching lines...) Expand all
35 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) { 35 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) {
36 if (tabId == tab.id && changeInfo.status == 'complete') { 36 if (tabId == tab.id && changeInfo.status == 'complete') {
37 callback(); 37 callback();
38 } 38 }
39 }); 39 });
40 }); 40 });
41 } 41 }
42 42
43 function setupAndRunTests(allTests, opt_docString) { 43 function setupAndRunTests(allTests, opt_docString) {
44 function runTestInternal() { 44 function runTestInternal() {
45 chrome.test.runTests(allTests); 45 chrome.automation.getDesktop(function(rootNodeArg) {
46 rootNode = rootNodeArg;
47 chrome.test.runTests(allTests);
48 });
46 } 49 }
47 50
48 chrome.automation.getDesktop(function(rootNodeArg) { 51 if (opt_docString)
49 rootNode = rootNodeArg; 52 runWithDocument(opt_docString, runTestInternal);
50 53 else
51 // Only run the test when the window containing the new tab loads. 54 runTestInternal();
52 rootNodeArg.addEventListener(
53 chrome.automation.EventType.childrenChanged,
54 function(evt) {
55 var subroot = evt.target.firstChild;
56 if (!opt_docString || !subroot)
57 return;
58
59 if (subroot.role == 'rootWebArea' &&
60 subroot.attributes.docUrl.indexOf(opt_docString) != -1)
61 runTestInternal();
62 },
63 true);
64 if (opt_docString)
65 runWithDocument(opt_docString, null);
66 else
67 runTestInternal();
68 });
69 } 55 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/test/data/extensions/api_test/automation/tests/desktop/desktop.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698