Index: chrome/test/data/extensions/api_test/webrequest/framework.js |
diff --git a/chrome/test/data/extensions/api_test/webrequest/framework.js b/chrome/test/data/extensions/api_test/webrequest/framework.js |
index f8446a18bb53301fbade0000b89a5cfc73a9a9c7..993515041f653fb438e37e824fc2f8c39609eeb3 100644 |
--- a/chrome/test/data/extensions/api_test/webrequest/framework.js |
+++ b/chrome/test/data/extensions/api_test/webrequest/framework.js |
@@ -26,15 +26,20 @@ var ignoreUnexpected = false; |
var logAllRequests = false; |
function runTests(tests) { |
- chrome.tabs.create({url: "about:blank"}, function(tab) { |
- tabId = tab.id; |
- tabIdMap = {}; |
- tabIdMap[tabId] = 0; |
- chrome.test.getConfig(function(config) { |
- testServerPort = config.testServer.port; |
- chrome.test.runTests(tests); |
- }); |
- }); |
+ var waitForAboutBlank = function(_, info, tab) { |
+ if (info.status == "complete" && tab.url == "about:blank") { |
+ tabId = tab.id; |
+ tabIdMap = {}; |
+ tabIdMap[tabId] = 0; |
+ chrome.tabs.onUpdated.removeListener(waitForAboutBlank); |
+ chrome.test.getConfig(function(config) { |
+ testServerPort = config.testServer.port; |
+ chrome.test.runTests(tests); |
+ }); |
+ } |
+ }; |
+ chrome.tabs.onUpdated.addListener(waitForAboutBlank); |
+ chrome.tabs.create({url: "about:blank"}); |
Matt Perry
2013/01/03 23:39:30
wow this API sucks :)
|
} |
// Returns an URL from the test server, fixing up the port. Must be called |
@@ -166,6 +171,7 @@ function captureEvent(name, details, callback) { |
// us specify special return values per event. |
var currentIndex = capturedEventData.length; |
var extraOptions; |
+ var retval; |
battre
2012/12/19 17:57:57
we assign retval in 176 to a global variable witho
|
if (expectedEventData.length > currentIndex) { |
retval = |
expectedEventData[currentIndex].retval_function ? |