Skip to content

Commit 6dcee24

Browse files
Guy BedfordJakeChampion
authored andcommitted
wpt fixes
1 parent 26c49b2 commit 6dcee24

File tree

6 files changed

+63
-9
lines changed

6 files changed

+63
-9
lines changed

c-dependencies/js-compute-runtime/js-compute-runtime.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ bool init_js() {
115115
if (!js::UseInternalJobQueues(cx) || !JS::InitSelfHostedCode(cx))
116116
return false;
117117

118-
bool ENABLE_EXPERIMENTAL_BYOB_STREAMS = std::string(std::getenv("ENABLE_EXPERIMENTAL_BYOB_STREAMS")) == "1";
118+
bool ENABLE_EXPERIMENTAL_BYOB_STREAMS =
119+
std::string(std::getenv("ENABLE_EXPERIMENTAL_BYOB_STREAMS")) == "1";
119120

120121
// TODO: check if we should set a different creation zone.
121122
JS::RealmOptions options;

src/compileApplicationToWasm.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,16 @@ export async function compileApplicationToWasm(input, output, wasmEngine, enable
9999
shell: true,
100100
encoding: "utf-8",
101101
env: {
102-
ENABLE_EXPERIMENTAL_BYOB_STREAMS: enableExperimentalByobStreams ? 1 : 0
102+
ENABLE_EXPERIMENTAL_BYOB_STREAMS: enableExperimentalByobStreams ? '1' : '0'
103103
}
104104
}
105105
);
106+
if (wizerProcess.status !== 0) {
107+
throw new Error(`Wizer initialization failure`);
108+
}
106109
process.exitCode = wizerProcess.status;
107110
} catch (error) {
108-
console.error(`Error: Failed to compile JavaScript to Wasm`, error.message);
111+
console.error(`Error: Failed to compile JavaScript to Wasm: `, error.message);
109112
process.exit(1);
110113
}
111114
}

tests/wpt-harness/build-wpt-runtime.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ inputs=(
1010
)
1111

1212
cat "${inputs[@]}" > "${script_dir}/wpt-test-runner.js"
13-
node "${script_dir}/../../js-compute-runtime-cli.js" "${script_dir}/wpt-test-runner.js" wpt-runtime.wasm
13+
node "${script_dir}/../../js-compute-runtime-cli.js" --enable-experimental-byob-streams "${script_dir}/wpt-test-runner.js" wpt-runtime.wasm

tests/wpt-harness/expectations/streams/readable-byte-streams/bad-buffers-and-views.any.js.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"status": "PASS"
5858
},
5959
"ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer is zero-length (in the closed state)": {
60-
"status": "FAIL"
60+
"status": "PASS"
6161
},
6262
"ReadableStream with byte source: respondWithNewView() throws if the supplied view is non-zero-length (in the closed state)": {
6363
"status": "PASS"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"ReadableStreamBYOBRequest constructor should throw when passed a undefined ReadableByteStreamController and a undefined view": {
3+
"status": "FAIL"
4+
},
5+
"ReadableStreamBYOBRequest constructor should throw when passed a undefined ReadableByteStreamController and a null view": {
6+
"status": "FAIL"
7+
},
8+
"ReadableStreamBYOBRequest constructor should throw when passed a undefined ReadableByteStreamController and a fake view": {
9+
"status": "FAIL"
10+
},
11+
"ReadableStreamBYOBRequest constructor should throw when passed a undefined ReadableByteStreamController and a real view": {
12+
"status": "FAIL"
13+
},
14+
"ReadableStreamBYOBRequest constructor should throw when passed a null ReadableByteStreamController and a undefined view": {
15+
"status": "FAIL"
16+
},
17+
"ReadableStreamBYOBRequest constructor should throw when passed a null ReadableByteStreamController and a null view": {
18+
"status": "FAIL"
19+
},
20+
"ReadableStreamBYOBRequest constructor should throw when passed a null ReadableByteStreamController and a fake view": {
21+
"status": "FAIL"
22+
},
23+
"ReadableStreamBYOBRequest constructor should throw when passed a null ReadableByteStreamController and a real view": {
24+
"status": "FAIL"
25+
},
26+
"ReadableStreamBYOBRequest constructor should throw when passed a fake ReadableByteStreamController and a undefined view": {
27+
"status": "FAIL"
28+
},
29+
"ReadableStreamBYOBRequest constructor should throw when passed a fake ReadableByteStreamController and a null view": {
30+
"status": "FAIL"
31+
},
32+
"ReadableStreamBYOBRequest constructor should throw when passed a fake ReadableByteStreamController and a fake view": {
33+
"status": "FAIL"
34+
},
35+
"ReadableStreamBYOBRequest constructor should throw when passed a fake ReadableByteStreamController and a real view": {
36+
"status": "FAIL"
37+
},
38+
"ReadableStreamBYOBRequest constructor should throw when passed a real ReadableByteStreamController and a undefined view": {
39+
"status": "FAIL"
40+
},
41+
"ReadableStreamBYOBRequest constructor should throw when passed a real ReadableByteStreamController and a null view": {
42+
"status": "FAIL"
43+
},
44+
"ReadableStreamBYOBRequest constructor should throw when passed a real ReadableByteStreamController and a fake view": {
45+
"status": "FAIL"
46+
},
47+
"ReadableStreamBYOBRequest constructor should throw when passed a real ReadableByteStreamController and a real view": {
48+
"status": "FAIL"
49+
}
50+
}

tests/wpt-harness/expectations/streams/readable-byte-streams/general.any.js.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"status": "PASS"
211211
},
212212
"calling respondWithNewView() twice on the same byobRequest should throw": {
213-
"status": "FAIL"
213+
"status": "PASS"
214214
},
215215
"calling respond(0) twice on the same byobRequest should throw even when closed": {
216216
"status": "PASS"
@@ -243,10 +243,10 @@
243243
"status": "FAIL"
244244
},
245245
"ReadableStream with byte source: respondWithNewView() with a smaller view": {
246-
"status": "FAIL"
246+
"status": "PASS"
247247
},
248248
"ReadableStream with byte source: respondWithNewView() with a zero-length view (in the closed state)": {
249-
"status": "FAIL"
249+
"status": "PASS"
250250
},
251251
"ReadableStream with byte source: respondWithNewView() with a transferred non-zero-length view (in the readable state)": {
252252
"status": "FAIL"
@@ -294,6 +294,6 @@
294294
"status": "FAIL"
295295
},
296296
"ReadableStream with byte source: autoAllocateChunkSize, read(), respondWithNewView()": {
297-
"status": "FAIL"
297+
"status": "PASS"
298298
}
299299
}

0 commit comments

Comments
 (0)