gecko-dev/layout/style/test/test_stylo_blocklist-02.html
Jeremy Chen 0288650258 Bug 1403077 - add tests for the stylo blocklist mechanism. r=heycam,leplatrem
In this patch, we add 3 tests:
1. test for blocked domain
2. test for blocked sub-domain
3. test for non-blocked domain

MozReview-Commit-ID: JzMImsbGoPr

--HG--
extra : rebase_source : 0eed42f6d2815bd8adbb9fb6be54b6feb3b1bcc8
2017-10-05 17:33:10 +08:00

25 lines
812 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Test the mechanism of stylo blocklist</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script>
SimpleTest.waitForExplicitFinish();
SpecialPowers.getDOMWindowUtils(window).addToStyloBlocklist("stylo-blocklist.com");
let win =
window.open("http://test.stylo-blocklist.com/tests/layout/style/test/stylo_blocked_domain_page.html", "");
window.onmessage = function (evt) {
is(evt.data, "TEST-PASS",
"Document with blocked sub-domain should not use servo backend");
win.close();
SpecialPowers.getDOMWindowUtils(window).removeFromStyloBlocklist("stylo-blocklist.com");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>