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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc

Issue 889463003: GURL::Replacements methods accept a StringPiece instead of std::string&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (fixed some merge conflicts). Created 5 years, 10 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 <vector> 5 #include <vector>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 protected: 128 protected:
129 // Returns a test server URL, but with host 'www.example.com' so it matches 129 // Returns a test server URL, but with host 'www.example.com' so it matches
130 // the web store app's extent that we set up via command line flags. 130 // the web store app's extent that we set up via command line flags.
131 GURL DoGetTestServerURL(const std::string& path) { 131 GURL DoGetTestServerURL(const std::string& path) {
132 GURL url = test_server()->GetURL(path); 132 GURL url = test_server()->GetURL(path);
133 133
134 // Replace the host with 'www.example.com' so it matches the web store 134 // Replace the host with 'www.example.com' so it matches the web store
135 // app's extent. 135 // app's extent.
136 GURL::Replacements replace_host; 136 GURL::Replacements replace_host;
137 std::string host_str("www.example.com"); 137 replace_host.SetHostStr("www.example.com");
138 replace_host.SetHostStr(host_str);
139 138
140 return url.ReplaceComponents(replace_host); 139 return url.ReplaceComponents(replace_host);
141 } 140 }
142 141
143 virtual GURL GetTestServerURL(const std::string& path) { 142 virtual GURL GetTestServerURL(const std::string& path) {
144 return DoGetTestServerURL( 143 return DoGetTestServerURL(
145 std::string("files/extensions/api_test/webstore_private/") + path); 144 std::string("files/extensions/api_test/webstore_private/") + path);
146 } 145 }
147 146
148 // Navigates to |page| and runs the Extension API test there. Any downloads 147 // Navigates to |page| and runs the Extension API test there. Any downloads
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // Run tests when the --enable-ephemeral-apps switch is enabled. 428 // Run tests when the --enable-ephemeral-apps switch is enabled.
430 IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest, LaunchEphemeralApp) { 429 IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest, LaunchEphemeralApp) {
431 base::CommandLine::ForCurrentProcess()->AppendSwitch( 430 base::CommandLine::ForCurrentProcess()->AppendSwitch(
432 switches::kEnableEphemeralAppsInWebstore); 431 switches::kEnableEphemeralAppsInWebstore);
433 base::CommandLine::ForCurrentProcess()->AppendSwitch( 432 base::CommandLine::ForCurrentProcess()->AppendSwitch(
434 app_list::switches::kEnableExperimentalAppList); 433 app_list::switches::kEnableExperimentalAppList);
435 ASSERT_TRUE(RunInstallTest("webstore_launch_app.html", "app.crx")); 434 ASSERT_TRUE(RunInstallTest("webstore_launch_app.html", "app.crx"));
436 } 435 }
437 436
438 } // namespace extensions 437 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698