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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediarecorder/BlobEvent-basic.html

Issue 1497883002: MediaRecorder: update to spec (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: peter@s comments: add tests for BlobEvent ctor and reordered MediaRecorder.idl to match spec Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediarecorder/BlobEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src=../../resources/testharness.js></script> 2 <script src=../../resources/testharness.js></script>
3 <script src=../../resources/testharnessreport.js></script> 3 <script src=../../resources/testharnessreport.js></script>
4 <script> 4 <script>
5 5
6 test(function() { 6 test(function() {
7 var array = new Uint8Array([0x70, 0x71, 0x72, 0x73]); 7 var array = new Uint8Array([0x70, 0x71, 0x72, 0x73]);
8 var blob = new Blob([array]); 8 var blob = new Blob([array]);
9 var blobEvent = new BlobEvent('BlobEvent', {data : blob}); 9 var blobEvent = new BlobEvent('BlobEvent', {data : blob});
10 10
11 var reader = new FileReader(); 11 var reader = new FileReader();
12 reader.addEventListener("loadend", function() { 12 reader.addEventListener("loadend", function() {
13 // |reader.result| contains the contents of blob as an ArrayBuffer. 13 // |reader.result| contains the contents of blob as an ArrayBuffer.
14 var outputArray = new Uint8Array(reader.result); 14 var outputArray = new Uint8Array(reader.result);
15 assert_array_equals(array, outputArray) 15 assert_array_equals(array, outputArray)
16 }); 16 });
17 reader.readAsArrayBuffer(blob); 17 reader.readAsArrayBuffer(blob);
18 18
19 }, 'check BlobEvent creation and content management'); 19 }, 'check BlobEvent creation and content management');
20 20
21 test(function() {
22 assert_throws(null,
23 function() { var blobEvent = new BlobEvent('BlobEvent'); });
24 }, 'check BlobEvent needs two constructor parameters, type and BlobEventInit');
25
26 test(function() {
27 assert_throws(null,
28 function() {
29 var blobEvent = new BlobEvent('BlobEvent', {data : "blergh"});
30 });
31 }, 'check BlobEvent needs the second constructor parameter to be a BlobEventInit ');
32
21 </script> 33 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediarecorder/BlobEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698