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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 1259673002: Make UTF16ToASCII and UTF16TOUTF8 take a StringPiece (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 658fb846b92bda7537e28fd55182590423c8ef39..d2f13d9a090005b663b27180b2ca7c9e737e9f43 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -1343,8 +1343,8 @@ TEST_F(RenderViewImplTest, OnHandleKeyboardEvent) {
// text created from a virtual-key code, a character code, and the
// modifier-key status.
const int kMaxOutputCharacters = 1024;
- std::string output = base::UTF16ToUTF8(
- GetMainFrame()->contentAsText(kMaxOutputCharacters));
+ std::string output = base::UTF16ToUTF8(base::StringPiece16(
+ GetMainFrame()->contentAsText(kMaxOutputCharacters)));
EXPECT_EQ(expected_result, output);
}
}
@@ -1912,8 +1912,8 @@ TEST_F(RenderViewImplTest, NavigateSubframe) {
// Copy the document content to std::wstring and compare with the
// expected result.
const int kMaxOutputCharacters = 256;
- std::string output = base::UTF16ToUTF8(
- GetMainFrame()->contentAsText(kMaxOutputCharacters));
+ std::string output = base::UTF16ToUTF8(base::StringPiece16(
+ GetMainFrame()->contentAsText(kMaxOutputCharacters)));
EXPECT_EQ(output, "hello \n\nworld");
}
@@ -2034,8 +2034,8 @@ TEST_F(RendererErrorPageTest, MAYBE_Suppresses) {
main_frame->didFailProvisionalLoad(web_frame, error,
blink::WebStandardCommit);
const int kMaxOutputCharacters = 22;
- EXPECT_EQ("",
- base::UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters)));
+ EXPECT_EQ("", base::UTF16ToASCII(
+ base::StringPiece16(web_frame->contentAsText(kMaxOutputCharacters))));
}
#if defined(OS_ANDROID)
@@ -2069,7 +2069,8 @@ TEST_F(RendererErrorPageTest, MAYBE_DoesNotSuppress) {
FrameLoadWaiter(main_frame).Wait();
const int kMaxOutputCharacters = 22;
EXPECT_EQ("A suffusion of yellow.",
- base::UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters)));
+ base::UTF16ToASCII(base::StringPiece16(
+ web_frame->contentAsText(kMaxOutputCharacters))));
}
#if defined(OS_ANDROID)
@@ -2102,7 +2103,8 @@ TEST_F(RendererErrorPageTest, MAYBE_HttpStatusCodeErrorWithEmptyBody) {
FrameLoadWaiter(main_frame).Wait();
const int kMaxOutputCharacters = 22;
EXPECT_EQ("A suffusion of yellow.",
- base::UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters)));
+ base::UTF16ToASCII(base::StringPiece16(
+ web_frame->contentAsText(kMaxOutputCharacters))));
}
// Ensure the render view sends favicon url update events correctly.
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698