diff --git a/html/browsers/origin/tentative/api/origin-from-location.window.js b/html/browsers/origin/tentative/api/origin-from-location.window.js index 9c42d45cf7551a..2469ff403ef1de 100644 --- a/html/browsers/origin/tentative/api/origin-from-location.window.js +++ b/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.`);