| OLD | NEW |
| 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 EXPECT_EQ(8, info.selectionStart); | 966 EXPECT_EQ(8, info.selectionStart); |
| 967 EXPECT_EQ(8, info.selectionEnd); | 967 EXPECT_EQ(8, info.selectionEnd); |
| 968 EXPECT_EQ(-1, info.compositionStart); | 968 EXPECT_EQ(-1, info.compositionStart); |
| 969 EXPECT_EQ(-1, info.compositionEnd); | 969 EXPECT_EQ(-1, info.compositionEnd); |
| 970 } | 970 } |
| 971 | 971 |
| 972 TEST_F(WebViewTest, FinishCompositionDoesNotRevealSelection) | 972 TEST_F(WebViewTest, FinishCompositionDoesNotRevealSelection) |
| 973 { | 973 { |
| 974 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("form_with_input.html")); | 974 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("form_with_input.html")); |
| 975 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form_w
ith_input.html"); | 975 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form_w
ith_input.html"); |
| 976 webView->resize(WebSize(800, 600)); |
| 976 webView->setInitialFocus(false); | 977 webView->setInitialFocus(false); |
| 977 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); | 978 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().width); |
| 978 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height); | 979 EXPECT_EQ(0, webView->mainFrame()->scrollOffset().height); |
| 979 | 980 |
| 980 // Set up a composition from existing text that needs to be committed. | 981 // Set up a composition from existing text that needs to be committed. |
| 981 Vector<CompositionUnderline> emptyUnderlines; | 982 Vector<CompositionUnderline> emptyUnderlines; |
| 982 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); | 983 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); |
| 983 frame->frame()->inputMethodController().setCompositionFromExistingText(empty
Underlines, 3, 3); | 984 frame->frame()->inputMethodController().setCompositionFromExistingText(empty
Underlines, 3, 3); |
| 984 | 985 |
| 985 // Scroll the input field out of the viewport. | 986 // Scroll the input field out of the viewport. |
| (...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 frame->setAutofillClient(&client); | 3276 frame->setAutofillClient(&client); |
| 3276 webView->setInitialFocus(false); | 3277 webView->setInitialFocus(false); |
| 3277 | 3278 |
| 3278 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3279 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3279 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3280 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3280 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3281 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3281 frame->setAutofillClient(0); | 3282 frame->setAutofillClient(0); |
| 3282 } | 3283 } |
| 3283 | 3284 |
| 3284 } // namespace blink | 3285 } // namespace blink |
| OLD | NEW |