Title: [235947] trunk/LayoutTests/imported/w3c
Revision
235947
Author
[email protected]
Date
2018-09-12 13:55:29 -0700 (Wed, 12 Sep 2018)

Log Message

Import media recorder api WPT tests
https://bugs.webkit.org/show_bug.cgi?id=189526

Patch by YUHAN WU <[email protected]> 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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235946 => 235947)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-09-12 20:51:30 UTC (rev 235946)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-09-12 20:55:29 UTC (rev 235947)
@@ -1,3 +1,20 @@
+2018-09-12  YUHAN WU  <[email protected]>
+
+        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  <[email protected]>
 
         [IntersectionObserver] Implement rootMargin expansion

Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (235946 => 235947)


--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2018-09-12 20:51:30 UTC (rev 235946)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2018-09-12 20:55:29 UTC (rev 235947)
@@ -257,7 +257,7 @@
     "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", 

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1,7 @@
+
+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
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1,38 @@
+<!doctype html>
+<title>BlobEvent constructor</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+<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>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/META.yml (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/META.yml	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/META.yml	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1,3 @@
+spec: https://w3c.github.io/mediacapture-record/
+suggested_reviewers:
+  - yellowdoge

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window-expected.txt (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window-expected.txt	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1,30 @@
+
+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": ""
+    }
+]"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.html (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.html	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.js (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.js	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/idlharness.window.js	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1,38 @@
+// 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] });
+  }
+);

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/w3c-import.log (0 => 235947)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/w3c-import.log	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/w3c-import.log	2018-09-12 20:55:29 UTC (rev 235947)
@@ -0,0 +1,19 @@
+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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to