Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_apitest.cc

Issue 2851103002: Update some host_resolver()->AddRules in chrome/browser. (Closed)
Patch Set: fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698