Chromium Code Reviews| 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 "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 ASSERT_TRUE(StartEmbeddedTestServer()); | 152 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 153 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_complex.html")) << | 153 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_complex.html")) << |
| 154 message_; | 154 message_; |
| 155 } | 155 } |
| 156 | 156 |
| 157 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestTypes) { | 157 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestTypes) { |
| 158 ASSERT_TRUE(StartEmbeddedTestServer()); | 158 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 159 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_types.html")) << message_; | 159 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_types.html")) << message_; |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Tests what happens when a frame/tab is removed while a response is being | |
| 163 // received. | |
|
battre
2016/05/23 11:17:07
Rephrase this to "Test that ... happens"?
robwu
2016/05/23 11:51:03
Done.
| |
| 164 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | |
| 165 WebRequestUnloadAfterRequest) { | |
| 166 ASSERT_TRUE(StartEmbeddedTestServer()); | |
| 167 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?1")) << | |
| 168 message_; | |
| 169 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?2")) << | |
| 170 message_; | |
| 171 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?3")) << | |
| 172 message_; | |
| 173 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?4")) << | |
| 174 message_; | |
| 175 } | |
| 176 | |
| 177 // Tests what happens when a frame/tab is removed immediately after issuing a | |
| 178 // request. | |
|
battre
2016/05/23 11:17:07
Ditto.
robwu
2016/05/23 11:51:03
Done.
| |
| 179 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | |
| 180 WebRequestUnloadImmediately) { | |
| 181 ASSERT_TRUE(StartEmbeddedTestServer()); | |
| 182 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?5")) << | |
| 183 message_; | |
| 184 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_unload.html?6")) << | |
| 185 message_; | |
| 186 } | |
| 187 | |
| 162 // Flaky (sometimes crash): http://crbug.com/140976 | 188 // Flaky (sometimes crash): http://crbug.com/140976 |
| 163 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 189 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
| 164 DISABLED_WebRequestAuthRequired) { | 190 DISABLED_WebRequestAuthRequired) { |
| 165 CancelLoginDialog login_dialog_helper; | 191 CancelLoginDialog login_dialog_helper; |
| 166 | 192 |
| 167 ASSERT_TRUE(StartEmbeddedTestServer()); | 193 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 168 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_auth_required.html")) << | 194 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_auth_required.html")) << |
| 169 message_; | 195 message_; |
| 170 } | 196 } |
| 171 | 197 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 ASSERT_TRUE(granter); | 578 ASSERT_TRUE(granter); |
| 553 granter->RevokeForTesting(); | 579 granter->RevokeForTesting(); |
| 554 base::RunLoop().RunUntilIdle(); | 580 base::RunLoop().RunUntilIdle(); |
| 555 PerformXhrInPage(web_contents, kHost, port, kXhrPath); | 581 PerformXhrInPage(web_contents, kHost, port, kXhrPath); |
| 556 EXPECT_EQ(xhr_count, | 582 EXPECT_EQ(xhr_count, |
| 557 GetWebRequestCountFromBackgroundPage(extension, profile())); | 583 GetWebRequestCountFromBackgroundPage(extension, profile())); |
| 558 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension)); | 584 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension)); |
| 559 } | 585 } |
| 560 | 586 |
| 561 } // namespace extensions | 587 } // namespace extensions |
| OLD | NEW |