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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | 6 #include "chrome/browser/extensions/api/permissions/permissions_api.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/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // Navigate to an extension page that will fire the event events.js is | 157 // Navigate to an extension page that will fire the event events.js is |
158 // listening for. | 158 // listening for. |
159 ui_test_utils::NavigateToURLWithDisposition( | 159 ui_test_utils::NavigateToURLWithDisposition( |
160 browser(), extension->GetResourceURL("fire_event.html"), | 160 browser(), extension->GetResourceURL("fire_event.html"), |
161 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_NONE); | 161 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_NONE); |
162 EXPECT_TRUE(catcher.GetNextResult()); | 162 EXPECT_TRUE(catcher.GetNextResult()); |
163 } | 163 } |
164 | 164 |
165 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptPermissionsApi) { | 165 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptPermissionsApi) { |
166 PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); | 166 RequestPermissionsFunction::SetIgnoreUserGestureForTests(true); |
167 PermissionsRequestFunction::SetAutoConfirmForTests(true); | 167 RequestPermissionsFunction::SetAutoConfirmForTests(true); |
168 host_resolver()->AddRule("*.com", "127.0.0.1"); | 168 host_resolver()->AddRule("*.com", "127.0.0.1"); |
169 ASSERT_TRUE(StartTestServer()); | 169 ASSERT_TRUE(StartTestServer()); |
170 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; | 170 ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_; |
171 } | 171 } |
172 | 172 |
173 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) { | 173 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentScriptBypassPageCSP) { |
174 ASSERT_TRUE(StartTestServer()); | 174 ASSERT_TRUE(StartTestServer()); |
175 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; | 175 ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_; |
176 } | 176 } |
OLD | NEW |