Skip to content

Commit

Permalink
dpwas: Add display_override tentative tests
Browse files Browse the repository at this point in the history
Adding manual WPT tests for new display-override field.
PR to add new field to manifest spec is here: w3c/manifest#932

Bug: 1149993
Change-Id: I670c69737e337a4c13e35672daa93e703f97b84e
  • Loading branch information
mwjacksonmsft authored and chromium-wpt-export-bot committed Sep 16, 2021
1 parent 5b0e164 commit a7dbaf5
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<title>Test "browser" in display-override member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-browser" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="display-override-member-media-feature-browser.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Test "browser" in display-override member + media feature</h1>
<style>
.fail {
background-color: red;
}

@media all and (display-mode: browser) {
body {
background-color: green;
}
}
</style>
<script>
const browser = matchMedia("(display-mode: browser)");

browser.onchange = () => {
if (browser.matches) {
document.body.classList.remove("fail");
}
}

if (!browser.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_override": [ "browser" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<title>Test "fullscreen" in display-override member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-fullscreen" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="display-override-member-media-feature-fullscreen.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Test "fullscreen" in display-override member + media feature</h1>
<style>
.fail {
background-color: red;
}

@media all and (display-mode: fullscreen) {
body {
background-color: green;
}
}
</style>
<script>
const fullscreen = matchMedia("(display-mode: fullscreen)");

fullscreen.onchange = () => {
if (fullscreen.matches) {
document.body.classList.remove("fail");
}
}

if (!fullscreen.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_override": [ "fullscreen" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<title>Test "minimal-ui" in display-override member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-minimal-ui" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="display-override-member-media-feature-minimal-ui.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Test "minimal-ui" in display-override member + media feature</h1>
<style>
.fail {
background-color: red;
}

@media all and (display-mode: minimal-ui) {
body {
background-color: green;
}
}
</style>
<script>
const minimalUi = matchMedia("(display-mode: minimal-ui)");

minimalUi.onchange = () => {
if (minimalUi.matches) {
document.body.classList.remove("fail");
}
}

if (!minimalUi.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_override": [ "minimal-ui" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<title>Test "standalone" in display-override member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-standalone" />
<link rel="manifest" href="display-override-member-media-feature-standalone.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Test "standalone" in display-override member + media feature</h1>
<style>
.fail {
background-color: red;
}

@media all and (display-mode: standalone) {
body {
background-color: green;
}
}
</style>
<script>
const standalone = matchMedia("(display-mode: standalone)");

standalone.onchange = () => {
if (standalone.matches) {
document.body.classList.remove("fail");
}
}

if (!standalone.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<title>Test "standalone" in display-override member + "browser" in display member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest#display-member" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-browser" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-standalone" />
<link rel="manifest" href="display-override-member-media-feature-standalone-overrides-browser.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Test "standalone" in display-override member + "browser" in display member + media feature</h1>
<style>
.fail {
background-color: red;
}

@media all and (display-mode: standalone) {
body {
background-color: green;
}
}
</style>
<script>
const standalone = matchMedia("(display-mode: standalone)");

standalone.onchange = () => {
if (standalone.matches) {
document.body.classList.remove("fail");
}
}

if (!standalone.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"display": "browser",
"display_override": [ "standalone" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_override": [ "standalone" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8

0 comments on commit a7dbaf5

Please sign in to comment.