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

Side by Side Diff: chrome/browser/extensions/process_manager_browsertest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/process_manager.h" 5 #include "extensions/browser/process_manager.h"
6 6
7 #include "chrome/browser/extensions/browser_action_test_util.h" 7 #include "chrome/browser/extensions/browser_action_test_util.h"
8 #include "chrome/browser/extensions/extension_browsertest.h" 8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ASSERT_EQ(0u, pm->GetAllViews().size()); 117 ASSERT_EQ(0u, pm->GetAllViews().size());
118 118
119 // Load an extension with a background page. 119 // Load an extension with a background page.
120 scoped_refptr<const Extension> extension = 120 scoped_refptr<const Extension> extension =
121 LoadExtension(test_data_dir_.AppendASCII("api_test") 121 LoadExtension(test_data_dir_.AppendASCII("api_test")
122 .AppendASCII("browser_action") 122 .AppendASCII("browser_action")
123 .AppendASCII("none")); 123 .AppendASCII("none"));
124 124
125 // Set up a test server running at http://[extension-id] 125 // Set up a test server running at http://[extension-id]
126 ASSERT_TRUE(extension.get()); 126 ASSERT_TRUE(extension.get());
127 const std::string aliased_host = extension->id(); 127 const std::string& aliased_host = extension->id();
128 host_resolver()->AddRule(aliased_host, "127.0.0.1"); 128 host_resolver()->AddRule(aliased_host, "127.0.0.1");
129 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 129 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
130 GURL url = 130 GURL url =
131 embedded_test_server()->GetURL("/extensions/test_file_with_body.html"); 131 embedded_test_server()->GetURL("/extensions/test_file_with_body.html");
132 GURL::Replacements replace_host; 132 GURL::Replacements replace_host;
133 replace_host.SetHostStr(aliased_host); 133 replace_host.SetHostStr(aliased_host);
134 url = url.ReplaceComponents(replace_host); 134 url = url.ReplaceComponents(replace_host);
135 135
136 // Load a page from the test host in a new tab. 136 // Load a page from the test host in a new tab.
137 ui_test_utils::NavigateToURLWithDisposition( 137 ui_test_utils::NavigateToURLWithDisposition(
(...skipping 14 matching lines...) Expand all
152 content::WebContents::FromRenderViewHost( 152 content::WebContents::FromRenderViewHost(
153 *pm->GetRenderViewHostsForExtension(extension->id()).begin()); 153 *pm->GetRenderViewHostsForExtension(extension->id()).begin());
154 EXPECT_TRUE(extension_web_contents->GetSiteInstance() != 154 EXPECT_TRUE(extension_web_contents->GetSiteInstance() !=
155 tab_web_contents->GetSiteInstance()); 155 tab_web_contents->GetSiteInstance());
156 EXPECT_TRUE(pm->GetSiteInstanceForURL(extension->url()) != 156 EXPECT_TRUE(pm->GetSiteInstanceForURL(extension->url()) !=
157 tab_web_contents->GetSiteInstance()); 157 tab_web_contents->GetSiteInstance());
158 EXPECT_TRUE(pm->GetBackgroundHostForExtension(extension->id())); 158 EXPECT_TRUE(pm->GetBackgroundHostForExtension(extension->id()));
159 } 159 }
160 160
161 } // namespace extensions 161 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/process_management_browsertest.cc ('k') | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698