https://bugs.webkit.org/show_bug.cgi?id=189526
Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-09-12
Reviewed by Youenn Fablet.
* resources/import-expectations.json:
* web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt: Added.
* web-platform-tests/mediacapture-record/BlobEvent-constructor.html: Added.
* web-platform-tests/mediacapture-record/META.yml: Added.
* web-platform-tests/mediacapture-record/idlharness.window-expected.txt: Added.
* web-platform-tests/mediacapture-record/idlharness.window.html: Added.
* web-platform-tests/mediacapture-record/idlharness.window.js: Added.
(idl_array.catch):
* web-platform-tests/mediacapture-record/w3c-import.log: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235947
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-09-12 YUHAN WU <yuhan_wu@apple.com>
+
+ Import media recorder api WPT tests
+ https://bugs.webkit.org/show_bug.cgi?id=189526
+
+ Reviewed by Youenn Fablet.
+
+ * resources/import-expectations.json:
+ * web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt: Added.
+ * web-platform-tests/mediacapture-record/BlobEvent-constructor.html: Added.
+ * web-platform-tests/mediacapture-record/META.yml: Added.
+ * web-platform-tests/mediacapture-record/idlharness.window-expected.txt: Added.
+ * web-platform-tests/mediacapture-record/idlharness.window.html: Added.
+ * web-platform-tests/mediacapture-record/idlharness.window.js: Added.
+ (idl_array.catch):
+ * web-platform-tests/mediacapture-record/w3c-import.log: Added.
+
2018-09-12 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Implement rootMargin expansion
"web-platform-tests/media-capabilities": "skip",
"web-platform-tests/media-source": "import",
"web-platform-tests/mediacapture-image": "skip",
- "web-platform-tests/mediacapture-record": "skip",
+ "web-platform-tests/mediacapture-record": "import",
"web-platform-tests/mediacapture-streams": "import",
"web-platform-tests/mediasession": "skip",
"web-platform-tests/microdata": "skip",
--- /dev/null
+
+FAIL The BlobEventInit dictionary is required Can't find variable: BlobEvent
+FAIL The BlobEventInit dictionary's data member is required. assert_throws: function "function () {
+ new BlobEvent("type", {});
+ }" threw object "ReferenceError: Can't find variable: BlobEvent" ("ReferenceError") expected object "TypeError" ("TypeError")
+FAIL The BlobEvent instance's data attribute is set. Can't find variable: BlobEvent
+
--- /dev/null
+<!doctype html>
+<title>BlobEvent constructor</title>
+<link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#blob-event">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(BlobEvent.length, 2);
+ assert_throws(new TypeError, function() {
+ new BlobEvent("type");
+ });
+ assert_throws(new TypeError, function() {
+ new BlobEvent("type", null);
+ });
+ assert_throws(new TypeError, function() {
+ new BlobEvent("type", undefined);
+ });
+}, "The BlobEventInit dictionary is required");
+
+test(function() {
+ assert_throws(new TypeError, function() {
+ new BlobEvent("type", {});
+ });
+ assert_throws(new TypeError, function() {
+ new BlobEvent("type", { data: null });
+ });
+ assert_throws(new TypeError, function() {
+ new BlobEvent("type", { data: undefined });
+ });
+}, "The BlobEventInit dictionary's data member is required.");
+
+test(function() {
+ var blob = new Blob();
+ var event = new BlobEvent("type", { data: blob });
+ assert_equals(event.type, "type");
+ assert_equals(event.data, blob);
+}, "The BlobEvent instance's data attribute is set.");
+</script>
--- /dev/null
+spec: https://w3c.github.io/mediacapture-record/
+suggested_reviewers:
+ - yellowdoge
--- /dev/null
+
+FAIL idl_test setup promise_test: Unhandled rejection with value: object "Got an error before parsing any named definition: Unrecognised tokens, line 1 (tokens: "{\"error\": {\"message\"")
+[
+ {
+ "type": "{",
+ "value": "{",
+ "trivia": ""
+ },
+ {
+ "type": "string",
+ "value": "\"error\"",
+ "trivia": ""
+ },
+ {
+ "type": ":",
+ "value": ":",
+ "trivia": ""
+ },
+ {
+ "type": "{",
+ "value": "{",
+ "trivia": " "
+ },
+ {
+ "type": "string",
+ "value": "\"message\"",
+ "trivia": ""
+ }
+]"
+
--- /dev/null
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
--- /dev/null
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// https://w3c.github.io/mediacapture-record/
+
+idl_test(
+ ['mediastream-recording'],
+ ['mediacapture-streams', 'FileAPI', 'html', 'dom'],
+ idl_array => {
+ // Ignored errors will be surfaced in idlharness.js's test_object below.
+ let recorder, blob, error;
+ try {
+ const canvas = document.createElement('canvas');
+ document.body.appendChild(canvas);
+ const context = canvas.getContext("2d");
+ context.fillStyle = "red";
+ context.fillRect(0, 0, 10, 10);
+ const stream = canvas.captureStream();
+ recorder = new MediaRecorder(stream);
+ } catch(e) {}
+ idl_array.add_objects({ MediaRecorder: [recorder] });
+
+ try {
+ blob = new BlobEvent("type", {
+ data: new Blob(),
+ timecode: performance.now(),
+ });
+ } catch(e) {}
+ idl_array.add_objects({ BlobEvent: [blob] });
+
+ try {
+ error = new MediaRecorderErrorEvent("type", {});
+ } catch(e) {}
+ idl_array.add_objects({ MediaRecorderErrorEvent: [error] });
+ }
+);
--- /dev/null
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
+/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.js