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

Unified Diff: LayoutTests/fast/events/constructors/media-query-list-event-constructor.html

Issue 799733002: Use event init dictionaries in core/{css,html} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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: LayoutTests/fast/events/constructors/media-query-list-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/media-query-list-event-constructor.html b/LayoutTests/fast/events/constructors/media-query-list-event-constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..c42ae784f19cc24f54b94da026b1e84fa89b3df4
--- /dev/null
+++ b/LayoutTests/fast/events/constructors/media-query-list-event-constructor.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+
+description("This tests the constructor for the MediaQueryListEvent DOM class.");
+
+// No initializer passed.
+shouldBe("new MediaQueryListEvent('eventType').bubbles", "false");
haraken 2014/12/12 05:12:07 Nit: You can use shouldBeFalse and shouldBeTrue.
bashi 2014/12/12 08:58:43 Done.
+shouldBe("new MediaQueryListEvent('eventType').cancelable", "false");
+shouldBeEmptyString("new MediaQueryListEvent('eventType').media");
+shouldBe("new MediaQueryListEvent('eventType').matches", "false");
+
+// Bubbles and cancelable true, media and matches are missing.
+shouldBe("new MediaQueryListEvent('eventType', { bubbles: true, cancelable: true }).bubbles", "true");
+shouldBe("new MediaQueryListEvent('eventType', { bubbles: true, cancelable: true }).cancelable", "true");
+shouldBeEmptyString("new MediaQueryListEvent('eventType').media");
+shouldBe("new MediaQueryListEvent('eventType').matches", "false");
+
+// media is passed.
+shouldBeEqualToString("new MediaQueryListEvent('eventType', { media: 'string' }).media", "string");
+
+// matches is passed.
+shouldBe("new MediaQueryListEvent('eventType', { matches: true }).matches", "true");
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698