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

Unified Diff: chrome/test/data/extensions/api_test/executescript/basic/test.js

Issue 1628423002: Add frameId to chrome.tabs.executeScript/insertCSS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissiondata-remove-process_id
Patch Set: Remove unused include from rebase Created 4 years, 10 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/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 =
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698