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

Unified Diff: sky/tests/styles/inline-style-crash.sky

Issue 956753002: Make splash animations abort on scroll. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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: sky/tests/styles/inline-style-crash.sky
diff --git a/sky/tests/styles/inline-style-crash.sky b/sky/tests/styles/inline-style-crash.sky
new file mode 100644
index 0000000000000000000000000000000000000000..9a017c79b95286bedfa2845dc7beb851e72fe8a6
--- /dev/null
+++ b/sky/tests/styles/inline-style-crash.sky
@@ -0,0 +1,28 @@
+<html>
+<foo />
+<script>
+import "../resources/third_party/unittest/unittest.dart";
+import "../resources/unit.dart";
+
+import "dart:sky";
+
+void main() {
+ initUnit();
+
+ test('should not crash when setting style to null', () {
+ var foo = document.querySelector('foo');
+ expect(foo.style['color'], isNull);
+ foo.style["color"] = null; // This used to crash.
+ expect(foo.style['color'], isNull);
+ foo.style["color"] = "blue";
+ expect(foo.style['color'], equals("rgb(0, 0, 255)"));
+ foo.style["color"] = null;
+ expect(foo.style['color'], isNull);
+ foo.style["color"] = "blue";
+ expect(foo.style['color'], equals("rgb(0, 0, 255)"));
+ foo.style.removeProperty("color");
+ expect(foo.style['color'], isNull);
+ });
+}
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698