OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/extensions/browser_action_test_util.h" | 6 #include "chrome/browser/extensions/browser_action_test_util.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 { | 89 { |
90 // Tell the extension to update the page action state again. | 90 // Tell the extension to update the page action state again. |
91 ResultCatcher catcher; | 91 ResultCatcher catcher; |
92 ui_test_utils::NavigateToURL(browser(), | 92 ui_test_utils::NavigateToURL(browser(), |
93 GURL(extension->GetResourceURL("update2.html"))); | 93 GURL(extension->GetResourceURL("update2.html"))); |
94 ASSERT_TRUE(catcher.GetNextResult()); | 94 ASSERT_TRUE(catcher.GetNextResult()); |
95 } | 95 } |
96 | 96 |
97 // Test that we received the changes. | 97 // Test that we received the changes. |
98 EXPECT_FALSE(action->GetIcon(tab_id).isNull()); | 98 EXPECT_FALSE(action->GetIcon(tab_id).IsEmpty()); |
99 } | 99 } |
100 | 100 |
101 // Test that calling chrome.pageAction.setPopup() can enable a popup. | 101 // Test that calling chrome.pageAction.setPopup() can enable a popup. |
102 IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, AddPopup) { | 102 IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, AddPopup) { |
103 // Load the extension, which has no default popup. | 103 // Load the extension, which has no default popup. |
104 ASSERT_TRUE(RunExtensionTest("page_action/add_popup")) << message_; | 104 ASSERT_TRUE(RunExtensionTest("page_action/add_popup")) << message_; |
105 const Extension* extension = GetSingleLoadedExtension(); | 105 const Extension* extension = GetSingleLoadedExtension(); |
106 ASSERT_TRUE(extension) << message_; | 106 ASSERT_TRUE(extension) << message_; |
107 | 107 |
108 int tab_id = ExtensionTabUtil::GetTabId( | 108 int tab_id = ExtensionTabUtil::GetTabId( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 const Extension* extension = GetSingleLoadedExtension(); | 179 const Extension* extension = GetSingleLoadedExtension(); |
180 ASSERT_TRUE(extension) << message_; | 180 ASSERT_TRUE(extension) << message_; |
181 | 181 |
182 ResultCatcher catcher; | 182 ResultCatcher catcher; |
183 ui_test_utils::NavigateToURL(browser(), | 183 ui_test_utils::NavigateToURL(browser(), |
184 GURL(extension->GetResourceURL("update.html"))); | 184 GURL(extension->GetResourceURL("update.html"))); |
185 ASSERT_TRUE(catcher.GetNextResult()); | 185 ASSERT_TRUE(catcher.GetNextResult()); |
186 } | 186 } |
187 | 187 |
188 } | 188 } |
OLD | NEW |