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.
|
} |