Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / media / mq-display-mode.html
blobb64d6af46a4908d78b9528da2f82940a8f87c2e7
1 <html>
2 <head>
3 <title>Test the Manifest media query "display-mode" features.</title>
4 <style type="text/css">
6 </style>
7 <script type="text/javascript" charset="utf-8">
8 if (window.testRunner)
9 testRunner.dumpAsText();
11 function log(m) {
12 document.getElementById('results').innerHTML += m + '<br>';
15 function testQueries()
17 var queries = [
18 "(display-mode)",
19 "(display-mode: browser)",
20 "(display-mode: minimal-ui)",
21 "(display-mode: standalone)",
22 "(display-mode: fullscreen)",
24 for (var index=0; index < queries.length; index++) {
25 log("Query &quot;" + queries[index] + "&quot: " +
26 window.matchMedia(queries[index]).matches);
30 function runTests()
32 if (!window.internals)
33 return;
35 log("------------- with 'browser' display mode -------------");
36 internals.settings.setDisplayModeOverride('browser');
37 testQueries();
39 log("------------- with 'minimal-ui' display mode -------------");
40 internals.settings.setDisplayModeOverride('minimal-ui');
41 testQueries();
43 log("------------- with 'standalone' display mode -------------");
44 internals.settings.setDisplayModeOverride('standalone');
45 testQueries();
47 log("------------- with 'fullscreen' display mode -------------");
48 internals.settings.setDisplayModeOverride('fullscreen');
49 testQueries();
52 </script>
53 </head>
54 <body onload="runTests()">
55 <p>Test the <a href="http://w3c.github.io/manifest/#the-display-mode-media-feature">(display-mode: ...)</a> media features.
57 <div id="results">
58 </div>
59 </body>
60 </html>