Bug 1345709 - Add mechanism in SimpleTest to detect stylo and update test expectation.
MozReview-Commit-ID: 3ynqbjS0zGv
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -111,17 +111,17 @@ to mochitest command.
* Quirks mode support
* test_hover_quirk.html: hover quirks bug 1355724 [6]
* Unit should be preserved after parsing servo/servo#15346
* test_units_time.html [1]
* getComputedStyle style doesn't contain custom properties bug 1336891
* test_variable_serialization_computed.html [35]
* test_variables.html `custom property name` [2]
* test_css_supports.html: issues around @supports syntax servo/servo#15482 [8]
-* test_author_specified_style.html: support serializing color as author specified bug 1348165 [27]
+* test_author_specified_style.html: support serializing color as author specified bug 1348165 [45]
* browser_newtab_share_rule_processors.js: agent style sheet sharing [1]
* :visited support (bug 1328509)
* test_visited_reftests.html `selector-descendant-2.xhtml` [2]
* ... `selector-child-2.xhtml` [2]
* ... `color-on-bullets-1.html` [2]
* ... `inherit-keyword-1.xhtml` [2]
* ... `mathml-links.html` [2]
* ... `caret-color-on-visited-1.html` [2]
--- a/layout/style/test/test_bug372770.html
+++ b/layout/style/test/test_bug372770.html
@@ -49,17 +49,17 @@ for (var i = 0; i <= 100; ++i) {
}
var color1 = "rgba(128, 128, 128, " + i/100 + ")";
var color2 = "rgba(175, 63, 27, " + i/100 + ")";
style1.color = color1;
style1.backgroundColor = color2;
style2.color = color2;
style2.background = color1;
- if (i == 100) {
+ if (i == 100 && !SimpleTest.isStyledByServo()) {
// Bug 372783 means this doesn't round-trip quite right
todo(style1.color == color1,
"Inline style color roundtripping failed at opacity " + i);
todo(style1.backgroundColor == color2,
"Inline style background roundtripping failed at opacity " + i);
todo(style2.color == color2,
"Rule style color roundtripping failed at opacity " + i);
todo(style2.backgroundColor == color1,
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -1702,13 +1702,17 @@ function getAndroidSdk() {
.getService(SpecialPowers.Ci.nsIPropertyBag2)
.getProperty(versionString);
}
document.documentElement.removeChild(iframe);
}
return gAndroidSdk;
}
+SimpleTest.isStyledByServo = function () {
+ return SpecialPowers.getBoolPref("layout.css.servo.enabled", false);
+};
+
// Request complete log when using failure patterns so that failure info
// from infra can be useful.
if (usesFailurePatterns()) {
SimpleTest.requestCompleteLog();
}