[Streams API] Collecting a ReadableStreamReader should not unlock its stream
[WebKit-https.git] / LayoutTests / streams / readablestreamreader-constructor.html
index 2bd073afa084f6523a76f014fef14183c1f42ad9..ea46bf3d2d3f88a16d5b45359f86ac449252105c 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <script src='../resources/testharness.js'></script>
 <script src='../resources/testharnessreport.js'></script>
+<script src='../resources/gc.js'></script>
 <script>
  
 test(function() {
@@ -82,4 +83,11 @@ test(function() {
 
 }, 'ReadableStream getReader should throw if ReadableStream is locked');
 
+test(function() {
+    rs = new ReadableStream({});
+    rs.getReader();
+    window.gc();
+    assert_throws(new TypeError(), function() { rs.getReader(); });
+}, 'Collecting a ReadableStreamReader should not unlock its stream.');
+
 </script>