| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "content/browser/renderer_host/render_view_host_impl.h" | 7 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/content_browser_test.h" | 10 #include "content/public/test/content_browser_test.h" |
| 11 #include "content/public/test/content_browser_test_utils.h" | 11 #include "content/public/test/content_browser_test_utils.h" |
| 12 #include "content/public/test/test_utils.h" | 12 #include "content/public/test/test_utils.h" |
| 13 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
| 14 #include "ui/base/touch/touch_device.h" | 14 #include "ui/base/touch/touch_device.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class InteractionMediaQueriesDynamicTest : public ContentBrowserTest { | 20 class InteractionMediaQueriesDynamicTest : public ContentBrowserTest { |
| 21 public: | 21 public: |
| 22 InteractionMediaQueriesDynamicTest() = default; | 22 InteractionMediaQueriesDynamicTest() = default; |
| 23 ~InteractionMediaQueriesDynamicTest() override = default; | 23 ~InteractionMediaQueriesDynamicTest() override = default; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) || defined(OS_LINUX) |
| 29 IN_PROC_BROWSER_TEST_F(InteractionMediaQueriesDynamicTest, | 29 IN_PROC_BROWSER_TEST_F(InteractionMediaQueriesDynamicTest, |
| 30 PointerMediaQueriesDynamic) { | 30 PointerMediaQueriesDynamic) { |
| 31 GURL test_url = GetTestUrl("", "interaction-mq-dynamic.html"); | 31 GURL test_url = GetTestUrl("", "interaction-mq-dynamic.html"); |
| 32 const base::string16 kSuccessTitle(base::ASCIIToUTF16("SUCCESS")); | 32 const base::string16 kSuccessTitle(base::ASCIIToUTF16("SUCCESS")); |
| 33 TitleWatcher title_watcher(shell()->web_contents(), kSuccessTitle); | 33 TitleWatcher title_watcher(shell()->web_contents(), kSuccessTitle); |
| 34 NavigateToURL(shell(), test_url); | 34 NavigateToURL(shell(), test_url); |
| 35 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); | 35 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); |
| 36 ui::SetAvailablePointerAndHoverTypesForTesting(ui::POINTER_TYPE_COARSE, | 36 ui::SetAvailablePointerAndHoverTypesForTesting(ui::POINTER_TYPE_COARSE, |
| 37 ui::HOVER_TYPE_HOVER); | 37 ui::HOVER_TYPE_HOVER); |
| 38 rvh->OnWebkitPreferencesChanged(); | 38 rvh->OnWebkitPreferencesChanged(); |
| 39 EXPECT_EQ(kSuccessTitle, title_watcher.WaitAndGetTitle()); | 39 EXPECT_EQ(kSuccessTitle, title_watcher.WaitAndGetTitle()); |
| 40 } | 40 } |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 } // namespace content | 43 } // namespace content |
| OLD | NEW |