| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 class LinkSelectionTest : public LinkSelectionTestBase { | 122 class LinkSelectionTest : public LinkSelectionTestBase { |
| 123 protected: | 123 protected: |
| 124 void SetUp() override { | 124 void SetUp() override { |
| 125 const char* const kHTMLString = | 125 const char* const kHTMLString = |
| 126 "<a id='link' href='foo.com' style='font-size:20pt'>Text to select " | 126 "<a id='link' href='foo.com' style='font-size:20pt'>Text to select " |
| 127 "foobar</a>" | 127 "foobar</a>" |
| 128 "<div id='page_text'>Lorem ipsum dolor sit amet</div>"; | 128 "<div id='page_text'>Lorem ipsum dolor sit amet</div>"; |
| 129 | 129 |
| 130 // We need to set deviceSupportsMouse setting to true and page's focus | 130 m_webView = m_helper.initialize(false, &m_testFrameClient, nullptr, nullptr, |
| 131 // controller to active so that FrameView can set the mouse cursor. | 131 [](WebSettings* settings) {}); |
| 132 m_webView = m_helper.initialize( | |
| 133 false, &m_testFrameClient, nullptr, nullptr, | |
| 134 [](WebSettings* settings) { settings->setDeviceSupportsMouse(true); }); | |
| 135 m_mainFrame = m_webView->mainFrameImpl(); | 132 m_mainFrame = m_webView->mainFrameImpl(); |
| 136 FrameTestHelpers::loadHTMLString( | 133 FrameTestHelpers::loadHTMLString( |
| 137 m_mainFrame, kHTMLString, URLTestHelpers::toKURL("http://foobar.com")); | 134 m_mainFrame, kHTMLString, URLTestHelpers::toKURL("http://foobar.com")); |
| 138 m_webView->resize(WebSize(800, 600)); | 135 m_webView->resize(WebSize(800, 600)); |
| 139 m_webView->page()->focusController().setActive(true); | 136 m_webView->page()->focusController().setActive(true); |
| 140 | 137 |
| 141 auto* document = m_mainFrame->frame()->document(); | 138 auto* document = m_mainFrame->frame()->document(); |
| 142 ASSERT_NE(nullptr, document); | 139 ASSERT_NE(nullptr, document); |
| 143 auto* linkToSelect = document->getElementById("link")->firstChild(); | 140 auto* linkToSelect = document->getElementById("link")->firstChild(); |
| 144 ASSERT_NE(nullptr, linkToSelect); | 141 ASSERT_NE(nullptr, linkToSelect); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 checkMouseClicks(*element, false); | 324 checkMouseClicks(*element, false); |
| 328 } | 325 } |
| 329 | 326 |
| 330 { | 327 { |
| 331 SCOPED_TRACE("Text div, double click"); | 328 SCOPED_TRACE("Text div, double click"); |
| 332 checkMouseClicks(*element, true); | 329 checkMouseClicks(*element, true); |
| 333 } | 330 } |
| 334 } | 331 } |
| 335 | 332 |
| 336 } // namespace blink | 333 } // namespace blink |
| OLD | NEW |