OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <tuple> | 7 #include <tuple> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 frame()->SetEditableSelectionOffsets(4, 8); | 1582 frame()->SetEditableSelectionOffsets(4, 8); |
1583 const std::vector<blink::WebCompositionUnderline> empty_underline; | 1583 const std::vector<blink::WebCompositionUnderline> empty_underline; |
1584 frame()->SetCompositionFromExistingText(7, 10, empty_underline); | 1584 frame()->SetCompositionFromExistingText(7, 10, empty_underline); |
1585 blink::WebInputMethodController* controller = | 1585 blink::WebInputMethodController* controller = |
1586 frame()->GetWebFrame()->inputMethodController(); | 1586 frame()->GetWebFrame()->inputMethodController(); |
1587 blink::WebTextInputInfo info = controller->textInputInfo(); | 1587 blink::WebTextInputInfo info = controller->textInputInfo(); |
1588 EXPECT_EQ(4, info.selectionStart); | 1588 EXPECT_EQ(4, info.selectionStart); |
1589 EXPECT_EQ(8, info.selectionEnd); | 1589 EXPECT_EQ(8, info.selectionEnd); |
1590 EXPECT_EQ(7, info.compositionStart); | 1590 EXPECT_EQ(7, info.compositionStart); |
1591 EXPECT_EQ(10, info.compositionEnd); | 1591 EXPECT_EQ(10, info.compositionEnd); |
1592 frame()->Unselect(); | 1592 frame()->CollapseSelection(); |
1593 info = controller->textInputInfo(); | 1593 info = controller->textInputInfo(); |
1594 EXPECT_EQ(0, info.selectionStart); | 1594 EXPECT_EQ(8, info.selectionStart); |
1595 EXPECT_EQ(0, info.selectionEnd); | 1595 EXPECT_EQ(8, info.selectionEnd); |
1596 } | 1596 } |
1597 | 1597 |
1598 TEST_F(RenderViewImplTest, OnExtendSelectionAndDelete) { | 1598 TEST_F(RenderViewImplTest, OnExtendSelectionAndDelete) { |
1599 // Load an HTML page consisting of an input field. | 1599 // Load an HTML page consisting of an input field. |
1600 LoadHTML("<html>" | 1600 LoadHTML("<html>" |
1601 "<head>" | 1601 "<head>" |
1602 "</head>" | 1602 "</head>" |
1603 "<body>" | 1603 "<body>" |
1604 "<input id=\"test1\" value=\"abcdefghijklmnopqrstuvwxyz\"></input>" | 1604 "<input id=\"test1\" value=\"abcdefghijklmnopqrstuvwxyz\"></input>" |
1605 "</body>" | 1605 "</body>" |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2589 ExpectPauseAndResume(3); | 2589 ExpectPauseAndResume(3); |
2590 blink::WebScriptSource source2( | 2590 blink::WebScriptSource source2( |
2591 WebString::fromUTF8("function func2() { func1(); }; func2();")); | 2591 WebString::fromUTF8("function func2() { func1(); }; func2();")); |
2592 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1); | 2592 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1); |
2593 | 2593 |
2594 EXPECT_FALSE(IsPaused()); | 2594 EXPECT_FALSE(IsPaused()); |
2595 Detach(); | 2595 Detach(); |
2596 } | 2596 } |
2597 | 2597 |
2598 } // namespace content | 2598 } // namespace content |
OLD | NEW |