Bug 1267890 part 2 - Add test for -moz-bool-pref(). r=emilio

MozReview-Commit-ID: AFTVgwbi9M

--HG--
extra : source : 8344dd1d7234e4950dd62aaed737dea8197c3406
This commit is contained in:
Xidorn Quan 2017-12-08 20:03:34 -06:00
Родитель 60d327216d
Коммит 85f0c3af39
10 изменённых файлов: 48 добавлений и 32 удалений

Просмотреть файл

@ -0,0 +1,2 @@
<!DOCTYPE html>
<div style="width: 100px; height: 100px; background: green"></div>

Просмотреть файл

@ -0,0 +1,22 @@
#test {
width: 100px;
height: 100px;
}
.enabled {
background: red;
}
.disabled {
background: green;
}
@supports -moz-bool-pref("testing.supports.moz-bool-pref") {
.enabled {
background: green;
}
.disabled {
background: red;
}
}

Просмотреть файл

@ -6,4 +6,7 @@
== at-rule-error-handling-media-1.html at-rule-error-handling-ref.html
== invalid-font-face-descriptor-1.html invalid-font-face-descriptor-1-ref.html
== two-dash-identifiers.html two-dash-identifiers-ref.html
== supports-moz-bool-pref.html supports-moz-bool-pref-ref.html
test-pref(testing.supports.moz-bool-pref,true) == supports-moz-bool-pref-1.html green-ref.html
test-pref(testing.supports.moz-bool-pref,false) == supports-moz-bool-pref-2.html green-ref.html
test-pref(testing.supports.moz-bool-pref,true) == supports-moz-bool-pref-3.html green-ref.html

Просмотреть файл

@ -0,0 +1,7 @@
<!DOCTYPE html>
<!-- The query part here is necessary because chrome stylesheets are
cached after first parse, so the -moz-bool-pref() wouldn't be
re-evaluated if we use the same url as the other test. -->
<link rel="stylesheet" href="chrome://reftest/content/moz-bool-pref.css?1">
<!-- testing.supports.moz-bool-pref = true -->
<div id="test" class="enabled"></div>

Просмотреть файл

@ -0,0 +1,7 @@
<!DOCTYPE html>
<!-- The query part here is necessary because chrome stylesheets are
cached after first parse, so the -moz-bool-pref() wouldn't be
re-evaluated if we use the same url as the other test. -->
<link rel="stylesheet" href="chrome://reftest/content/moz-bool-pref.css?2">
<!-- testing.supports.moz-bool-pref = false -->
<div id="test" class="disabled"></div>

Просмотреть файл

@ -0,0 +1,4 @@
<!DOCTYPE html>
<link rel="stylesheet" href="moz-bool-pref.css">
<!-- not valid outside chrome / ua stylesheets -->
<div id="test" class="disabled"></div>

Просмотреть файл

@ -1,10 +0,0 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<body>
<p>This text should not have background color.</p>
</body>
</html>

Просмотреть файл

@ -1,20 +0,0 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<style>
/* This is not a user agent style sheet, so the style will be ignored.
"testing.supports.moz-bool-pref" is set to true in
layout/tools/reftest/reftest-preferences.js. */
@supports -moz-bool-pref("testing.supports.moz-bool-pref") {
p {
background-color: red;
}
}
</style>
<body>
<p>This text should not have background color.</p>
</body>
</html>

Просмотреть файл

@ -6,6 +6,7 @@ reftest.jar:
content/httpd.jsm (../../../netwerk/test/httpserver/httpd.js)
content/StructuredLog.jsm (../../../testing/modules/StructuredLog.jsm)
content/input.css (../../../editor/reftests/xul/input.css)
content/moz-bool-pref.css (../../../layout/reftests/css-parsing/moz-bool-pref.css)
content/progress.css (../../../layout/reftests/forms/progress/style.css)
* content/manifest.jsm (manifest.jsm)
* content/reftest.jsm (reftest.jsm)

Просмотреть файл

@ -130,7 +130,7 @@ user_pref("media.gmp-manager.url.override", "http://localhost/dummy-gmp-manager.
user_pref("media.gmp-manager.updateEnabled", false);
// A fake bool pref for "@supports -moz-bool-pref" sanify test.
user_pref("testing.supports.moz-bool-pref", true);
user_pref("testing.supports.moz-bool-pref", false);
// Reftests load a lot of URLs very quickly. This puts avoidable and
// unnecessary I/O pressure on the Places DB (measured to be in the