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

Unified Diff: chrome/renderer/extensions/extension_api_client_unittest.cc

Issue 151181: Add a few more unit tests for page actions (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/renderer/extensions/extension_api_client_unittest.cc
===================================================================
--- chrome/renderer/extensions/extension_api_client_unittest.cc (revision 19757)
+++ chrome/renderer/extensions/extension_api_client_unittest.cc (working copy)
@@ -480,11 +480,20 @@
}
TEST_F(ExtensionAPIClientTest, EnablePageAction) {
+ // Basic old-school enablePageAction call.
ExpectJsPass("chrome.pageActions.enableForTab("
"\"dummy\", {tabId: 0, url: \"http://foo/\"});",
"EnablePageAction",
"[\"dummy\",{\"tabId\":0,\"url\":\"http://foo/\"}]");
+ // Try both optional parameters (title and iconId).
+ ExpectJsPass("chrome.pageActions.enableForTab("
+ "\"dummy\", {tabId: 0, url: \"http://foo/\","
+ "title: \"a\", iconId: 0});",
+ "EnablePageAction",
+ "[\"dummy\",{\"tabId\":0,\"url\":\"http://foo/\","
+ "\"title\":\"a\",\"iconId\":0}]");
+ // Now try disablePageAction.
ExpectJsPass("chrome.pageActions.disableForTab("
"\"dummy\", {tabId: 0, url: \"http://foo/\"});",
"DisablePageAction",

Powered by Google App Engine
This is Rietveld 408576698