mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 16:57:36 +00:00
Bug 1369815 - Add mochitest for additional display modes r=heycam
MozReview-Commit-ID: 3ADmC1op4Sj
This commit is contained in:
parent
b3df8d8daa
commit
2b6d28deca
@ -47,6 +47,12 @@ add_task(async function() {
|
||||
ok(!queryApplies(q), q + " should not apply");
|
||||
}
|
||||
|
||||
function setDisplayMode(mode) {
|
||||
win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDocShell)
|
||||
.displayMode = mode;
|
||||
}
|
||||
|
||||
shouldApply("all and (display-mode: browser)");
|
||||
shouldNotApply("all and (display-mode: fullscreen)");
|
||||
shouldNotApply("all and (display-mode: standalone)");
|
||||
@ -77,6 +83,18 @@ add_task(async function() {
|
||||
ok(!document.mozFullScreenElement, "window exited fullscreen");
|
||||
shouldNotApply("all and (display-mode: fullscreen)");
|
||||
shouldApply("all and (display-mode: browser)");
|
||||
|
||||
// Test entering display mode mode through docshell
|
||||
setDisplayMode(Components.interfaces.nsIDocShell.DISPLAY_MODE_STANDALONE);
|
||||
shouldApply("all and (display-mode: standalone)");
|
||||
shouldNotApply("all and (display-mode: fullscreen)");
|
||||
shouldNotApply("all and (display-mode: browser)");
|
||||
shouldNotApply("all and (display-mode: minimal-ui)");
|
||||
|
||||
// Test that changes in the display mode are reflected
|
||||
setDisplayMode(Components.interfaces.nsIDocShell.DISPLAY_MODE_MINIMAL_UI);
|
||||
shouldApply("all and (display-mode: minimal-ui)");
|
||||
shouldNotApply("all and (display-mode: standalone)");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
Loading…
x
Reference in New Issue
Block a user