chromium/third_party/blink/web_tests/fast/media/mq-hover.html

<html>
<head>
<title>Test the CSS4 media query "hover" features.</title>
<script type="text/javascript" src="resources/media-utils.js"></script>
<script type="text/javascript" charset="utf-8">
  if (window.testRunner) testRunner.dumpAsText();

  function testQueries() {
    [
      "(hover)",
      "(Hover)",
      "(hover:none)",
      "(hover:NoNe)",
      "(hover:on-demand)",
      "(hover:bogusvalue)",
      "(hover:hover)",
      "(hover:HoveR)",
      "(any-hover)",
      "(any-Hover)",
      "(any-hover:none)",
      "(any-hover:NoNe)",
      "(any-hover:on-demand)",
      "(any-hover:bogusvalue)",
      "(any-hover:hover)",
      "(any-hover:HoveR)",
    ].forEach(query => logMatchMediaQuery(query));
  }

  function runTestCase(hoverType, availableHoverTypes) {
    log(`------------- with '${availableHoverTypes.replaceAll(",", "' and '")}' hover, '${hoverType}' is primary -------------`);
    internals.settings.setPrimaryHoverType(hoverType);
    internals.settings.setAvailableHoverTypes(availableHoverTypes);
    testQueries();
  }

  function runTests() {
    if (!window.internals) return;

    runTestCase("hover", "hover");
    runTestCase("none", "none,hover");
    runTestCase("none", "none");
  }
</script>
</head>
<body onload="runTests()">
  <p>Test the <a href="http://www.w3.org/TR/2014/WD-mediaqueries-4-20140605/#hover">(hover)</a> media features.
  See <a href="http://crbug.com/136119">Bug 136119</a> for details.</p>
<div id="results"></div>
</body>
</html>