| 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 listener_pageready.Reply(""); | 492 listener_pageready.Reply(""); |
| 493 EXPECT_TRUE(listener_contentscript.WaitUntilSatisfied()); | 493 EXPECT_TRUE(listener_contentscript.WaitUntilSatisfied()); |
| 494 EXPECT_TRUE(listener_framescript.WaitUntilSatisfied()); | 494 EXPECT_TRUE(listener_framescript.WaitUntilSatisfied()); |
| 495 | 495 |
| 496 // Collect the visited URLs. The content script and subframe does not run in | 496 // Collect the visited URLs. The content script and subframe does not run in |
| 497 // the extension's process, so the requests should be visible to the main | 497 // the extension's process, so the requests should be visible to the main |
| 498 // extension. | 498 // extension. |
| 499 listener_result.Reset(); | 499 listener_result.Reset(); |
| 500 listener_main2.Reply(""); | 500 listener_main2.Reply(""); |
| 501 EXPECT_TRUE(listener_result.WaitUntilSatisfied()); | 501 EXPECT_TRUE(listener_result.WaitUntilSatisfied()); |
| 502 if (content::AreAllSitesIsolatedForTesting() || | 502 |
| 503 IsIsolateExtensionsEnabled()) { | 503 // The extension frame does run in the extension's process. |
| 504 // With --site-per-process, the extension frame does run in the extension's | 504 EXPECT_EQ("Intercepted requests: ?contentscript", listener_result.message()); |
| 505 // process. | |
| 506 EXPECT_EQ("Intercepted requests: ?contentscript", | |
| 507 listener_result.message()); | |
| 508 } else { | |
| 509 EXPECT_EQ("Intercepted requests: ?contentscript, ?framescript", | |
| 510 listener_result.message()); | |
| 511 } | |
| 512 } | 505 } |
| 513 | 506 |
| 514 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, HostedAppRequest) { | 507 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, HostedAppRequest) { |
| 515 ASSERT_TRUE(StartEmbeddedTestServer()); | 508 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 516 GURL hosted_app_url( | 509 GURL hosted_app_url( |
| 517 embedded_test_server()->GetURL( | 510 embedded_test_server()->GetURL( |
| 518 "/extensions/api_test/webrequest_hosted_app/index.html")); | 511 "/extensions/api_test/webrequest_hosted_app/index.html")); |
| 519 scoped_refptr<Extension> hosted_app = | 512 scoped_refptr<Extension> hosted_app = |
| 520 ExtensionBuilder() | 513 ExtensionBuilder() |
| 521 .SetManifest( | 514 .SetManifest( |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 // requests when authenrication is requested by server. | 658 // requests when authenrication is requested by server. |
| 666 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 659 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
| 667 WebSocketRequestAuthRequired) { | 660 WebSocketRequestAuthRequired) { |
| 668 ASSERT_TRUE(StartEmbeddedTestServer()); | 661 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 669 ASSERT_TRUE(StartWebSocketServer(net::GetWebSocketTestDataDirectory(), true)); | 662 ASSERT_TRUE(StartWebSocketServer(net::GetWebSocketTestDataDirectory(), true)); |
| 670 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_websocket_auth.html")) | 663 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_websocket_auth.html")) |
| 671 << message_; | 664 << message_; |
| 672 } | 665 } |
| 673 | 666 |
| 674 } // namespace extensions | 667 } // namespace extensions |
| OLD | NEW |