Skip to content

Commit

Permalink
Direct Sockets: Move transient activation consumption from renderer to
Browse files Browse the repository at this point in the history
browser.

We move transient activation consumption to browser and record
Permission Denied failures caused by TransientActivation.

Bug: 1119600
Change-Id: I57d9214269d57745050b33feb33129dee1eb3b11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2647217
Commit-Queue: Ke He <kehe@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#847980}
  • Loading branch information
song-fangzhen authored and chromium-wpt-export-bot committed Jan 28, 2021
1 parent 74e8190 commit 1d35433
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions raw-sockets/open-consume-activation.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script>
'use strict';

const options = { remoteAddress: "127.0.0.1" };
const options = { remotePort: 53 };

promise_test(async t => {
// Not activated by user gesture, so not allowed!
Expand All @@ -21,12 +21,9 @@

await test_driver.bless("open socket");

// We have a gesture, but remotePort is omitted - so TypeError!
await promise_rejects_js(
t,
TypeError,
navigator.openTCPSocket(options)
);
// We have a gesture, but remoteAddress is omitted - so not allowed!
await promise_rejects_dom(t, "NotAllowedError",
navigator.openTCPSocket(options));

// The activation has been consumed, so calling openTCPSocket() again
// would require a new gesture.
Expand All @@ -41,12 +38,9 @@

await test_driver.bless("open socket");

// We have a gesture, but remotePort is omitted - so TypeError!
await promise_rejects_js(
t,
TypeError,
navigator.openUDPSocket(options)
);
// We have a gesture, but remoteAddress is omitted - so not allowed!
await promise_rejects_dom(t, "NotAllowedError",
navigator.openTCPSocket(options));

// The activation has been consumed, so calling openUDPSocket() again
// would require a new gesture.
Expand Down

0 comments on commit 1d35433

Please sign in to comment.