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

Unified Diff: chrome/test/data/extensions/api_test/active_tab/background.js

Issue 2871533002: [Test] Added a test for activeTab URL filtering (Closed)
Patch Set: Added a public session test (tests URL scrubbing) Created 3 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
« no previous file with comments | « chrome/browser/extensions/active_tab_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/active_tab/background.js
diff --git a/chrome/test/data/extensions/api_test/active_tab/background.js b/chrome/test/data/extensions/api_test/active_tab/background.js
index 7ccd11832dac9ca9f863f5a5fff8fddaaabf4e20..81186903e2566b6c21c0820c9ef29c9a38e64eb9 100644
--- a/chrome/test/data/extensions/api_test/active_tab/background.js
+++ b/chrome/test/data/extensions/api_test/active_tab/background.js
@@ -42,7 +42,18 @@ var injectIframe =
'iframe.src = "' + iframeUrl + '";\n' +
'document.body.appendChild(iframe);\n';
+var runCount = 0;
+
chrome.browserAction.onClicked.addListener(function(tab) {
+ runCount++;
+ if (runCount == 1) {
Devlin 2017/05/23 20:49:21 add some comments explaining the ordering here.
Ivan Šandrk 2017/05/24 16:36:51 Done.
+ assertTrue(tab.url == undefined);
Devlin 2017/05/23 20:49:21 maybe just: assertFalse(!!tab.url);
Ivan Šandrk 2017/05/24 16:36:51 Done.
+ return chrome.test.succeed();
Devlin 2017/05/23 20:49:21 chrome.test.succeed() doesn't return anything, so
Ivan Šandrk 2017/05/24 16:36:51 Done.
+ } else if (runCount == 3) {
+ chrome.test.sendMessage(tab.url);
+ return chrome.test.succeed();
+ }
+
iframeDone = chrome.test.callbackAdded();
cachedUrl = tab.url;
chrome.tabs.executeScript({ code: injectIframe }, callbackPass());
« no previous file with comments | « chrome/browser/extensions/active_tab_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698