From fccf6a115153dd42819adf5da0337f3c53bb192e Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 13 Sep 2016 11:05:52 +0200 Subject: [PATCH 1/2] Test for specific cross-origin object exceptions This adds a new test to test for specific cross-origin object exceptions as discussed in https://github.com/whatwg/html/issues/1727. Once this test is more widely implemented the cross-origin-objects.html resource can be replaced by it (as indicated within the resource). --- .../cross-origin-objects-exceptions.html | 329 ++++++++++++++++++ 1 file changed, 329 insertions(+) create mode 100644 html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html diff --git a/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html b/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html new file mode 100644 index 00000000000000..a9d860017040f0 --- /dev/null +++ b/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html @@ -0,0 +1,329 @@ + + + + +Cross-origin behavior of Window and Location + + + + + + +
+ + + From d5dd6ccf4d05e08b22eb12a142c5d0a5255c5dec Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 29 Nov 2016 14:22:13 +0100 Subject: [PATCH 2/2] review nits --- .../cross-origin-objects/cross-origin-objects-exceptions.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html b/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html index a9d860017040f0..19e23b5c2a937a 100644 --- a/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html +++ b/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html @@ -56,7 +56,7 @@ addTest(function() { // Note: we do not check location.host as its default port semantics are hard to reflect statically assert_equals(location.hostname, host_info.ORIGINAL_HOST, 'Need to run the top-level test from domain ' + host_info.ORIGINAL_HOST); - assert_equals(location.port, host_info.HTTP_PORT, 'Need to run the top-level test from port ' + host_info.HTTP_PORT); + assert_equals(get_port(location), host_info.HTTP_PORT, 'Need to run the top-level test from port ' + host_info.HTTP_PORT); assert_equals(B.parent, window, "window.parent works same-origin"); assert_equals(C.parent, window, "window.parent works cross-origin"); assert_equals(B.location.pathname, path, "location.href works same-origin"); @@ -300,7 +300,7 @@ checkFunction(get_self_parent, Function.prototype); checkFunction(get_parent_A, Function.prototype); checkFunction(get_parent_B, B.Function.prototype); -}, "Same-origin obsevers get different accessors for cross-origin Window"); +}, "Same-origin observers get different accessors for cross-origin Window"); addTest(function() { var set_self_href = Object.getOwnPropertyDescriptor(window.location, 'href').set;