Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/executescript/basic/test.js |
| diff --git a/chrome/test/data/extensions/api_test/executescript/basic/test.js b/chrome/test/data/extensions/api_test/executescript/basic/test.js |
| index 5937596807b92521cc1b4c83c3b6b2e82f53c4de..71859647474a5264233079b090dde84f8c6ff38e 100644 |
| --- a/chrome/test/data/extensions/api_test/executescript/basic/test.js |
| +++ b/chrome/test/data/extensions/api_test/executescript/basic/test.js |
| @@ -88,7 +88,13 @@ chrome.test.getConfig(function(config) { |
| }, |
| function executeJavaScriptCodeShouldFail() { |
| - chrome.tabs.update(tabId, { url: testFailureUrl }, function() { |
| + var doneListening = |
|
Devlin
2016/01/26 20:40:36
What's the reason for this change?
robwu
2016/01/26 23:57:58
Otherwise the test would fail, because chrome.tabs
Devlin
2016/01/27 18:33:48
Heh. That's the right choice, but I'm sure this i
|
| + chrome.test.listenForever(chrome.tabs.onUpdated, onUpdated); |
| + chrome.tabs.update(tabId, {url: testFailureUrl}); |
| + |
| + function onUpdated(updatedTabId, changeInfo) { |
| + if (updatedTabId !== tabId || changeInfo.url === testFailureUrl) |
| + return; |
| var script_file = {}; |
| script_file.code = "document.title = 'executeScript';"; |
| // The error message should contain the URL of the site for which it |
| @@ -97,7 +103,8 @@ chrome.test.getConfig(function(config) { |
| 'Cannot access contents of url "' + testFailureUrl + |
| '". Extension manifest must request permission to access this ' + |
| 'host.')); |
| - }); |
| + doneListening(); |
| + } |
| }, |
| function executeJavaScriptWithNoneValueShouldFail() { |