tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 553ecf87440181d0081c2140cc47bfebcfa27ef8
parent 28309754addbbda458849cdf0e541cd84d394b0d
Author: Mike West <mkwst@chromium.org>
Date:   Wed, 26 Nov 2025 09:00:46 +0000

Bug 2002039 [wpt PR 56226] - [Origin API] Drop `Location` and `WorkerLocation` conversions., a=testonly

Automatic update from web-platform-tests
[Origin API] Drop `Location` and `WorkerLocation` conversions.

After discussion with Anne in [1], it makes sense to drop conversions
from `Location` and `WorkerLocation` objects via `Origin.from()`. Those
can meaningfully differ from the origin of the context to which they
belong due to sandboxing, and we should encourage developers to use the
right `Origin` representation going forward.

[1]: https://github.com/whatwg/html/pull/11846#issuecomment-3563460363

Bug: 434131026
Change-Id: Ie8101ac9743767a32c109b83bdc82c9bb715d3b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7186344
Reviewed-by: Antonio Sartori <antoniosartori@chromium.org>
Commit-Queue: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1549657}

--

wpt-commits: a4373b8773f810610565b04c79a289da9150bde1
wpt-pr: 56226

Diffstat:
Mtesting/web-platform/tests/html/browsers/origin/tentative/api/origin-from-location.window.js | 42++----------------------------------------
Mtesting/web-platform/tests/webnn/conformance_tests/tensor.https.any.js | 22++++++++++++++++++++++
2 files changed, 24 insertions(+), 40 deletions(-)

diff --git a/testing/web-platform/tests/html/browsers/origin/tentative/api/origin-from-location.window.js b/testing/web-platform/tests/html/browsers/origin/tentative/api/origin-from-location.window.js @@ -2,23 +2,8 @@ // META: script=/common/get-host-info.sub.js test(t => { - const origin = Origin.from(window.location); - assert_true(!!origin); - assert_false(origin.opaque); - assert_true(origin.isSameOrigin(Origin.from(get_host_info().ORIGIN))); -}, `Origin.from(window.location) returns a tuple origin.`); - -async_test(t => { - const el = document.createElement('iframe'); - el.src = "/common/blank.html"; - el.onload = t.step_func_done(_ => { - const origin = Origin.from(el.contentWindow.location); - assert_true(!!origin); - assert_false(origin.opaque); - assert_true(origin.isSameOrigin(Origin.from(get_host_info().ORIGIN))); - }); - document.body.appendChild(el); -}, `Origin.from(Location) returns a tuple origin for same-origin frames.`); + assert_throws_js(TypeError, _ => Origin.from(window.location)); +}, `Origin.from(window.location) throws.`); async_test(t => { const el = document.createElement('iframe'); @@ -28,26 +13,3 @@ async_test(t => { }); document.body.appendChild(el); }, `Origin.from(Location) throws for cross-origin frames.`); - -async_test(t => { - const w = window.open("/html/browsers/windows/resources/post-to-opener.html"); - window.addEventListener("message", t.step_func(e => { - if (e.source === w) { - const origin = Origin.from(w.location); - assert_true(!!origin); - assert_false(origin.opaque); - assert_true(origin.isSameOrigin(Origin.from(get_host_info().ORIGIN))); - t.done(); - } - })); -}, `Origin.from(Location) returns a tuple origin for same-origin windows.`); - -async_test(t => { - const w = window.open(get_host_info().REMOTE_ORIGIN + "/html/browsers/windows/resources/post-to-opener.html"); - window.addEventListener("message", t.step_func(e => { - if (e.source === w) { - assert_throws_js(TypeError, _ => Origin.from(w.location)); - t.done(); - } - })); -}, `Origin.from(Location) throws for cross-origin windows.`); diff --git a/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js @@ -1330,6 +1330,28 @@ const testDispatchTensor = (testName) => { mlContext, outputTensor, new Float32Array(sizeOfShape(shape)).fill(1.0)); }, `${testName} / same constant multiple graphs`); + + promise_test(async () => { + // Construct a simple graph: OUTPUT = IDENTITY(INPUT) to test whether the default + // tensor is initialized to zero. + const builder = new MLGraphBuilder(mlContext); + const inputOperand = builder.input('input', {dataType: 'int32', shape: [1024]}); + const graph = await builder.build({'output': builder.identity(inputOperand)}); + + const inputTensor = await mlContext.createTensor({ + dataType: inputOperand.dataType, + shape: inputOperand.shape + }); + + const outputTensor = await mlContext.createTensor({ + dataType: inputOperand.dataType, + shape: inputOperand.shape, + readable: true + }); + + mlContext.dispatch(graph, {'input': inputTensor}, {'output': outputTensor}); + await assert_tensor_data_equals(mlContext, outputTensor, new Uint32Array(1024)); + }, `${testName} / default tensor uninitialized`); }; /**