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

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

Issue 308003003: Allow requesting Automation tree by tabId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test working Created 6 years, 7 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/tabs/common.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/tabs/common.js b/chrome/test/data/extensions/api_test/automation/tests/tabs/common.js
index fbbc918fd1d1a28778a2866b5d8768d1cea39c38..277e6f3489e6732d8f62c0b1afac9979251a66ad 100644
--- a/chrome/test/data/extensions/api_test/automation/tests/tabs/common.js
+++ b/chrome/test/data/extensions/api_test/automation/tests/tabs/common.js
@@ -16,24 +16,28 @@ function createTab(url, callback) {
return;
assertEq(tab.id, sender.tab.id);
assertTrue(message['loaded']);
- callback();
+ callback(tab);
chrome.runtime.onMessage.removeListener(listener);
});
});
}
function setUpAndRunTests(allTests) {
+ getUrlFromConfig(function(url) {
+ createTab(url, function(unused_tab) {
+ chrome.automation.getTree(function (returnedTree) {
+ tree = returnedTree;
+ chrome.test.runTests(allTests);
+ });
+ });
+ });
+}
+
+function getUrlFromConfig(callback) {
chrome.test.getConfig(function(config) {
assertTrue('testServer' in config, 'Expected testServer in config');
var url = "http://a.com:PORT/index.html"
.replace(/PORT/, config.testServer.port);
- function gotTree(returnedTree) {
- tree = returnedTree;
- chrome.test.runTests(allTests);
- }
- createTab(url, function() {
- chrome.automation.getTree(gotTree);
- });
+ callback(url)
});
}
-

Powered by Google App Engine
This is Rietveld 408576698