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

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

Issue 85263002: Improve handling of dictionary conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have conversion methods take a context argument; elaborate error msgs further. Created 7 years, 1 month 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-key-event-constructor.html
diff --git a/LayoutTests/fast/events/constructors/media-key-event-constructor.html b/LayoutTests/fast/events/constructors/media-key-event-constructor.html
index fda2c167ec2260194982dee3532c107b305ac520..c5686bc6c8000c2af1981401f0d900a9f66ab7b6 100644
--- a/LayoutTests/fast/events/constructors/media-key-event-constructor.html
+++ b/LayoutTests/fast/events/constructors/media-key-event-constructor.html
@@ -36,15 +36,15 @@
shouldBeZero("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true }).systemCode");
debug("<br>*** Bubbles and cancelable true, invalid other members ***");
- shouldBe("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).bubbles", "true");
- shouldBe("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).cancelable", "true");
- shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).keySystem", "undefined");
- shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).sessionId", "undefined");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).initData");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).message");
- shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).defaultURL", "undefined");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).errorCode");
- shouldBeZero("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).systemCode");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).bubbles");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).cancelable");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).keySystem");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).sessionId");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).initData");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).message");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).defaultURL");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).errorCode");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: undefined, sessionId: undefined, initData: Uint8Array, message: Uint8Array, defaultURL: undefined, errorCode: MediaKeyError, systemCode: undefined }).systemCode");
debug("<br>*** Initialize 'keySystem' with a invalid values ***");
emptyObject = { };
@@ -57,18 +57,18 @@
shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { sessionId: document }).sessionId", "[object HTMLDocument]");
debug("<br>*** Initialize 'initData' with a invalid values ***");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { initData: 10 }).initData");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { initData: \'string\' }).initData");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { initData: 10 }).initData");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { initData: \'string\' }).initData");
emptyObject = { };
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { initData: emptyObject }).initData");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { initData: document }).initData");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { initData: emptyObject }).initData");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { initData: document }).initData");
debug("<br>*** Initialize 'message' with a invalid values ***");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { message: 10 }).message");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { message: \'string\' }).message");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { message: 10 }).message");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { message: \'string\' }).message");
emptyObject = { };
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { message: emptyObject }).message");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { message: document }).message");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { message: emptyObject }).message");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { message: document }).message");
debug("<br>*** Initialize 'defaultURL' with a invalid values ***");
emptyObject = { };
@@ -76,11 +76,11 @@
shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { defaultURL: document }).defaultURL", "[object HTMLDocument]");
debug("<br>*** Initialize 'errorCode' with a invalid values ***");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { errorCode: 10 }).errorCode");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { errorCode: \'string\' }).errorCode");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { errorCode: 10 }).errorCode");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { errorCode: \'string\' }).errorCode");
emptyObject = { };
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { errorCode: emptyObject }).errorCode");
- shouldBeNull("new MediaKeyEvent('MediaKeyEvent', { errorCode: document }).errorCode");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { errorCode: emptyObject }).errorCode");
+ shouldThrow("new MediaKeyEvent('MediaKeyEvent', { errorCode: document }).errorCode");
debug("<br>*** Initialize 'systemCode' with a invalid values ***");
shouldBeZero("new MediaKeyEvent('MediaKeyEvent', { systemCode: \'string\' }).systemCode");
@@ -97,7 +97,7 @@
shouldBe("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).message", "messageArray");
shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).defaultURL", "defaultURL");
// FIXME(82988): These two fail.
- shouldBe("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).errorCode", "errorObject");
+ shouldBeNonNull("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).errorCode");
shouldBe("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).errorCode.code", "MediaKeyError.MEDIA_KEYERR_UNKNOWN");
shouldBe("new MediaKeyEvent('MediaKeyEvent', { bubbles: true, cancelable: true, keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).systemCode", "123");
@@ -110,7 +110,7 @@
shouldBe("new MediaKeyEvent('MediaKeyEvent', { keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).message", "messageArray");
shouldBeEqualToString("new MediaKeyEvent('MediaKeyEvent', { keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).defaultURL", "defaultURL");
// FIXME(82988): These two fail.
- shouldBe("new MediaKeyEvent('MediaKeyEvent', { keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).errorCode", "errorObject");
+ shouldBeNonNull("new MediaKeyEvent('MediaKeyEvent', { keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).errorCode");
shouldBe("new MediaKeyEvent('MediaKeyEvent', { keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).errorCode.code", "MediaKeyError.MEDIA_KEYERR_UNKNOWN");
shouldBe("new MediaKeyEvent('MediaKeyEvent', { keySystem: 'keySystem', sessionId: 'sessionId', initData: initDataArray, message: messageArray, defaultURL: 'defaultURL', errorCode: errorObject, systemCode: 123 }).systemCode", "123");
@@ -121,7 +121,8 @@
var initDataArray = new Uint8Array([0x41, 0x42, 0x43]);
var messageArray = new Uint8Array([0x51, 0x52, 0x53]);
// FIXME(82988): This does not create an error like we want.
- var errorObject = window.MediaKeyError;
+ //var errorObject = window.MediaKeyError;
+ var errorObject = null;
// shouldBe("typeof errorObject", TBD);
video = document.createElement('video');

Powered by Google App Engine
This is Rietveld 408576698