diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name')
15 files changed, 152 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/.gitkeep diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js new file mode 100644 index 000000000..ae51265a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/callback.js @@ -0,0 +1 @@ +opener.callback()
\ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html new file mode 100644 index 000000000..6f44d8a83 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html @@ -0,0 +1,7 @@ +<!doctype html> +<script> +onload = function() {opener.postMessage("loaded", "*")}; +onbeforeunload = function() { + opener.callback(); +} +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html new file mode 100644 index 000000000..dcb8830ab --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload.html @@ -0,0 +1,16 @@ +<!doctype html> +<title>Running beforeunload handler in window.close()</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +var t = async_test(); +var w = window.open("close_beforeunload-1.html"); +onmessage = t.step_func(function(event) { + if (event.data != "loaded") { + return; + } + w.close(); +}); +callback = function() {t.done()} +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html new file mode 100644 index 000000000..c50eddd41 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html @@ -0,0 +1 @@ +<!doctype html> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html new file mode 100644 index 000000000..874f5be9d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer.html @@ -0,0 +1,18 @@ +<!doctype html> +<title>Running defer script in window.close()</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +var t = async_test(undefined, {timeout:4000}); +t.step(function() { + var w = window.open("close_script_defer-1.html"); + w.document.open() + w.document.write("<script defer src='callback.js'><\/script>") + setTimeout(function() { + w.close(); + }, 1000); +}) +setTimeout(function() {t.done();}, 1000) +callback = t.step(function() {assert_unreached()}) +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html new file mode 100644 index 000000000..9a9e304e8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html @@ -0,0 +1,7 @@ +<!doctype html> +<script> +onload = function() {opener.postMessage("loaded", "*")}; +onunload = function() { + opener.callback(); +} +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html new file mode 100644 index 000000000..e4d231b28 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload.html @@ -0,0 +1,16 @@ +<!doctype html> +<title>Running unload handler in window.close()</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +var t = async_test(); +var w = window.open("close_unload-1.html"); +onmessage = t.step_func(function(event) { + if (event.data != "loaded") { + return; + } + w.close(); +}); +callback = function() {t.done()} +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html new file mode 100644 index 000000000..75c8729cf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>[Browsing Context] : [APIs for creating browsing_contexts by name]</title> +<link rel="author" title="Duhyeong Kim" href="mailto:dduskim@gmail.com"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#apis-for-creating-and-navigating-browsing-contexts-by-name"> +<meta name=timeout content=long> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +async_test(function() { + var currentUrl = 'http://' + window.location.host + '/common/blank.html'; + var win = window.open(currentUrl, '', 'height=1,width=1'); + this.add_cleanup(function() { win.close(); }); + win.onload = this.step_func_done(function () { + assert_equals(win.location.href, currentUrl, 'should be equal to result url'); + }); +}, 'first argument: absolute url'); + +test(function() { + var win = window.open('', '', 'height=1,width=1'); + this.add_cleanup(function() { win.close(); }); + assert_equals(win.location.href, 'about:blank', 'win.location.href'); +}, 'first argument: empty url'); + +test(function () { + var win = window.open('', 'testWindow', 'height=1,width=1'); + win.close(); + assert_equals(win.name, 'testWindow', 'should have a browsing context name'); +}, 'second argument: passing a non-empty name'); + +test(function () { + var win = window.open('', '', 'height=1,width=1'); + this.add_cleanup(function() { win.close(); }); + assert_equals(win.name, '', 'window should not have a name'); + win.name = 'testWindow'; + assert_equals(win.name, 'testWindow', 'window should have a name'); +}, 'second argument: setting name after opening'); +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html new file mode 100644 index 000000000..7dd48b41c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html @@ -0,0 +1,2 @@ +<!doctype html> +<p>Now open a new tab and navigate to <a href="001-2.html">001-2</a></p> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html new file mode 100644 index 000000000..b1413861a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html @@ -0,0 +1,16 @@ +<!doctype html> +<script> +var result = "FAIL"; +if (opener != null) { + result = "FAIL (did you open this page in a new tab?)"; +} else { + var w = window.open("", "test_name"); + if (w.location.href !== "about:blank") { + result = "FAIL (didn't open an about:blank browsing context)"; + } else { + w.close(); + result = "PASS"; + } + document.write(result); +} +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html new file mode 100644 index 000000000..7b0f21ec0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html @@ -0,0 +1,3 @@ +<!doctype html> +<title>Accessing named windows from outside the unit of related browsing contexts</title> +<a href="001-1.html" target="test_name">Click here</a> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html new file mode 100644 index 000000000..0e210f351 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html @@ -0,0 +1,8 @@ +<!doctype html> +<p>Now open a new tab and navigate to <a></a></p> +<script> +href = window.location.href.replace("http://", "http://www.").replace("002-1.html", "002-2.html"); +var a = document.getElementsByTagName("a")[0]; +a.href = href; +a.textContent = href; +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html new file mode 100644 index 000000000..b1413861a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html @@ -0,0 +1,16 @@ +<!doctype html> +<script> +var result = "FAIL"; +if (opener != null) { + result = "FAIL (did you open this page in a new tab?)"; +} else { + var w = window.open("", "test_name"); + if (w.location.href !== "about:blank") { + result = "FAIL (didn't open an about:blank browsing context)"; + } else { + w.close(); + result = "PASS"; + } + document.write(result); +} +</script> diff --git a/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html new file mode 100644 index 000000000..b568ae8d4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html @@ -0,0 +1,3 @@ +<!doctype html> +<title>Accessing different-origin named windows from outside the unit of related browsing contexts</title> +<a href="002-1.html" target="test_name">Click here</a> |