MCPcopy Create free account
hub / github.com/nodejs/node / runGenericTests

Function runGenericTests

test/fixtures/wpt/encoding/streams/realms.window.js:140–167  ·  view source on GitHub ↗
(classname)

Source from the content-addressed store, hash-verified

138};
139
140function runGenericTests(classname) {
141 promise_test(async () => {
142 const obj = await evalInRealmAndReturn(
143 constructedRealm, `new parent.constructorRealm.${classname}()`);
144 assert_equals(obj.constructor, constructorRealm[classname],
145 'obj should be in constructor realm');
146 }, `a ${classname} object should be associated with the realm the ` +
147 'constructor came from');
148
149 promise_test(async () => {
150 const objId = await constructAndStore(classname);
151 const readableGetterId = id();
152 readRealm[readableGetterId] = Object.getOwnPropertyDescriptor(
153 methodRealm[classname].prototype, 'readable').get;
154 const writableGetterId = id();
155 writeRealm[writableGetterId] = Object.getOwnPropertyDescriptor(
156 methodRealm[classname].prototype, 'writable').get;
157 const readable = await evalInRealmAndReturn(
158 readRealm, `${readableGetterId}.call(${objId})`);
159 const writable = await evalInRealmAndReturn(
160 writeRealm, `${writableGetterId}.call(${objId})`);
161 assert_equals(readable.constructor, constructorRealm.ReadableStream,
162 'readable should be in constructor realm');
163 assert_equals(writable.constructor, constructorRealm.WritableStream,
164 'writable should be in constructor realm');
165 }, `${classname}'s readable and writable attributes should come from the ` +
166 'same realm as the constructor definition');
167}
168
169function runTextEncoderStreamTests() {
170 promise_test(async () => {

Callers 1

realms.window.jsFile · 0.85

Calls 5

evalInRealmAndReturnFunction · 0.85
constructAndStoreFunction · 0.85
promise_testFunction · 0.50
assert_equalsFunction · 0.50
idFunction · 0.50

Tested by

no test coverage detected