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

Unified Diff: chrome/browser/extensions/browser_action_apitest.cc

Issue 9424024: Force browser action icon size to always be 19px (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small change to comment. Created 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/browser_action_apitest.cc
diff --git a/chrome/browser/extensions/browser_action_apitest.cc b/chrome/browser/extensions/browser_action_apitest.cc
index 9c98df79a81a722ffecb6e6123aab37a4695c690..884a1935ff545328dbf568881f6c8be30b9dec48 100644
--- a/chrome/browser/extensions/browser_action_apitest.cc
+++ b/chrome/browser/extensions/browser_action_apitest.cc
@@ -96,9 +96,12 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DynamicBrowserAction) {
const Extension* extension = GetSingleLoadedExtension();
ASSERT_TRUE(extension) << message_;
- // Test that there is a browser action in the toolbar and that it has no icon.
+ // Test that there is a browser action in the toolbar.
ASSERT_EQ(1, GetBrowserActionsBar().NumberOfBrowserActions());
- EXPECT_FALSE(GetBrowserActionsBar().HasIcon(0));
+
+ // Get the generation ID of the original SkBitmap. This will be the default
+ // browser action icon.
+ uint32_t prev_id = extension->browser_action()->GetIcon(0).getGenerationID();
// Tell the extension to update the icon using setIcon({imageData:...}).
ResultCatcher catcher;
@@ -109,6 +112,13 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DynamicBrowserAction) {
// Test that we received the changes.
EXPECT_TRUE(GetBrowserActionsBar().HasIcon(0));
+ // Test to make sure the images are different.
+ EXPECT_TRUE(prev_id !=
+ extension->browser_action()->GetIcon(0).getGenerationID());
+
+ // Reset prev_id for next test.
Devlin 2012/02/25 18:41:00 Please use proper grammar in comments.
cduvall 2012/02/25 19:23:06 Done.
+ prev_id = extension->browser_action()->GetIcon(0).getGenerationID();
+
// Tell the extension to update using setIcon({path:...});
Devlin 2012/02/25 18:41:00 I know it's not your code, but you should change t
cduvall 2012/02/25 19:23:06 Done.
ui_test_utils::NavigateToURL(browser(),
GURL(extension->GetResourceURL("update2.html")));
@@ -117,6 +127,10 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DynamicBrowserAction) {
// Test that we received the changes.
EXPECT_TRUE(GetBrowserActionsBar().HasIcon(0));
+ // Test to make sure the images are different.
Devlin 2012/02/25 18:41:00 The second set of comments seems superfluous, and
cduvall 2012/02/25 19:23:06 Done.
+ EXPECT_TRUE(prev_id !=
+ extension->browser_action()->GetIcon(0).getGenerationID());
+
// TODO(aa): Would be nice here to actually compare that the pixels change.
Devlin 2012/02/25 18:41:00 Isn't this what we are doing now? It's safe to re
cduvall 2012/02/25 19:23:06 Done.
}
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698