Skip to content

Commit

Permalink
Add reftests for fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Feb 5, 2019
1 parent 871fe93 commit d286209
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 2 deletions.
16 changes: 14 additions & 2 deletions components/script/dom/document.rs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3164,8 +3164,20 @@ impl Document {
if !pending.fullscreen_element_ready_check() { if !pending.fullscreen_element_ready_check() {
error = true; error = true;
} }
// TODO fullscreen is supported
// TODO This algorithm is allowed to request fullscreen. if PREFS
.get("dom.fullscreen.test")
.as_boolean()
.unwrap_or(false)
{
// For reftests we just take over the current window,
// and don't try to really enter fullscreen.
info!("Tests don't really enter fullscreen.");
} else {
// TODO fullscreen is supported
// TODO This algorithm is allowed to request fullscreen.
warn!("Fullscreen not supported yet");
}


// Step 5 Parallel start // Step 5 Parallel start


Expand Down
41 changes: 41 additions & 0 deletions tests/wpt/mozilla/meta/MANIFEST.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6965,6 +6965,30 @@
{} {}
] ]
], ],
"mozilla/fullscreen/reftests/fullscreen-baseline.html": [
[
"/_mozilla/mozilla/fullscreen/reftests/fullscreen-baseline.html",
[
[
"/_mozilla/mozilla/fullscreen/reftests/fullscreen-baseline-ref.html",
"=="
]
],
{}
]
],
"mozilla/fullscreen/reftests/fullscreen-hides-others.html": [
[
"/_mozilla/mozilla/fullscreen/reftests/fullscreen-hides-others.html",
[
[
"/_mozilla/mozilla/fullscreen/reftests/fullscreen-baseline-ref.html",
"=="
]
],
{}
]
],
"mozilla/iframe/resize_after_load.html": [ "mozilla/iframe/resize_after_load.html": [
[ [
"/_mozilla/mozilla/iframe/resize_after_load.html", "/_mozilla/mozilla/iframe/resize_after_load.html",
Expand Down Expand Up @@ -10335,6 +10359,11 @@
{} {}
] ]
], ],
"mozilla/fullscreen/reftests/fullscreen-baseline-ref.html": [
[
{}
]
],
"mozilla/globals/empty.html": [ "mozilla/globals/empty.html": [
[ [
{} {}
Expand Down Expand Up @@ -19345,6 +19374,18 @@
"1e3246f791df31532c32a816a14e4e3959582146", "1e3246f791df31532c32a816a14e4e3959582146",
"testharness" "testharness"
], ],
"mozilla/fullscreen/reftests/fullscreen-baseline-ref.html": [
"7272fa8b6e84979d5fad66bfe8c906d6e714cdb4",
"support"
],
"mozilla/fullscreen/reftests/fullscreen-baseline.html": [
"80503a9befe86e8cbd109eaf870f41c92a1952b2",
"reftest"
],
"mozilla/fullscreen/reftests/fullscreen-hides-others.html": [
"83a9abd907fc899dcfb60bab24691feb25878f7c",
"reftest"
],
"mozilla/getBoundingClientRect.html": [ "mozilla/getBoundingClientRect.html": [
"a8e92d836330126f6ccc4a13354368e223d260da", "a8e92d836330126f6ccc4a13354368e223d260da",
"testharness" "testharness"
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
prefs: ["dom.fullscreen.test:true"]
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
[fullscreen-hides-others.html]
type: reftest
expected: FAIL
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<head>
<meta charset=utf-8>
<title>Baseline fullscreen reference</title>
<style>
div {
position: fixed; top: 0; left: 0;
height: 100%; width: 100%;
background: green;
}
</style>
</head>
<body>
<div>0</div>
</body>
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<head>
<meta charset=utf-8>
<title>Baseline fullscreen</title>
<link rel=match href=fullscreen-baseline-ref.html>
<style>
div { background: red; }
#it { background: green; }
</style>
</head>
<body>
<div>-1</div>
<div id="it">0</div>
<div>1</div>
</body>
<script>
document.getElementById("it").requestFullscreen();
</script>
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<head>
<meta charset=utf-8>
<title>Elements which try to get in front of fullscreen</title>
<link rel=match href=fullscreen-baseline-ref.html>
<style>
div { background: red; }
#it { background: green; }

/* Fixed elements should not show up in front of fullscreen elements */
.fixed { position: fixed; top: 0; left: 0; background: blue; }

/* Elements with a large z-index (even the maximum u32)
should not show up in front of fullscreen elements */
.zindex { z-index: 4294967295; background: yellow; }
</style>
</head>
<body>
<div>-4</div>
<div class="fixed zindex">-3</div>
<div class="fixed">-2</div>
<div class="zindex">-1</div>
<div id="it">0</div>
<div>1</div>
<div class="fixed zindex">2</div>
<div class="fixed">3</div>
<div class="zindex">4</div>
</body>
<script>
document.getElementById("it").requestFullscreen();
</script>

0 comments on commit d286209

Please sign in to comment.