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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 EXPECT_TRUE(listener1.WaitUntilSatisfied()); | 546 EXPECT_TRUE(listener1.WaitUntilSatisfied()); |
547 EXPECT_TRUE(listener2.WaitUntilSatisfied()); | 547 EXPECT_TRUE(listener2.WaitUntilSatisfied()); |
548 } | 548 } |
549 | 549 |
550 // Tests that webRequest works with the --scripts-require-action feature. | 550 // Tests that webRequest works with the --scripts-require-action feature. |
551 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 551 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
552 WebRequestWithWithheldPermissions) { | 552 WebRequestWithWithheldPermissions) { |
553 FeatureSwitch::ScopedOverride enable_scripts_require_action( | 553 FeatureSwitch::ScopedOverride enable_scripts_require_action( |
554 FeatureSwitch::scripts_require_action(), true); | 554 FeatureSwitch::scripts_require_action(), true); |
555 | 555 |
556 host_resolver()->AddRule("*", "127.0.0.1"); | |
557 content::SetupCrossSiteRedirector(embedded_test_server()); | 556 content::SetupCrossSiteRedirector(embedded_test_server()); |
558 ASSERT_TRUE(embedded_test_server()->Start()); | 557 ASSERT_TRUE(embedded_test_server()->Start()); |
559 | 558 |
560 // Load an extension that registers a listener for webRequest events, and | 559 // Load an extension that registers a listener for webRequest events, and |
561 // wait 'til it's initialized. | 560 // wait 'til it's initialized. |
562 ExtensionTestMessageListener listener("ready", false); | 561 ExtensionTestMessageListener listener("ready", false); |
563 const Extension* extension = | 562 const Extension* extension = |
564 LoadExtension(test_data_dir_.AppendASCII("webrequest_activetab")); | 563 LoadExtension(test_data_dir_.AppendASCII("webrequest_activetab")); |
565 ASSERT_TRUE(extension) << message_; | 564 ASSERT_TRUE(extension) << message_; |
566 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 565 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // requests when authenrication is requested by server. | 665 // requests when authenrication is requested by server. |
667 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 666 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
668 WebSocketRequestAuthRequired) { | 667 WebSocketRequestAuthRequired) { |
669 ASSERT_TRUE(StartEmbeddedTestServer()); | 668 ASSERT_TRUE(StartEmbeddedTestServer()); |
670 ASSERT_TRUE(StartWebSocketServer(net::GetWebSocketTestDataDirectory(), true)); | 669 ASSERT_TRUE(StartWebSocketServer(net::GetWebSocketTestDataDirectory(), true)); |
671 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_websocket_auth.html")) | 670 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_websocket_auth.html")) |
672 << message_; | 671 << message_; |
673 } | 672 } |
674 | 673 |
675 } // namespace extensions | 674 } // namespace extensions |
OLD | NEW |