Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: LayoutTests/fast/media/mq-display-mode-fullscreen.html

Issue 1066213003: Add a media query "display-mode" features layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/media/mq-display-mode-fullscreen-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/media/mq-display-mode-fullscreen.html
diff --git a/LayoutTests/fast/media/mq-display-mode-fullscreen.html b/LayoutTests/fast/media/mq-display-mode-fullscreen.html
new file mode 100644
index 0000000000000000000000000000000000000000..59c294791d3c39779879c9b81beb23ea4e1b940e
--- /dev/null
+++ b/LayoutTests/fast/media/mq-display-mode-fullscreen.html
@@ -0,0 +1,56 @@
+<html>
+<head>
+<title>Test the media query "display-mode" features.</title>
+<script src="../../fullscreen/trusted-event.js"></script>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function log(m) {
+ document.getElementById('results').innerHTML += m + '<br>';
+ }
+
+ function testQueries() {
+ var queries = [
+ "(display-mode)",
+ "(display-mode: browser)",
+ "(display-mode: minimal-ui)",
+ "(display-mode: standalone)",
+ "(display-mode: fullscreen)",
+ ];
+ for (var index=0; index < queries.length; index++) {
+ log("Query &quot;" + queries[index] + "&quot: " +
+ window.matchMedia(queries[index]).matches);
+ }
+ }
+
+ function runTests() {
+ var div = document.querySelector("div");
+ document.onwebkitfullscreenchange = function() {
+ log("------------- entered fullscreen -------------");
+ testQueries();
+
+ document.onwebkitfullscreenchange = function() {
+ log("------------- left fullscreen -------------");
+ testQueries();
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+ document.exitFullscreen();
+ }
+ trusted_event(function() {
+ log("------------- before entering fullscreen -------------");
+ testQueries();
+ div.webkitRequestFullscreen();
+ }, document.body);
+ }
+</script>
+</head>
+<body onload="runTests()">
+ <p>Test the <a href="http://w3c.github.io/manifest/#the-display-mode-media-feature">(display-mode: ...)</a>
+ media features while the browser window entering/leaving fullscreen mode.</p>
+ <div id="results"></div>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/media/mq-display-mode-fullscreen-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698