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

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..5f2444d700f3a69f30e44506cf4242f6db07f038
--- /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.
+shouldBeFalse("new MediaQueryListEvent('eventType').bubbles");
+shouldBeFalse("new MediaQueryListEvent('eventType').cancelable");
+shouldBeEmptyString("new MediaQueryListEvent('eventType').media");
+shouldBeFalse("new MediaQueryListEvent('eventType').matches");
+
+// Bubbles and cancelable true, media and matches are missing.
+shouldBeTrue("new MediaQueryListEvent('eventType', { bubbles: true, cancelable: true }).bubbles");
+shouldBeTrue("new MediaQueryListEvent('eventType', { bubbles: true, cancelable: true }).cancelable");
+shouldBeEmptyString("new MediaQueryListEvent('eventType').media");
+shouldBeFalse("new MediaQueryListEvent('eventType').matches");
+
+// media is passed.
+shouldBeEqualToString("new MediaQueryListEvent('eventType', { media: 'string' }).media", "string");
+
+// matches is passed.
+shouldBeTrue("new MediaQueryListEvent('eventType', { matches: true }).matches");
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698