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

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

Issue 1003283002: Enable chrome.automation.getDesktop on all aura platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actions. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js b/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
index a6d3d9afb09ae040e9b16185b7e4a3c46e37654d..7a2b9030472ac9587823a04673312e3bca9fc306 100644
--- a/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
+++ b/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
@@ -42,14 +42,28 @@ function runWithDocument(docString, callback) {
function setupAndRunTests(allTests, opt_docString) {
function runTestInternal() {
- chrome.automation.getDesktop(function(rootNodeArg) {
- rootNode = rootNodeArg;
- chrome.test.runTests(allTests);
- });
+ chrome.test.runTests(allTests);
}
- if (opt_docString)
- runWithDocument(opt_docString, runTestInternal);
- else
- runTestInternal();
+ chrome.automation.getDesktop(function(rootNodeArg) {
+ rootNode = rootNodeArg;
+
+ // Only run the test when the window containing the new tab loads.
+ rootNodeArg.addEventListener(
+ chrome.automation.EventType.childrenChanged,
+ function(evt) {
+ var subroot = evt.target.firstChild;
+ if (!opt_docString || !subroot)
+ return;
+
+ if (subroot.role == 'rootWebArea' &&
+ subroot.attributes.docUrl.indexOf(opt_docString) != -1)
+ runTestInternal();
+ },
+ true);
+ if (opt_docString)
+ runWithDocument(opt_docString, null);
+ else
+ runTestInternal();
+ });
}
« 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