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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2012823003: Move IME related functions from WebFrame to WebLocalFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 4 years, 6 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 EXPECT_EQ(2, info.selectionStart); 1183 EXPECT_EQ(2, info.selectionStart);
1184 EXPECT_EQ(2, info.selectionEnd); 1184 EXPECT_EQ(2, info.selectionEnd);
1185 EXPECT_EQ(-1, info.compositionStart); 1185 EXPECT_EQ(-1, info.compositionStart);
1186 EXPECT_EQ(-1, info.compositionEnd); 1186 EXPECT_EQ(-1, info.compositionEnd);
1187 } 1187 }
1188 1188
1189 TEST_F(WebViewTest, IsSelectionAnchorFirst) 1189 TEST_F(WebViewTest, IsSelectionAnchorFirst)
1190 { 1190 {
1191 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("input_field_populated.html")); 1191 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("input_field_populated.html"));
1192 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_fiel d_populated.html"); 1192 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_fiel d_populated.html");
1193 WebFrame* frame = webView->mainFrame(); 1193 WebLocalFrame* frame = webView->mainFrame()->toWebLocalFrame();
1194 1194
1195 webView->setInitialFocus(false); 1195 webView->setInitialFocus(false);
1196 frame->setEditableSelectionOffsets(4, 10); 1196 frame->setEditableSelectionOffsets(4, 10);
1197 EXPECT_TRUE(webView->isSelectionAnchorFirst()); 1197 EXPECT_TRUE(webView->isSelectionAnchorFirst());
1198 WebRect anchor; 1198 WebRect anchor;
1199 WebRect focus; 1199 WebRect focus;
1200 webView->selectionBounds(anchor, focus); 1200 webView->selectionBounds(anchor, focus);
1201 frame->selectRange(WebPoint(focus.x, focus.y), WebPoint(anchor.x, anchor.y)) ; 1201 frame->selectRange(WebPoint(focus.x, focus.y), WebPoint(anchor.x, anchor.y)) ;
1202 EXPECT_FALSE(webView->isSelectionAnchorFirst()); 1202 EXPECT_FALSE(webView->isSelectionAnchorFirst());
1203 } 1203 }
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 frame->setAutofillClient(&client); 3177 frame->setAutofillClient(&client);
3178 webView->setInitialFocus(false); 3178 webView->setInitialFocus(false);
3179 3179
3180 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3180 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3181 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3181 EXPECT_EQ(1, client.textChangesFromUserGesture());
3182 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3182 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3183 frame->setAutofillClient(0); 3183 frame->setAutofillClient(0);
3184 } 3184 }
3185 3185
3186 } // namespace blink 3186 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698