Skip to content

Commit

Permalink
Introduce WebTransport.Close and WebTransportClient.OnClosed
Browse files Browse the repository at this point in the history
Introduce network.mojom.WebTransport.Close and
network.mojom.WebTransportClient.OnClosed. They are corresponding to
https://w3c.github.io/webtransport/#session-terminate and
https://w3c.github.io/webtransport/#session-terminated.

We have WPTs that tests this change in
/wpt/webtransport/close.https.any.js. This is skipped as the test server
infrastructure is not ready. Also, the underlying implementation in net/
is not ready so the tests fail even in my local environment.

Bug: 1011392, 1242902, 1242906
Change-Id: I460f1a18815dbeee3720a637d9f496a24aed36d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3197410
Commit-Queue: Yutaka Hirano <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Adam Rice <[email protected]>
Cr-Commit-Position: refs/heads/main@{#927651}
  • Loading branch information
yutakahirano authored and chromium-wpt-export-bot committed Oct 5, 2021
1 parent 80b54f8 commit 659b5f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webtransport/close.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ promise_test(async t => {
add_completion_callback(() => wt.close());
await wt.ready;

wt.close({code: 99, reason: 'reason'});
wt.close({closeCode: 99, reason: 'reason X'});

const close_info = await wt.closed;

assert_equals(close_info.code, 99, 'code');
assert_equals(close_info.closeCode, 99, 'code');
assert_equals(close_info.reason, 'reason X', 'reason');

await wait(10);
Expand All @@ -57,11 +57,11 @@ promise_test(async t => {
await wt.ready;
const reason = 'あいうえお'.repeat(1000);

wt.close({code: 11, reason});
wt.close({closeCode: 11, reason});

const close_info = await wt.closed;

assert_equals(close_info.code, 11, 'code');
assert_equals(close_info.closeCode, 11, 'code');
assert_equals(close_info.reason, reason, 'reason');

await wait(10);
Expand Down

0 comments on commit 659b5f3

Please sign in to comment.