| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_webrequest_api.h" | 7 #include "chrome/browser/extensions/extension_webrequest_api.h" |
| 8 #include "chrome/browser/ui/login/login_prompt.h" | 8 #include "chrome/browser/ui/login/login_prompt.h" |
| 9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 switches::kEnableExperimentalExtensionApis); | 62 switches::kEnableExperimentalExtensionApis); |
| 63 | 63 |
| 64 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_simple.html")) << | 64 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_simple.html")) << |
| 65 message_; | 65 message_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestComplex) { | 68 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestComplex) { |
| 69 CommandLine::ForCurrentProcess()->AppendSwitch( | 69 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 70 switches::kEnableExperimentalExtensionApis); | 70 switches::kEnableExperimentalExtensionApis); |
| 71 | 71 |
| 72 // Needed for the auth tests. | |
| 73 CancelLoginDialog login_dialog_helper; | |
| 74 | |
| 75 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_complex.html")) << | 72 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_complex.html")) << |
| 76 message_; | 73 message_; |
| 77 } | 74 } |
| 78 | 75 |
| 76 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestAuthRequired) { |
| 77 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 78 switches::kEnableExperimentalExtensionApis); |
| 79 |
| 80 CancelLoginDialog login_dialog_helper; |
| 81 |
| 82 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_auth_required.html")) << |
| 83 message_; |
| 84 } |
| 85 |
| 79 // Hangs flakily: http://crbug.com/91715 | 86 // Hangs flakily: http://crbug.com/91715 |
| 80 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 87 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
| 81 DISABLED_WebRequestBlocking) { | 88 DISABLED_WebRequestBlocking) { |
| 82 CommandLine::ForCurrentProcess()->AppendSwitch( | 89 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 83 switches::kEnableExperimentalExtensionApis); | 90 switches::kEnableExperimentalExtensionApis); |
| 84 | 91 |
| 85 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking.html")) << | 92 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking.html")) << |
| 86 message_; | 93 message_; |
| 87 } | 94 } |
| OLD | NEW |