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

Side by Side Diff: chrome/browser/extensions/api/cloud_print_private/cloud_print_private_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 "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_ api.h" 5 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_ api.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 14 matching lines...) Expand all
25 class ExtensionCloudPrintPrivateApiTest : public ExtensionApiTest { 25 class ExtensionCloudPrintPrivateApiTest : public ExtensionApiTest {
26 public: 26 public:
27 void SetUpCommandLine(base::CommandLine* command_line) override { 27 void SetUpCommandLine(base::CommandLine* command_line) override {
28 ExtensionApiTest::SetUpCommandLine(command_line); 28 ExtensionApiTest::SetUpCommandLine(command_line);
29 command_line->AppendSwitchASCII( 29 command_line->AppendSwitchASCII(
30 switches::kCloudPrintURL, 30 switches::kCloudPrintURL,
31 "http://www.cloudprintapp.com/extensions/api_test/" 31 "http://www.cloudprintapp.com/extensions/api_test/"
32 "cloud_print_private"); 32 "cloud_print_private");
33 } 33 }
34 34
35 void SetUpInProcessBrowserTestFixture() override { 35 void SetUpOnMainThread() override {
36 ExtensionApiTest::SetUpOnMainThread();
36 // Start up the test server and get us ready for calling the install 37 // Start up the test server and get us ready for calling the install
37 // API functions. 38 // API functions.
38 host_resolver()->AddRule("www.cloudprintapp.com", "127.0.0.1"); 39 host_resolver()->AddRule("www.cloudprintapp.com", "127.0.0.1");
39 ASSERT_TRUE(embedded_test_server()->Start()); 40 ASSERT_TRUE(embedded_test_server()->Start());
40 } 41 }
41 42
42 protected: 43 protected:
43 // Returns a test server URL, but with host 'www.cloudprintapp.com' so it 44 // Returns a test server URL, but with host 'www.cloudprintapp.com' so it
44 // matches the cloud print app's extent that we set up via command line flags. 45 // matches the cloud print app's extent that we set up via command line flags.
45 GURL GetTestServerURL(const std::string& path) { 46 GURL GetTestServerURL(const std::string& path) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 121 }
121 122
122 IN_PROC_BROWSER_TEST_F(ExtensionCloudPrintPrivateApiTest, 123 IN_PROC_BROWSER_TEST_F(ExtensionCloudPrintPrivateApiTest,
123 CloudPrintHostedIncognito) { 124 CloudPrintHostedIncognito) {
124 GURL page_url = GetTestServerURL( 125 GURL page_url = GetTestServerURL(
125 "enable_chrome_connector/cloud_print_incognito_failure_tests.html"); 126 "enable_chrome_connector/cloud_print_incognito_failure_tests.html");
126 ASSERT_TRUE(RunPageTest(page_url.spec(), kFlagUseIncognito)); 127 ASSERT_TRUE(RunPageTest(page_url.spec(), kFlagUseIncognito));
127 } 128 }
128 129
129 #endif // !defined(OS_CHROMEOS) 130 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698