| 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 "chrome/browser/extensions/browser_event_router.h" | 5 #include "chrome/browser/extensions/browser_event_router.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/extensions/extension_tab_util.h" | 8 #include "chrome/browser/extensions/extension_tab_util.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sessions/restore_tab_helper.h" | 10 #include "chrome/browser/sessions/restore_tab_helper.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Tell the extension to update the page action state again. | 55 // Tell the extension to update the page action state again. |
| 56 ResultCatcher catcher; | 56 ResultCatcher catcher; |
| 57 ui_test_utils::NavigateToURL(browser(), | 57 ui_test_utils::NavigateToURL(browser(), |
| 58 GURL(extension->GetResourceURL("update2.html"))); | 58 GURL(extension->GetResourceURL("update2.html"))); |
| 59 ASSERT_TRUE(catcher.GetNextResult()); | 59 ASSERT_TRUE(catcher.GetNextResult()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Test that we received the changes. | 62 // Test that we received the changes. |
| 63 tab_id = chrome::GetActiveTabContents(browser())->restore_tab_helper()-> | 63 tab_id = chrome::GetActiveTabContents(browser())->restore_tab_helper()-> |
| 64 session_id().id(); | 64 session_id().id(); |
| 65 EXPECT_FALSE(action->GetIcon(tab_id).isNull()); | 65 ExtensionAction::PathToIconCache empty_cache; |
| 66 EXPECT_FALSE(action->GetIcon(tab_id, empty_cache).IsEmpty()); |
| 66 } | 67 } |
| 67 | 68 |
| 68 // Test that calling chrome.pageAction.setPopup() can enable a popup. | 69 // Test that calling chrome.pageAction.setPopup() can enable a popup. |
| 69 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PageActionAddPopup) { | 70 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PageActionAddPopup) { |
| 70 // Load the extension, which has no default popup. | 71 // Load the extension, which has no default popup. |
| 71 ASSERT_TRUE(RunExtensionTest("page_action/add_popup")) << message_; | 72 ASSERT_TRUE(RunExtensionTest("page_action/add_popup")) << message_; |
| 72 const Extension* extension = GetSingleLoadedExtension(); | 73 const Extension* extension = GetSingleLoadedExtension(); |
| 73 ASSERT_TRUE(extension) << message_; | 74 ASSERT_TRUE(extension) << message_; |
| 74 | 75 |
| 75 int tab_id = ExtensionTabUtil::GetTabId( | 76 int tab_id = ExtensionTabUtil::GetTabId( |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Getters) { | 204 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Getters) { |
| 204 ASSERT_TRUE(RunExtensionTest("page_action/getters")) << message_; | 205 ASSERT_TRUE(RunExtensionTest("page_action/getters")) << message_; |
| 205 const Extension* extension = GetSingleLoadedExtension(); | 206 const Extension* extension = GetSingleLoadedExtension(); |
| 206 ASSERT_TRUE(extension) << message_; | 207 ASSERT_TRUE(extension) << message_; |
| 207 | 208 |
| 208 ResultCatcher catcher; | 209 ResultCatcher catcher; |
| 209 ui_test_utils::NavigateToURL(browser(), | 210 ui_test_utils::NavigateToURL(browser(), |
| 210 GURL(extension->GetResourceURL("update.html"))); | 211 GURL(extension->GetResourceURL("update.html"))); |
| 211 ASSERT_TRUE(catcher.GetNextResult()); | 212 ASSERT_TRUE(catcher.GetNextResult()); |
| 212 } | 213 } |
| OLD | NEW |