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

Unified Diff: LayoutTests/fast/events/constructors/midi-connection-event-constructor.html

Issue 14358032: Web MIDI: implement MIDIConnectionEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: layout test Created 7 years, 8 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: LayoutTests/fast/events/constructors/midi-connection-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/midi-connection-event-constructor.html b/LayoutTests/fast/events/constructors/midi-connection-event-constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..4b8a8157814a8f54e69683a2a3e771a94b9738ad
--- /dev/null
+++ b/LayoutTests/fast/events/constructors/midi-connection-event-constructor.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("This tests the constructor for the MIDIConnectionEvent DOM class.");
+
+// No initializer is passed.
+shouldBe("new MIDIConnectionEvent('eventType').bubbles", "false");
+shouldBe("new MIDIConnectionEvent('eventType').cancelable", "false");
+shouldBe("new MIDIConnectionEvent('eventType').port", "null");
+
+// bubbles is passed.
+shouldBe("new MIDIConnectionEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new MIDIConnectionEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new MIDIConnectionEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new MIDIConnectionEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// FIXME: Add a test case to pass port once MIDIPort is available.
haraken 2013/04/25 06:33:00 Why can't you add the test in this patch?
Takashi Toyoshima 2013/04/25 07:20:27 Currently MIDIPort is implemented, but no way is e
haraken 2013/04/25 07:36:47 Why isn't it exposed? You've written Dictionary::g
Takashi Toyoshima 2013/04/25 07:47:51 As line 14 is, it's always null for now :( MIDIPor
+
+// All initializers are passed.
+shouldBe("new MIDIConnectionEvent('eventType', { bubbles: true, cancelable: true }).bubbles", "true");
+shouldBe("new MIDIConnectionEvent('eventType', { bubbles: true, cancelable: true }).cancelable", "true");
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698