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

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

Issue 1049513003: Add error dispatch events to SVGStyleElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Nits Created 5 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
index 893518e4f8358a5dac609aeb04b12f8415001309..21575e9c1c5385f20253afd4a271677c9a218536 100644
--- a/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
@@ -15,5 +15,51 @@
<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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698