<!DOCTYPE html>
<script src="resources/text-encode-transform.js"></script>
<script src="resources/transform-stream.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
'use strict';

test(() => {
  const te = new TextEncoder();
  assert_inherits(te, 'readable', 'readable property must be present');
  assert_readonly(te, 'readable', 'readable property must be read-only');
  assert_equals(typeof ReadableStream.prototype.getReader.call(te.readable),
                'object', 'readable property must pass brand check');
  assert_inherits(te, 'writable', 'writable property must be present');
  assert_readonly(te, 'writable', 'writable property must be read-only');
  assert_equals(typeof WritableStream.prototype.getWriter.call(te.writable),
                'object', 'writable property must pass brand check');
}, 'TextEncoder object must have readable and writable properties');

test(() => {
  const td = new TextDecoder();
  assert_inherits(td, 'readable', 'readable property must be present');
  assert_readonly(td, 'readable', 'readable property must be read-only');
  assert_equals(typeof ReadableStream.prototype.getReader.call(td.readable),
                'object', 'readable property must pass brand check');
  assert_inherits(td, 'writable', 'writable property must be present');
  assert_readonly(td, 'writable', 'writable property must be read-only');
  assert_equals(typeof WritableStream.prototype.getWriter.call(td.writable),
                'object', 'writable property must pass brand check');
}, 'TextDecoder object must have readable and writable properties');

</script>

Add a test for readable and writable properties
Add a test for readable and writable properties

Verify that the "readable" and "writable" attributes are correctly available and
configured on TextEncoder and TextDecoder objects.

assert_idl_attribute() is a deprecated alias for assert_inherits(). Use
assert_inherits() instead.
