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

Side by Side Diff: chrome/browser/extensions/extension_dom_clipboard_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 "base/strings/stringprintf.h" 5 #include "base/strings/stringprintf.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/test/base/ui_test_utils.h" 9 #include "chrome/test/base/ui_test_utils.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 27 matching lines...) Expand all
38 38
39 if (!LoadExtension(test_data_dir_.AppendASCII("clipboard") 39 if (!LoadExtension(test_data_dir_.AppendASCII("clipboard")
40 .AppendASCII(app_name))) { 40 .AppendASCII(app_name))) {
41 message_ = "Failed to load hosted app."; 41 message_ = "Failed to load hosted app.";
42 return false; 42 return false;
43 } 43 }
44 44
45 GURL base_url = embedded_test_server()->GetURL( 45 GURL base_url = embedded_test_server()->GetURL(
46 "/extensions/api_test/clipboard/"); 46 "/extensions/api_test/clipboard/");
47 GURL::Replacements replace_host; 47 GURL::Replacements replace_host;
48 std::string host_str("localhost"); // Must stay in scope with replace_host. 48 replace_host.SetHostStr("localhost");
49 replace_host.SetHostStr(host_str);
50 base_url = base_url.ReplaceComponents(replace_host); 49 base_url = base_url.ReplaceComponents(replace_host);
51 50
52 std::string launch_page_path = 51 std::string launch_page_path =
53 base::StringPrintf("%s/%s", app_name.c_str(), launch_page.c_str()); 52 base::StringPrintf("%s/%s", app_name.c_str(), launch_page.c_str());
54 ui_test_utils::NavigateToURL(browser(), base_url.Resolve(launch_page_path)); 53 ui_test_utils::NavigateToURL(browser(), base_url.Resolve(launch_page_path));
55 54
56 return true; 55 return true;
57 } 56 }
58 57
59 bool ClipboardApiTest::ExecuteCopyInSelectedTab() { 58 bool ClipboardApiTest::ExecuteCopyInSelectedTab() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 IN_PROC_BROWSER_TEST_F(ClipboardApiTest, HostedAppNoPermission) { 111 IN_PROC_BROWSER_TEST_F(ClipboardApiTest, HostedAppNoPermission) {
113 ASSERT_TRUE(LoadHostedApp("hosted_app_no_permission", "main.html")) 112 ASSERT_TRUE(LoadHostedApp("hosted_app_no_permission", "main.html"))
114 << message_; 113 << message_;
115 114
116 EXPECT_FALSE(ExecuteCopyInSelectedTab()) << message_; 115 EXPECT_FALSE(ExecuteCopyInSelectedTab()) << message_;
117 EXPECT_FALSE(ExecutePasteInSelectedTab()) << message_; 116 EXPECT_FALSE(ExecutePasteInSelectedTab()) << message_;
118 EXPECT_FALSE(ExecuteCommandInIframeInSelectedTab("copy")) << message_; 117 EXPECT_FALSE(ExecuteCommandInIframeInSelectedTab("copy")) << message_;
119 EXPECT_FALSE(ExecuteCommandInIframeInSelectedTab("paste")) << message_; 118 EXPECT_FALSE(ExecuteCommandInIframeInSelectedTab("paste")) << message_;
120 } 119 }
121 120
OLDNEW
« no previous file with comments | « chrome/browser/extensions/content_script_apitest.cc ('k') | chrome/browser/extensions/extension_nacl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698