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

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

Issue 2370663002: Remove logic to reset input method more than needed (Closed)
Patch Set: fix test, fix IMC 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 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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 EXPECT_EQ(6, info.selectionStart); 1580 EXPECT_EQ(6, info.selectionStart);
1581 EXPECT_EQ(11, info.selectionEnd); 1581 EXPECT_EQ(11, info.selectionEnd);
1582 EXPECT_EQ(6, info.compositionStart); 1582 EXPECT_EQ(6, info.compositionStart);
1583 EXPECT_EQ(11, info.compositionEnd); 1583 EXPECT_EQ(11, info.compositionEnd);
1584 1584
1585 frame->setEditableSelectionOffsets(2, 2); 1585 frame->setEditableSelectionOffsets(2, 2);
1586 info = activeInputMethodController->textInputInfo(); 1586 info = activeInputMethodController->textInputInfo();
1587 EXPECT_EQ("hello world", std::string(info.value.utf8().data())); 1587 EXPECT_EQ("hello world", std::string(info.value.utf8().data()));
1588 EXPECT_EQ(2, info.selectionStart); 1588 EXPECT_EQ(2, info.selectionStart);
1589 EXPECT_EQ(2, info.selectionEnd); 1589 EXPECT_EQ(2, info.selectionEnd);
1590 EXPECT_EQ(-1, info.compositionStart); 1590 // Composition range should be reset by browser process or keyboard apps.
1591 EXPECT_EQ(-1, info.compositionEnd); 1591 EXPECT_EQ(6, info.compositionStart);
1592 EXPECT_EQ(11, info.compositionEnd);
1592 } 1593 }
1593 1594
1594 TEST_P(WebViewTest, IsSelectionAnchorFirst) { 1595 TEST_P(WebViewTest, IsSelectionAnchorFirst) {
1595 URLTestHelpers::registerMockedURLFromBaseURL( 1596 URLTestHelpers::registerMockedURLFromBaseURL(
1596 WebString::fromUTF8(m_baseURL.c_str()), 1597 WebString::fromUTF8(m_baseURL.c_str()),
1597 WebString::fromUTF8("input_field_populated.html")); 1598 WebString::fromUTF8("input_field_populated.html"));
1598 WebViewImpl* webView = m_webViewHelper.initializeAndLoad( 1599 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(
1599 m_baseURL + "input_field_populated.html"); 1600 m_baseURL + "input_field_populated.html");
1600 WebLocalFrame* frame = webView->mainFrameImpl(); 1601 WebLocalFrame* frame = webView->mainFrameImpl();
1601 1602
(...skipping 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after
4352 frame->printBegin(printParams, WebNode()); 4353 frame->printBegin(printParams, WebNode());
4353 webView->resize(WebSize(500, 500)); 4354 webView->resize(WebSize(500, 500));
4354 EXPECT_EQ(500, vwElement->offsetWidth()); 4355 EXPECT_EQ(500, vwElement->offsetWidth());
4355 4356
4356 webView->resize(WebSize(800, 600)); 4357 webView->resize(WebSize(800, 600));
4357 frame->printEnd(); 4358 frame->printEnd();
4358 EXPECT_EQ(800, vwElement->offsetWidth()); 4359 EXPECT_EQ(800, vwElement->offsetWidth());
4359 } 4360 }
4360 4361
4361 } // namespace blink 4362 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698