-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dpwas: Add display_override tentative tests
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
1 parent
5b0e164
commit a7dbaf5
Showing
15 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...splay-override-member/display-override-member-media-feature-browser-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
3 changes: 3 additions & 0 deletions
3
...anifest/display-override-member/display-override-member-media-feature-browser.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"display_override": [ "browser" ] | ||
} |
1 change: 1 addition & 0 deletions
1
...display-override-member/display-override-member-media-feature-browser.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
34 changes: 34 additions & 0 deletions
34
...ay-override-member/display-override-member-media-feature-fullscreen-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
3 changes: 3 additions & 0 deletions
3
...fest/display-override-member/display-override-member-media-feature-fullscreen.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"display_override": [ "fullscreen" ] | ||
} |
1 change: 1 addition & 0 deletions
1
...play-override-member/display-override-member-media-feature-fullscreen.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
34 changes: 34 additions & 0 deletions
34
...ay-override-member/display-override-member-media-feature-minimal-ui-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
3 changes: 3 additions & 0 deletions
3
...fest/display-override-member/display-override-member-media-feature-minimal-ui.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"display_override": [ "minimal-ui" ] | ||
} |
1 change: 1 addition & 0 deletions
1
...play-override-member/display-override-member-media-feature-minimal-ui.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
34 changes: 34 additions & 0 deletions
34
...ay-override-member/display-override-member-media-feature-standalone-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
36 changes: 36 additions & 0 deletions
36
.../display-override-member-media-feature-standalone-overrides-browser-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
4 changes: 4 additions & 0 deletions
4
...ide-member/display-override-member-media-feature-standalone-overrides-browser.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"display": "browser", | ||
"display_override": [ "standalone" ] | ||
} |
1 change: 1 addition & 0 deletions
1
...er/display-override-member-media-feature-standalone-overrides-browser.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
3 changes: 3 additions & 0 deletions
3
...fest/display-override-member/display-override-member-media-feature-standalone.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"display_override": [ "standalone" ] | ||
} |
1 change: 1 addition & 0 deletions
1
...play-override-member/display-override-member-media-feature-standalone.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |