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

Unified Diff: chrome/renderer/render_view_unittest.cc

Issue 164225: Switch to WebFrame from the WebKit API.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « chrome/renderer/render_view.cc ('k') | chrome/renderer/renderer_glue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view_unittest.cc
===================================================================
--- chrome/renderer/render_view_unittest.cc (revision 22886)
+++ chrome/renderer/render_view_unittest.cc (working copy)
@@ -14,6 +14,7 @@
#include "webkit/api/public/WebURLError.h"
using WebKit::WebCompositionCommand;
+using WebKit::WebFrame;
using WebKit::WebTextDirection;
using WebKit::WebURLError;
@@ -247,8 +248,8 @@
// Retrieve the content of this page and compare it with the expected
// result.
const int kMaxOutputCharacters = 128;
- std::wstring output;
- GetMainFrame()->GetContentAsPlainText(kMaxOutputCharacters, &output);
+ std::wstring output = UTF16ToWideHack(
+ GetMainFrame()->contentAsText(kMaxOutputCharacters));
EXPECT_EQ(output, ime_message->result);
}
}
@@ -296,8 +297,8 @@
// Copy the document content to std::wstring and compare with the
// expected result.
const int kMaxOutputCharacters = 16;
- std::wstring output;
- GetMainFrame()->GetContentAsPlainText(kMaxOutputCharacters, &output);
+ std::wstring output = UTF16ToWideHack(
+ GetMainFrame()->contentAsText(kMaxOutputCharacters));
EXPECT_EQ(output, kTextDirection[i].expected_result);
}
}
@@ -612,9 +613,8 @@
// text created from a virtual-key code, a character code, and the
// modifier-key status.
const int kMaxOutputCharacters = 1024;
- std::wstring output;
- GetMainFrame()->GetContentAsPlainText(kMaxOutputCharacters, &output);
-
+ std::wstring output = UTF16ToWideHack(
+ GetMainFrame()->contentAsText(kMaxOutputCharacters));
EXPECT_EQ(expected_result, output);
}
}
@@ -825,8 +825,8 @@
// text created from a virtual-key code, a character code, and the
// modifier-key status.
const int kMaxOutputCharacters = 4096;
- std::wstring output;
- GetMainFrame()->GetContentAsPlainText(kMaxOutputCharacters, &output);
+ std::wstring output = UTF16ToWideHack(
+ GetMainFrame()->contentAsText(kMaxOutputCharacters));
EXPECT_EQ(kLayouts[i].expected_result, output);
}
#else
@@ -852,15 +852,15 @@
#endif
TEST_F(RenderViewTest, DidFailProvisionalLoadWithErrorForCancellation) {
- GetMainFrame()->SetInViewSourceMode(true);
+ GetMainFrame()->enableViewSourceMode(true);
WebURLError error;
error.domain.fromUTF8("test_domain");
error.reason = net::ERR_ABORTED;
error.unreachableURL = GURL("http://foo");
WebFrame* web_frame = GetMainFrame();
- WebView* web_view = web_frame->GetView();
+ WebView* web_view = web_frame->view();
// A cancellation occurred.
view_->DidFailProvisionalLoadWithError(web_view, error, web_frame);
// Frame should stay in view-source mode.
- EXPECT_TRUE(web_frame->GetInViewSourceMode());
+ EXPECT_TRUE(web_frame->isViewSourceModeEnabled());
}
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/renderer_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698