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/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/chrome_notification_types.h" | |
8 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | 7 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
15 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
16 #include "content/public/test/browser_test_utils.h" | 15 #include "content/public/test/browser_test_utils.h" |
| 16 #include "extensions/browser/notification_types.h" |
17 #include "extensions/common/extension.h" | 17 #include "extensions/common/extension.h" |
18 #include "net/dns/mock_host_resolver.h" | 18 #include "net/dns/mock_host_resolver.h" |
19 #include "net/test/embedded_test_server/embedded_test_server.h" | 19 #include "net/test/embedded_test_server/embedded_test_server.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // A fake webstore domain. | 26 // A fake webstore domain. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 EXPECT_TRUE(CheckStyleInjection(browser(), url, false)); | 202 EXPECT_TRUE(CheckStyleInjection(browser(), url, false)); |
203 } | 203 } |
204 | 204 |
205 // crbug.com/120762 | 205 // crbug.com/120762 |
206 IN_PROC_BROWSER_TEST_F( | 206 IN_PROC_BROWSER_TEST_F( |
207 ExtensionApiTest, | 207 ExtensionApiTest, |
208 DISABLED_ContentScriptStylesInjectedIntoExistingRenderers) { | 208 DISABLED_ContentScriptStylesInjectedIntoExistingRenderers) { |
209 ASSERT_TRUE(StartEmbeddedTestServer()); | 209 ASSERT_TRUE(StartEmbeddedTestServer()); |
210 | 210 |
211 content::WindowedNotificationObserver signal( | 211 content::WindowedNotificationObserver signal( |
212 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, | 212 extensions::NOTIFICATION_USER_SCRIPTS_UPDATED, |
213 content::Source<Profile>(browser()->profile())); | 213 content::Source<Profile>(browser()->profile())); |
214 | 214 |
215 // Start with a renderer already open at a URL. | 215 // Start with a renderer already open at a URL. |
216 GURL url(test_server()->GetURL("file/extensions/test_file.html")); | 216 GURL url(test_server()->GetURL("file/extensions/test_file.html")); |
217 ui_test_utils::NavigateToURL(browser(), url); | 217 ui_test_utils::NavigateToURL(browser(), url); |
218 | 218 |
219 LoadExtension( | 219 LoadExtension( |
220 test_data_dir_.AppendASCII("content_scripts/existing_renderers")); | 220 test_data_dir_.AppendASCII("content_scripts/existing_renderers")); |
221 | 221 |
222 signal.Wait(); | 222 signal.Wait(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 ASSERT_TRUE(StartEmbeddedTestServer()); | 279 ASSERT_TRUE(StartEmbeddedTestServer()); |
280 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; | 280 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; |
281 } | 281 } |
282 | 282 |
283 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) { | 283 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) { |
284 ASSERT_TRUE(StartEmbeddedTestServer()); | 284 ASSERT_TRUE(StartEmbeddedTestServer()); |
285 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; | 285 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; |
286 } | 286 } |
287 | 287 |
288 } // namespace extensions | 288 } // namespace extensions |
OLD | NEW |