Commit e356ad17 authored by David McAllister's avatar David McAllister Committed by Commit Bot

Set Pointer/Hover types to None before PointerMediaQueriesDynamic test

On devices which already match the media requirements, the test fails as
handleMediaChange is never called. Instead, set the pointer and hover types to
None so that updating the types later is guaranteed to trigger the matchMedia
handler.

Bug: None
Change-Id: I8fa91ecef9c1f372d1b04abfbc540a7b9c0fc3c2
Reviewed-on: https://chromium-review.googlesource.com/951860Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541212}
parent fe367a2f
......@@ -31,11 +31,16 @@ class InteractionMediaQueriesDynamicTest : public ContentBrowserTest {
(defined(OS_ANDROID) && !defined(ADDRESS_SANITIZER))
IN_PROC_BROWSER_TEST_F(InteractionMediaQueriesDynamicTest,
PointerMediaQueriesDynamic) {
RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost();
ui::SetAvailablePointerAndHoverTypesForTesting(ui::POINTER_TYPE_NONE,
ui::HOVER_TYPE_NONE);
rvh->OnWebkitPreferencesChanged();
GURL test_url = GetTestUrl("", "interaction-mq-dynamic.html");
const base::string16 kSuccessTitle(base::ASCIIToUTF16("SUCCESS"));
TitleWatcher title_watcher(shell()->web_contents(), kSuccessTitle);
NavigateToURL(shell(), test_url);
RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost();
ui::SetAvailablePointerAndHoverTypesForTesting(ui::POINTER_TYPE_COARSE,
ui::HOVER_TYPE_HOVER);
rvh->OnWebkitPreferencesChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment