| 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_action_icon_factory.h" | 6 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/sessions/session_tab_helper.h" | 11 #include "chrome/browser/sessions/session_tab_helper.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_tabstrip.h" | 13 #include "chrome/browser/ui/browser_tabstrip.h" |
| 14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
| 15 #include "chrome/browser/ui/omnibox/location_bar.h" | 15 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 16 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 16 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 17 #include "chrome/common/extensions/extension.h" | 17 #include "chrome/common/extensions/extension.h" |
| 18 #include "chrome/common/extensions/extension_action.h" | 18 #include "chrome/common/extensions/extension_action.h" |
| 19 #include "chrome/test/base/ui_test_utils.h" | 19 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "ui/gfx/image/image_skia.h" | 21 #include "ui/gfx/image/image_skia.h" |
| 22 | 22 |
| 23 using extensions::Extension; | 23 using extensions::Extension; |
| 24 | 24 |
| 25 namespace { | |
| 26 | |
| 27 gfx::Image CreateNonEmptyImage() { | |
| 28 SkBitmap bitmap; | |
| 29 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); | |
| 30 bitmap.allocPixels(); | |
| 31 return gfx::Image(bitmap); | |
| 32 } | |
| 33 | |
| 34 } // namespace | |
| 35 | |
| 36 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PageAction) { | 25 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PageAction) { |
| 37 ASSERT_TRUE(test_server()->Start()); | 26 ASSERT_TRUE(test_server()->Start()); |
| 38 ASSERT_TRUE(RunExtensionTest("page_action/basics")) << message_; | 27 ASSERT_TRUE(RunExtensionTest("page_action/basics")) << message_; |
| 39 const Extension* extension = GetSingleLoadedExtension(); | 28 const Extension* extension = GetSingleLoadedExtension(); |
| 40 ASSERT_TRUE(extension) << message_; | 29 ASSERT_TRUE(extension) << message_; |
| 41 { | 30 { |
| 42 // Tell the extension to update the page action state. | 31 // Tell the extension to update the page action state. |
| 43 ResultCatcher catcher; | 32 ResultCatcher catcher; |
| 44 ui_test_utils::NavigateToURL(browser(), | 33 ui_test_utils::NavigateToURL(browser(), |
| 45 GURL(extension->GetResourceURL("update.html"))); | 34 GURL(extension->GetResourceURL("update.html"))); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Getters) { | 210 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Getters) { |
| 222 ASSERT_TRUE(RunExtensionTest("page_action/getters")) << message_; | 211 ASSERT_TRUE(RunExtensionTest("page_action/getters")) << message_; |
| 223 const Extension* extension = GetSingleLoadedExtension(); | 212 const Extension* extension = GetSingleLoadedExtension(); |
| 224 ASSERT_TRUE(extension) << message_; | 213 ASSERT_TRUE(extension) << message_; |
| 225 | 214 |
| 226 ResultCatcher catcher; | 215 ResultCatcher catcher; |
| 227 ui_test_utils::NavigateToURL(browser(), | 216 ui_test_utils::NavigateToURL(browser(), |
| 228 GURL(extension->GetResourceURL("update.html"))); | 217 GURL(extension->GetResourceURL("update.html"))); |
| 229 ASSERT_TRUE(catcher.GetNextResult()); | 218 ASSERT_TRUE(catcher.GetNextResult()); |
| 230 } | 219 } |
| OLD | NEW |