Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html

Issue 2784543003: Fixed wpt content-security-policy/style-src tests (Closed)
Patch Set: CR changes Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
deleted file mode 100644
index 21575e9c1c5385f20253afd4a271677c9a218536..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Style element has error on bad style hash</title>
- <meta http-equiv="Content-Security-Policy" content="style-src 'sha1-pfeR5wMA6np45oqDTP6Pj3tLpJo='">
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- <script>
- function styleError() {
- var color = window.getComputedStyle(document.querySelector('p')).color;
- assert_equals(color, "rgb(0, 128, 0)", "The color of the paragraph is still green.");
- done();
- }
- </script>
- <style>p { color: green; }</style>
- <style onerror="styleError();">p { color: red; }</style>
-</head>
- <script>
- function verifyStep1() {
- var color = window.getComputedStyle(document.querySelector('p')).color;
- assert_equals(color, "rgb(0, 128, 0)", "The color of the paragraph is still green after initial style.");
- }
-
- function setupStep2() {
- var sty = document.createElement("style");
- sty.innerHTML = "p { color: red; }";
- sty.onerror = styleError;
- document.body.appendChild(sty);
- }
- function verifyStep2() {
- var color = window.getComputedStyle(document.querySelector('p')).color;
- assert_equals(color, "rgb(0, 128, 0)", "The color of the paragraph is still green after inserted style.");
- }
-
- function setupStep3() {
- var e = document.getElementById('style1');
- e.innerHTML = "p { color: blue; }";
- }
- function verifyStep3() {
- var color = window.getComputedStyle(document.querySelector('p')).color;
- assert_equals(color, "rgb(0, 128, 0)", "The color of the paragraph is still green after changing style.");
- test.done();
- }
-
- var verifySteps = [ verifyStep1, verifyStep2, verifyStep3 ];
- var setupSteps = [ setupStep2, setupStep3 ];
-
- var test = async_test("Test that paragraph remains green and error events received.");
-
- function styleError() {
- test.step(function() {
- verifySteps.shift()();
- var nextSetup = setupSteps.shift();
- if (nextSetup)
- nextSetup();
- });
- }
- </script>
-</head>
-<body>
- <style>p { color: green; }</style>
- <style id="style1" onerror="styleError();">p { color: red; }</style>
- <p>A test paragraph</p>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698