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

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: Remove null check in spellcheck_provider.cc and add some log 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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 EXPECT_EQ(2, info.selectionStart); 1048 EXPECT_EQ(2, info.selectionStart);
1049 EXPECT_EQ(2, info.selectionEnd); 1049 EXPECT_EQ(2, info.selectionEnd);
1050 EXPECT_EQ(-1, info.compositionStart); 1050 EXPECT_EQ(-1, info.compositionStart);
1051 EXPECT_EQ(-1, info.compositionEnd); 1051 EXPECT_EQ(-1, info.compositionEnd);
1052 } 1052 }
1053 1053
1054 TEST_F(WebViewTest, IsSelectionAnchorFirst) 1054 TEST_F(WebViewTest, IsSelectionAnchorFirst)
1055 { 1055 {
1056 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("input_field_populated.html")); 1056 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("input_field_populated.html"));
1057 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_fiel d_populated.html"); 1057 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_fiel d_populated.html");
1058 WebFrame* frame = webView->mainFrame(); 1058 WebLocalFrame* frame = webView->mainFrame()->toWebLocalFrame();
1059 1059
1060 webView->setInitialFocus(false); 1060 webView->setInitialFocus(false);
1061 frame->setEditableSelectionOffsets(4, 10); 1061 frame->setEditableSelectionOffsets(4, 10);
1062 EXPECT_TRUE(webView->isSelectionAnchorFirst()); 1062 EXPECT_TRUE(webView->isSelectionAnchorFirst());
1063 WebRect anchor; 1063 WebRect anchor;
1064 WebRect focus; 1064 WebRect focus;
1065 webView->selectionBounds(anchor, focus); 1065 webView->selectionBounds(anchor, focus);
1066 frame->selectRange(WebPoint(focus.x, focus.y), WebPoint(anchor.x, anchor.y)) ; 1066 frame->selectRange(WebPoint(focus.x, focus.y), WebPoint(anchor.x, anchor.y)) ;
1067 EXPECT_FALSE(webView->isSelectionAnchorFirst()); 1067 EXPECT_FALSE(webView->isSelectionAnchorFirst());
1068 } 1068 }
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
3042 frame->setAutofillClient(&client); 3042 frame->setAutofillClient(&client);
3043 webView->setInitialFocus(false); 3043 webView->setInitialFocus(false);
3044 3044
3045 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3045 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3046 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3046 EXPECT_EQ(1, client.textChangesFromUserGesture());
3047 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3047 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3048 frame->setAutofillClient(0); 3048 frame->setAutofillClient(0);
3049 } 3049 }
3050 3050
3051 } // namespace blink 3051 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698