Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/TextControlElementTest.cpp |
| diff --git a/third_party/WebKit/Source/core/html/TextControlElementTest.cpp b/third_party/WebKit/Source/core/html/TextControlElementTest.cpp |
| index 22d78a48528e4e4c689d3daf698f4b35f4e02dd3..a0c2becb2775850f3291594ecac411e90e410c66 100644 |
| --- a/third_party/WebKit/Source/core/html/TextControlElementTest.cpp |
| +++ b/third_party/WebKit/Source/core/html/TextControlElementTest.cpp |
| @@ -27,9 +27,6 @@ class TextControlElementTest : public ::testing::Test { |
| TextControlElement& textControl() const { return *m_textControl; } |
| HTMLInputElement& input() const { return *m_input; } |
| - int layoutCount() const { return page().frameView().layoutCount(); } |
| - void forceLayoutFlag(); |
| - |
| private: |
| std::unique_ptr<DummyPageHolder> m_dummyPageHolder; |
| @@ -52,15 +49,6 @@ void TextControlElementTest::SetUp() { |
| m_input = toHTMLInputElement(m_document->getElementById("input")); |
| } |
| -void TextControlElementTest::forceLayoutFlag() { |
| - FrameView& frameView = page().frameView(); |
| - IntRect frameRect = frameView.frameRect(); |
| - frameRect.setWidth(frameRect.width() + 1); |
| - frameRect.setHeight(frameRect.height() + 1); |
| - page().frameView().setFrameRect(frameRect); |
| - document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| -} |
| - |
| TEST_F(TextControlElementTest, SetSelectionRange) { |
| EXPECT_EQ(0u, textControl().selectionStart()); |
| EXPECT_EQ(0u, textControl().selectionEnd()); |
| @@ -78,24 +66,16 @@ TEST_F(TextControlElementTest, SetSelectionRangeDoesNotCauseLayout) { |
| input().focus(); |
| input().setValue("Hello, input form."); |
| input().setSelectionRange(1, 1); |
| - FrameSelection& frameSelection = document().frame()->selection(); |
| - forceLayoutFlag(); |
| - LayoutRect oldCaretRect(frameSelection.absoluteCaretBounds()); |
| - EXPECT_FALSE(oldCaretRect.isEmpty()); |
| - int startLayoutCount = layoutCount(); |
| - input().setSelectionRange(1, 1); |
| - EXPECT_EQ(startLayoutCount, layoutCount()); |
| - LayoutRect newCaretRect(frameSelection.absoluteCaretBounds()); |
| - EXPECT_EQ(oldCaretRect, newCaretRect); |
| - |
| - forceLayoutFlag(); |
| - oldCaretRect = LayoutRect(frameSelection.absoluteCaretBounds()); |
| - EXPECT_FALSE(oldCaretRect.isEmpty()); |
| - startLayoutCount = layoutCount(); |
| - input().setSelectionRange(2, 2); |
| - EXPECT_EQ(startLayoutCount, layoutCount()); |
| - newCaretRect = LayoutRect(frameSelection.absoluteCaretBounds()); |
| - EXPECT_NE(oldCaretRect, newCaretRect); |
| + |
| + // Force layout if document().updateStyleAndLayoutIgnorePendingStylesheets() |
| + // is called. |
| + document().body()->appendChild(document().createTextNode("foo")); |
| + { |
| + EXPECT_TRUE(document().needsLayoutTreeUpdate()); |
| + DocumentLifecycle::DisallowTransitionScope disallowTransition( |
|
yosin_UTC9
2017/02/24 07:36:36
DocumentLifecycle::DisallowTransitionScope does no
yoichio
2017/02/28 02:11:39
What do you mean? This test is built as both debug
yosin_UTC9
2017/02/28 02:23:05
I mean rather than detecting test failure by DCHEC
yoichio
2017/02/28 04:11:56
Done.
|
| + document().lifecycle()); |
| + input().setSelectionRange(2, 2); |
| + } |
| } |
| TEST_F(TextControlElementTest, IndexForPosition) { |