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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 2656043002: Use explicit WebString conversions in remaining content files (Closed)
Patch Set: build fix Created 3 years, 11 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
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 25bd75ddf6df4df19ea4587e635252edc40aa72a..77a7dab8587c76da2a527f189170bd15c16bb154 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -188,9 +188,8 @@ FrameReplicationState ReconstructReplicationStateForTesting(
FrameReplicationState result;
// can't recover result.scope - no way to get WebTreeScopeType via public
// blink API...
- result.name = base::UTF16ToUTF8(base::StringPiece16(frame->assignedName()));
- result.unique_name =
- base::UTF16ToUTF8(base::StringPiece16(frame->uniqueName()));
+ result.name = frame->assignedName().utf8();
+ result.unique_name = frame->uniqueName().utf8();
result.sandbox_flags = frame->effectiveSandboxFlags();
// result.should_enforce_strict_mixed_content_checking is calculated in the
// browser...
@@ -1275,7 +1274,8 @@ TEST_F(RenderViewImplTest, ImeComposition) {
// result.
const int kMaxOutputCharacters = 128;
base::string16 output = WebFrameContentDumper::dumpWebViewAsText(
- view()->GetWebView(), kMaxOutputCharacters);
+ view()->GetWebView(), kMaxOutputCharacters)
+ .utf16();
EXPECT_EQ(base::WideToUTF16(ime_message->result), output);
}
}
@@ -1324,7 +1324,8 @@ TEST_F(RenderViewImplTest, OnSetTextDirection) {
// expected result.
const int kMaxOutputCharacters = 16;
base::string16 output = WebFrameContentDumper::dumpWebViewAsText(
- view()->GetWebView(), kMaxOutputCharacters);
+ view()->GetWebView(), kMaxOutputCharacters)
+ .utf16();
EXPECT_EQ(base::WideToUTF16(kTextDirection[i].expected_result), output);
}
}
@@ -1692,9 +1693,9 @@ 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(
- base::StringPiece16(WebFrameContentDumper::dumpWebViewAsText(
- view()->GetWebView(), kMaxOutputCharacters)));
+ std::string output = WebFrameContentDumper::dumpWebViewAsText(
+ view()->GetWebView(), kMaxOutputCharacters)
+ .utf8();
EXPECT_EQ(output, "hello \n\nworld");
}
@@ -1834,9 +1835,9 @@ TEST_F(RendererErrorPageTest, MAYBE_DoesNotSuppress) {
FrameLoadWaiter(main_frame).Wait();
const int kMaxOutputCharacters = 22;
EXPECT_EQ("A suffusion of yellow.",
- base::UTF16ToASCII(
- base::StringPiece16(WebFrameContentDumper::dumpWebViewAsText(
- view()->GetWebView(), kMaxOutputCharacters))));
+ WebFrameContentDumper::dumpWebViewAsText(view()->GetWebView(),
+ kMaxOutputCharacters)
+ .ascii());
}
#if defined(OS_ANDROID)
@@ -1869,9 +1870,9 @@ TEST_F(RendererErrorPageTest, MAYBE_HttpStatusCodeErrorWithEmptyBody) {
FrameLoadWaiter(main_frame).Wait();
const int kMaxOutputCharacters = 22;
EXPECT_EQ("A suffusion of yellow.",
- base::UTF16ToASCII(
- base::StringPiece16(WebFrameContentDumper::dumpWebViewAsText(
- view()->GetWebView(), kMaxOutputCharacters))));
+ WebFrameContentDumper::dumpWebViewAsText(view()->GetWebView(),
+ kMaxOutputCharacters)
+ .ascii());
}
// Ensure the render view sends favicon url update events correctly.

Powered by Google App Engine
This is Rietveld 408576698