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) |
}); |
} |
- |