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

<html>
<head>
<title>Test the CSS4 media query "pointer" 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() {
    [
      "(pointer)",
      "(Pointer)",
      "(pointer:none)",
      "(pointer:NoNe)",
      "(pointer:coarse)",
      "(pointer:coARse)",
      "(pointer:bogusvalue)",
      "(pointer:fine)",
      "(pointer:fInE)",
      "(any-pointer)",
      "(any-Pointer)",
      "(any-pointer:none)",
      "(any-pointer:NoNe)",
      "(any-pointer:coarse)",
      "(any-pointer:coARse)",
      "(any-pointer:bogusvalue)",
      "(any-pointer:fine)",
      "(any-pointer:fInE)",
    ].forEach(query => logMatchMediaQuery(query));
  }

  function runTestCase(pointerType, availablePointerTypes) {
  log(`------------- with '${availablePointerTypes.replaceAll(",", "' and '")}' pointer, '${pointerType}' is primary -------------`);
    internals.settings.setPrimaryPointerType(pointerType);
    internals.settings.setAvailablePointerTypes(availablePointerTypes);
    testQueries();
  }

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

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