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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 EXPECT_EQ(6, info.selectionStart); | 1315 EXPECT_EQ(6, info.selectionStart); |
1316 EXPECT_EQ(11, info.selectionEnd); | 1316 EXPECT_EQ(11, info.selectionEnd); |
1317 EXPECT_EQ(6, info.compositionStart); | 1317 EXPECT_EQ(6, info.compositionStart); |
1318 EXPECT_EQ(11, info.compositionEnd); | 1318 EXPECT_EQ(11, info.compositionEnd); |
1319 | 1319 |
1320 frame->setEditableSelectionOffsets(2, 2); | 1320 frame->setEditableSelectionOffsets(2, 2); |
1321 info = webView->textInputInfo(); | 1321 info = webView->textInputInfo(); |
1322 EXPECT_EQ("hello world", std::string(info.value.utf8().data())); | 1322 EXPECT_EQ("hello world", std::string(info.value.utf8().data())); |
1323 EXPECT_EQ(2, info.selectionStart); | 1323 EXPECT_EQ(2, info.selectionStart); |
1324 EXPECT_EQ(2, info.selectionEnd); | 1324 EXPECT_EQ(2, info.selectionEnd); |
1325 EXPECT_EQ(-1, info.compositionStart); | 1325 // Composition range should be reset by browser process or keyboard apps. |
1326 EXPECT_EQ(-1, info.compositionEnd); | 1326 EXPECT_EQ(6, info.compositionStart); |
| 1327 EXPECT_EQ(11, info.compositionEnd); |
1327 } | 1328 } |
1328 | 1329 |
1329 TEST_F(WebViewTest, IsSelectionAnchorFirst) | 1330 TEST_F(WebViewTest, IsSelectionAnchorFirst) |
1330 { | 1331 { |
1331 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("input_field_populated.html")); | 1332 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("input_field_populated.html")); |
1332 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_
field_populated.html"); | 1333 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_
field_populated.html"); |
1333 WebLocalFrame* frame = webView->mainFrameImpl(); | 1334 WebLocalFrame* frame = webView->mainFrameImpl(); |
1334 | 1335 |
1335 webView->setInitialFocus(false); | 1336 webView->setInitialFocus(false); |
1336 frame->setEditableSelectionOffsets(4, 10); | 1337 frame->setEditableSelectionOffsets(4, 10); |
(...skipping 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3611 EXPECT_TRUE(webView->page()->defersLoading()); | 3612 EXPECT_TRUE(webView->page()->defersLoading()); |
3612 } | 3613 } |
3613 | 3614 |
3614 EXPECT_TRUE(webView->page()->defersLoading()); | 3615 EXPECT_TRUE(webView->page()->defersLoading()); |
3615 } | 3616 } |
3616 | 3617 |
3617 EXPECT_FALSE(webView->page()->defersLoading()); | 3618 EXPECT_FALSE(webView->page()->defersLoading()); |
3618 } | 3619 } |
3619 | 3620 |
3620 } // namespace blink | 3621 } // namespace blink |
OLD | NEW |