| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 6 #include "chrome/browser/extensions/api/web_request/web_request_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/extensions/extension_test_message_listener.h" | 9 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_tabstrip.h" | 12 #include "chrome/browser/ui/browser_tabstrip.h" |
| 13 #include "chrome/browser/ui/login/login_prompt.h" | 13 #include "chrome/browser/ui/login/login_prompt.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/extensions/features/feature.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/test/browser_test_utils.h" | 22 #include "content/public/test/browser_test_utils.h" |
| 22 #include "net/base/mock_host_resolver.h" | 23 #include "net/base/mock_host_resolver.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 24 | 25 |
| 25 using content::WebContents; | 26 using content::WebContents; |
| 27 using extensions::Feature; |
| 26 | 28 |
| 27 namespace { | 29 namespace { |
| 28 | 30 |
| 29 class CancelLoginDialog : public content::NotificationObserver { | 31 class CancelLoginDialog : public content::NotificationObserver { |
| 30 public: | 32 public: |
| 31 CancelLoginDialog() { | 33 CancelLoginDialog() { |
| 32 registrar_.Add(this, | 34 registrar_.Add(this, |
| 33 chrome::NOTIFICATION_AUTH_NEEDED, | 35 chrome::NOTIFICATION_AUTH_NEEDED, |
| 34 content::NotificationService::AllSources()); | 36 content::NotificationService::AllSources()); |
| 35 } | 37 } |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 WebRequestDeclarativePermissionSplit1) { | 223 WebRequestDeclarativePermissionSplit1) { |
| 222 // Test split with incognito permission. | 224 // Test split with incognito permission. |
| 223 RunPermissionTest("split", true, true, "redirected1", "redirected2"); | 225 RunPermissionTest("split", true, true, "redirected1", "redirected2"); |
| 224 } | 226 } |
| 225 | 227 |
| 226 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 228 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
| 227 WebRequestDeclarativePermissionSplit2) { | 229 WebRequestDeclarativePermissionSplit2) { |
| 228 // Test split without incognito permission. | 230 // Test split without incognito permission. |
| 229 RunPermissionTest("split", false, false, "redirected1", ""); | 231 RunPermissionTest("split", false, false, "redirected1", ""); |
| 230 } | 232 } |
| 233 |
| 234 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, PostData) { |
| 235 // Request body access is only enabled on dev (and canary). |
| 236 Feature::ScopedCurrentChannel sc(chrome::VersionInfo::CHANNEL_DEV); |
| 237 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_post.html")) << |
| 238 message_; |
| 239 } |
| OLD | NEW |