OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/browser.h" | 5 #include "chrome/browser/browser.h" |
6 #include "chrome/browser/browser_window.h" | 6 #include "chrome/browser/browser_window.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_browser_event_router.h" | 8 #include "chrome/browser/extensions/extension_browser_event_router.h" |
9 #include "chrome/browser/extensions/extension_tabs_module.h" | 9 #include "chrome/browser/extensions/extension_tabs_module.h" |
10 #include "chrome/browser/extensions/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 ResultCatcher catcher; | 29 ResultCatcher catcher; |
30 ExtensionsService* service = browser()->profile()->GetExtensionsService(); | 30 ExtensionsService* service = browser()->profile()->GetExtensionsService(); |
31 Extension* extension = service->extensions()->at(0); | 31 Extension* extension = service->extensions()->at(0); |
32 ui_test_utils::NavigateToURL(browser(), | 32 ui_test_utils::NavigateToURL(browser(), |
33 GURL(extension->GetResourceURL("update.html"))); | 33 GURL(extension->GetResourceURL("update.html"))); |
34 ASSERT_TRUE(catcher.GetNextResult()); | 34 ASSERT_TRUE(catcher.GetNextResult()); |
35 | 35 |
36 // Test that we received the changes. | 36 // Test that we received the changes. |
37 ExtensionActionState* action_state = extension->browser_action_state(); | 37 ExtensionActionState* action_state = extension->browser_action_state(); |
38 ASSERT_EQ("Modified", action_state->title()); | 38 ASSERT_EQ("Modified", action_state->title()); |
39 ASSERT_EQ(1, action_state->icon_index()); | |
40 ASSERT_EQ("badge", action_state->badge_text()); | 39 ASSERT_EQ("badge", action_state->badge_text()); |
41 ASSERT_EQ(SkColorSetARGB(255, 255, 255, 255), | 40 ASSERT_EQ(SkColorSetARGB(255, 255, 255, 255), |
42 action_state->badge_background_color()); | 41 action_state->badge_background_color()); |
43 | 42 |
44 // Simulate the browser action being clicked. | 43 // Simulate the browser action being clicked. |
45 ui_test_utils::NavigateToURL(browser(), | 44 ui_test_utils::NavigateToURL(browser(), |
46 GURL("http://localhost:1337/files/extensions/test_file.txt")); | 45 GURL("http://localhost:1337/files/extensions/test_file.txt")); |
47 | 46 |
48 ExtensionAction* browser_action = service->GetBrowserActions(false)[0]; | 47 ExtensionAction* browser_action = service->GetBrowserActions(false)[0]; |
49 int window_id = ExtensionTabUtil::GetWindowId(browser()); | 48 int window_id = ExtensionTabUtil::GetWindowId(browser()); |
(...skipping 27 matching lines...) Expand all Loading... |
77 ExtensionsService* service = browser()->profile()->GetExtensionsService(); | 76 ExtensionsService* service = browser()->profile()->GetExtensionsService(); |
78 Extension* extension = service->extensions()->at(0); | 77 Extension* extension = service->extensions()->at(0); |
79 ui_test_utils::NavigateToURL(browser(), | 78 ui_test_utils::NavigateToURL(browser(), |
80 GURL(extension->GetResourceURL("update.html"))); | 79 GURL(extension->GetResourceURL("update.html"))); |
81 ASSERT_TRUE(catcher.GetNextResult()); | 80 ASSERT_TRUE(catcher.GetNextResult()); |
82 | 81 |
83 // Test that we received the changes. | 82 // Test that we received the changes. |
84 ExtensionActionState* action_state = extension->browser_action_state(); | 83 ExtensionActionState* action_state = extension->browser_action_state(); |
85 ASSERT_TRUE(action_state->icon()); | 84 ASSERT_TRUE(action_state->icon()); |
86 } | 85 } |
OLD | NEW |