| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 8 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "chrome/common/extensions/extension_action.h" | 23 #include "chrome/common/extensions/extension_action.h" |
| 24 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
| 25 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
| 26 #include "content/browser/renderer_host/render_view_host.h" | 26 #include "content/browser/renderer_host/render_view_host.h" |
| 27 #include "content/browser/site_instance.h" | 27 #include "content/browser/site_instance.h" |
| 28 #include "content/browser/tab_contents/tab_contents.h" | 28 #include "content/browser/tab_contents/tab_contents.h" |
| 29 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
| 30 #include "net/base/net_util.h" | 30 #include "net/base/net_util.h" |
| 31 #include "net/test/test_server.h" | 31 #include "net/test/test_server.h" |
| 32 #include "webkit/glue/webpreferences.h" | |
| 33 | 32 |
| 34 #if defined(TOOLKIT_VIEWS) | 33 #if defined(TOOLKIT_VIEWS) |
| 35 #include "chrome/browser/ui/views/frame/browser_view.h" | 34 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 36 #endif | 35 #endif |
| 37 | 36 |
| 38 const std::string kSubscribePage = "/subscribe.html"; | 37 const std::string kSubscribePage = "/subscribe.html"; |
| 39 const std::string kFeedPage = "files/feeds/feed.html"; | 38 const std::string kFeedPage = "files/feeds/feed.html"; |
| 40 const std::string kFeedPageMultiRel = "files/feeds/feed_multi_rel.html"; | 39 const std::string kFeedPageMultiRel = "files/feeds/feed_multi_rel.html"; |
| 41 const std::string kNoFeedPage = "files/feeds/no_feed.html"; | 40 const std::string kNoFeedPage = "files/feeds/no_feed.html"; |
| 42 const std::string kValidFeed0 = "files/feeds/feed_script.xml"; | 41 const std::string kValidFeed0 = "files/feeds/feed_script.xml"; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // pages. See http://crbug.com/64512. | 114 // pages. See http://crbug.com/64512. |
| 116 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WebKitPrefsBackgroundPage) { | 115 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WebKitPrefsBackgroundPage) { |
| 117 ASSERT_TRUE(LoadExtension( | 116 ASSERT_TRUE(LoadExtension( |
| 118 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") | 117 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") |
| 119 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") | 118 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 120 .AppendASCII("1.0.0.0"))); | 119 .AppendASCII("1.0.0.0"))); |
| 121 | 120 |
| 122 ExtensionProcessManager* manager = | 121 ExtensionProcessManager* manager = |
| 123 browser()->profile()->GetExtensionProcessManager(); | 122 browser()->profile()->GetExtensionProcessManager(); |
| 124 ExtensionHost* host = FindHostWithPath(manager, "/backgroundpage.html", 1); | 123 ExtensionHost* host = FindHostWithPath(manager, "/backgroundpage.html", 1); |
| 125 WebPreferences prefs = | 124 WebPreferences prefs = host->GetWebkitPrefs(); |
| 126 static_cast<RenderViewHostDelegate*>(host->host_contents())-> | |
| 127 GetWebkitPrefs(); | |
| 128 ASSERT_FALSE(prefs.experimental_webgl_enabled); | 125 ASSERT_FALSE(prefs.experimental_webgl_enabled); |
| 129 ASSERT_FALSE(prefs.accelerated_compositing_enabled); | 126 ASSERT_FALSE(prefs.accelerated_compositing_enabled); |
| 130 ASSERT_FALSE(prefs.accelerated_2d_canvas_enabled); | 127 ASSERT_FALSE(prefs.accelerated_2d_canvas_enabled); |
| 131 } | 128 } |
| 132 | 129 |
| 133 // Tests that we can load page actions in the Omnibox. | 130 // Tests that we can load page actions in the Omnibox. |
| 134 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageAction) { | 131 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageAction) { |
| 135 ASSERT_TRUE(test_server()->Start()); | 132 ASSERT_TRUE(test_server()->Start()); |
| 136 | 133 |
| 137 // This page action will not show an icon, since it doesn't specify one but | 134 // This page action will not show an icon, since it doesn't specify one but |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 | 844 |
| 848 EXPECT_EQ(extension->GetResourceURL("options.html"), | 845 EXPECT_EQ(extension->GetResourceURL("options.html"), |
| 849 tab_strip->GetTabContentsAt(1)->tab_contents()->GetURL()); | 846 tab_strip->GetTabContentsAt(1)->tab_contents()->GetURL()); |
| 850 } | 847 } |
| 851 | 848 |
| 852 //============================================================================== | 849 //============================================================================== |
| 853 // STOP! Please do not add any more random-ass tests here. Create new files for | 850 // STOP! Please do not add any more random-ass tests here. Create new files for |
| 854 // your tests grouped by functionality. Also, you should strongly consider using | 851 // your tests grouped by functionality. Also, you should strongly consider using |
| 855 // ExtensionAPITest if possible. | 852 // ExtensionAPITest if possible. |
| 856 //============================================================================== | 853 //============================================================================== |
| OLD | NEW |