Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/FrameCaretTest.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/FrameCaretTest.cpp b/third_party/WebKit/Source/core/editing/FrameCaretTest.cpp |
| index e6c9b9c142893e0a4b08467ef76e0e7d7e169c07..6049a2fad971b535dbae6a2525ea0f00856ff189 100644 |
| --- a/third_party/WebKit/Source/core/editing/FrameCaretTest.cpp |
| +++ b/third_party/WebKit/Source/core/editing/FrameCaretTest.cpp |
| @@ -27,6 +27,10 @@ class FrameCaretTest : public EditingTestBase { |
| LayoutTestSupport::SetIsRunningLayoutTest(was_running_layout_test_); |
| } |
| + bool ShouldBlinkCaret(const FrameCaret& caret) { |
| + return caret.ShouldBlinkCaret(); |
| + } |
| + |
| private: |
| const bool was_running_layout_test_; |
| }; |
| @@ -71,4 +75,22 @@ TEST_F(FrameCaretTest, BlinkAfterTyping) { |
| << "The caret should blink after the typing command."; |
| } |
| +TEST_F(FrameCaretTest, ShouldNotBlinkWhenSelectionLooseFocus) { |
| + FrameCaret& caret = Selection().FrameCaretForTesting(); |
| + GetDocument().GetPage()->GetFocusController().SetActive(true); |
| + GetDocument().GetPage()->GetFocusController().SetFocused(true); |
| + GetDocument().body()->setInnerHTML( |
| + "<div id='outer' tabindex='-1'>" |
| + "<div id='input' contenteditable>foo</div>" |
| + "</div>"); |
| + Element* input = GetDocument().QuerySelector("#input"); |
| + input->focus(); |
| + Element* outer = GetDocument().QuerySelector("#outer"); |
| + outer->focus(); |
| + GetDocument().View()->UpdateAllLifecyclePhases(); |
| + const SelectionInDOMTree& dom = Selection().GetSelectionInDOMTree(); |
|
yosin_UTC9
2017/05/19 06:12:21
nit: s/dom/selection/
It is "DOM Selection" inste
yoichio
2017/05/19 08:00:18
Done.
|
| + EXPECT_EQ(dom.Base(), Position(input, PositionAnchorType::kBeforeChildren)); |
| + EXPECT_FALSE(ShouldBlinkCaret(caret)); |
| +} |
| + |
| } // namespace blink |