Bug 1037335 - Fix timing issue of web-platform test: content-security-policy/style-src/style-src-imported-style-blocked.html. r=ckerschb

MozReview-Commit-ID: DdS55NP22nh

--HG--
extra : rebase_source : 4134ad056703ec8363f4f7a04ad02ae4fb1b0c2e
This commit is contained in:
Chung-Sheng Fu 2017-11-29 16:55:00 +02:00
parent 03fb144c3b
commit 0eba47ddc8
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,5 @@
[style-src-imported-style-blocked.html]
type: testharness
expected: TIMEOUT
[Should fire a securitypolicyviolation event]
expected: NOTRUN
expected: FAIL

View File

@ -12,8 +12,13 @@
document.addEventListener("securitypolicyviolation", t_spv.step_func_done(function(e) {
assert_equals("style-src", e.violatedDirective);
}));
var l = document.createElement("link");
l.setAttribute("href", "/content-security-policy/style-src/resources/style-src-import.sub.css");
l.setAttribute("rel", "stylesheet");
l.setAttribute("type", "text/css");
document.head.appendChild(l);
</script>
<link href="/content-security-policy/style-src/resources/style-src-import.sub.css" rel=stylesheet type=text/css>
</head>
<body>
<div id='log'></div>