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

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

Issue 10909256: Always send the full tab object in ExtensionAction click event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: kalments Created 8 years, 3 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/browser_action/basics/background.js
diff --git a/chrome/test/data/extensions/api_test/browser_action/basics/background.js b/chrome/test/data/extensions/api_test/browser_action/basics/background.js
index 41609111d986ab0064f455e89ca4a3bef1313d06..db07f4300108c91b1cc32396f0e0053474b7545d 100644
--- a/chrome/test/data/extensions/api_test/browser_action/basics/background.js
+++ b/chrome/test/data/extensions/api_test/browser_action/basics/background.js
@@ -3,8 +3,16 @@
// found in the LICENSE file.
// Called when the user clicks on the browser action.
-chrome.browserAction.onClicked.addListener(function(windowId) {
- chrome.tabs.executeScript(null, {code:"document.body.bgColor='red'"});
+chrome.browserAction.onClicked.addListener(function(tab) {
+ // Privacy-sensitive properties are treated specially. Ensure they are
+ // present.
+ chrome.test.assertTrue(Boolean(tab.url.length));
+ chrome.test.assertTrue(Boolean(tab.title.length));
+
+ // Everything else is handled in a general way and should of course also
+ // be present.
+ chrome.test.assertTrue(Boolean(tab.id));
+ chrome.test.notifyPass();
});
chrome.test.notifyPass();
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | chrome/test/data/extensions/api_test/browser_action/basics/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698