OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "core/dom/Range.h" | 5 #include "core/dom/Range.h" |
6 #include "core/frame/FrameView.h" | 6 #include "core/frame/FrameView.h" |
7 #include "core/input/EventHandler.h" | 7 #include "core/input/EventHandler.h" |
8 #include "core/page/ChromeClient.h" | 8 #include "core/page/ChromeClient.h" |
9 #include "core/page/ContextMenuController.h" | 9 #include "core/page/ContextMenuController.h" |
10 #include "core/page/FocusController.h" | 10 #include "core/page/FocusController.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 class LinkSelectionTest : public LinkSelectionTestBase { | 101 class LinkSelectionTest : public LinkSelectionTestBase { |
102 protected: | 102 protected: |
103 void SetUp() override | 103 void SetUp() override |
104 { | 104 { |
105 const char* const kHTMLString = | 105 const char* const kHTMLString = |
106 "<a id='link' href='foo.com' style='font-size:20pt'>Text to select f
oobar</a>" | 106 "<a id='link' href='foo.com' style='font-size:20pt'>Text to select f
oobar</a>" |
107 "<div id='page_text'>Lorem ipsum dolor sit amet</div>"; | 107 "<div id='page_text'>Lorem ipsum dolor sit amet</div>"; |
108 | 108 |
109 // We need to set deviceSupportsMouse setting to true and page's focus c
ontroller to active | 109 // We need to set deviceSupportsMouse setting to true and page's focus c
ontroller to active |
110 // so that FrameView can set the mouse cursor. | 110 // so that FrameView can set the mouse cursor. |
111 m_webView = m_helper.initialize(false, &m_testFrameClient, nullptr, | 111 m_webView = m_helper.initialize(false, &m_testFrameClient, nullptr, null
ptr, |
112 [](WebSettings* settings) { settings->setDeviceSupportsMouse(true);
}); | 112 [](WebSettings* settings) { settings->setDeviceSupportsMouse(true);
}); |
113 m_mainFrame = m_webView->mainFrameImpl(); | 113 m_mainFrame = m_webView->mainFrameImpl(); |
114 FrameTestHelpers::loadHTMLString(m_mainFrame, kHTMLString, URLTestHelper
s::toKURL("http://foobar.com")); | 114 FrameTestHelpers::loadHTMLString(m_mainFrame, kHTMLString, URLTestHelper
s::toKURL("http://foobar.com")); |
115 m_webView->resize(WebSize(800, 600)); | 115 m_webView->resize(WebSize(800, 600)); |
116 m_webView->page()->focusController().setActive(true); | 116 m_webView->page()->focusController().setActive(true); |
117 | 117 |
118 auto* document = m_mainFrame->frame()->document(); | 118 auto* document = m_mainFrame->frame()->document(); |
119 ASSERT_NE(nullptr, document); | 119 ASSERT_NE(nullptr, document); |
120 auto* linkToSelect = document->getElementById("link")->firstChild(); | 120 auto* linkToSelect = document->getElementById("link")->firstChild(); |
121 ASSERT_NE(nullptr, linkToSelect); | 121 ASSERT_NE(nullptr, linkToSelect); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 checkMouseClicks(*element, false); | 305 checkMouseClicks(*element, false); |
306 } | 306 } |
307 | 307 |
308 { | 308 { |
309 SCOPED_TRACE("Text div, double click"); | 309 SCOPED_TRACE("Text div, double click"); |
310 checkMouseClicks(*element, true); | 310 checkMouseClicks(*element, true); |
311 } | 311 } |
312 } | 312 } |
313 | 313 |
314 } // namespace blink | 314 } // namespace blink |
OLD | NEW |