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

Unified Diff: chrome/renderer/render_view_unittest.cc

Issue 149620: Use WebWidget from the WebKit API. This change also makes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/renderer/render_view.cc ('k') | chrome/renderer/render_widget.h » ('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 20851)
+++ chrome/renderer/render_view_unittest.cc (working copy)
@@ -10,8 +10,23 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/api/public/WebURLError.h"
+using WebKit::WebCompositionCommand;
+using WebKit::WebTextDirection;
using WebKit::WebURLError;
+static WebCompositionCommand ToCompositionCommand(int string_type) {
+ switch (string_type) {
+ default:
+ NOTREACHED();
+ case -1:
+ return WebKit::WebCompositionCommandDiscard;
+ case 0:
+ return WebKit::WebCompositionCommandSet;
+ case 1:
+ return WebKit::WebCompositionCommandConfirm;
+ }
+}
+
TEST_F(RenderViewTest, OnLoadAlternateHTMLText) {
// Test a new navigation.
GURL test_url("http://www.google.com/some_test_url");
@@ -210,11 +225,12 @@
break;
case IME_SETCOMPOSITION:
- view_->OnImeSetComposition(ime_message->string_type,
- ime_message->cursor_position,
- ime_message->target_start,
- ime_message->target_end,
- ime_message->ime_string);
+ view_->OnImeSetComposition(
+ ToCompositionCommand(ime_message->string_type),
+ ime_message->cursor_position,
+ ime_message->target_start,
+ ime_message->target_end,
+ WideToUTF16Hack(ime_message->ime_string));
break;
}
@@ -257,8 +273,8 @@
WebTextDirection direction;
const wchar_t* expected_result;
} kTextDirection[] = {
- {WEB_TEXT_DIRECTION_RTL, L"\x000A" L"rtl,rtl"},
- {WEB_TEXT_DIRECTION_LTR, L"\x000A" L"ltr,ltr"},
+ { WebKit::WebTextDirectionRightToLeft, L"\x000A" L"rtl,rtl" },
+ { WebKit::WebTextDirectionLeftToRight, L"\x000A" L"ltr,ltr" },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTextDirection); ++i) {
// Set the text direction of the <textarea> element.
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698