<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[211732] trunk/LayoutTests/imported/w3c</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/211732">211732</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-02-06 09:47:02 -0800 (Mon, 06 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Re-sync html/browsers/origin/cross-origin-objects tests
https://bugs.webkit.org/show_bug.cgi?id=167881

Reviewed by Youenn Fablet.

Re-sync html/browsers/origin/cross-origin-objects tests from upstream a052787d.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt: Removed.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html: Removed.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
* web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html:
* web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectsframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectsw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectsexceptionsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectsexceptionshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-02-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Re-sync html/browsers/origin/cross-origin-objects tests
+        https://bugs.webkit.org/show_bug.cgi?id=167881
+
+        Reviewed by Youenn Fablet.
+
+        Re-sync html/browsers/origin/cross-origin-objects tests from upstream a052787d.
+
+        * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt: Removed.
+        * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html: Removed.
+        * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
+        * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
+        * web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html:
+        * web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log:
+
</ins><span class="cx"> 2017-02-03  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Import web-platform-tests/hr-time tests
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectsexceptionsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 1380: Blocked a frame with origin &quot;http://localhost:8800&quot; from accessing a frame with origin &quot;http://127.0.0.1:8800&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1380: Blocked a frame with origin &quot;http://localhost:8800&quot; from accessing a frame with origin &quot;http://127.0.0.1:8800&quot;. Protocols, domains, and ports must match.
-
-PASS Basic sanity-checking 
-PASS Only whitelisted properties are accessible cross-origin 
-PASS [[GetPrototypeOf]] should return null 
-PASS [[SetPrototypeOf]] should throw 
-PASS [[IsExtensible]] should return true for cross-origin objects 
-FAIL [[PreventExtensions]] should throw for cross-origin objects assert_throws: preventExtensions on cross-origin Location should throw function &quot;function () { Object.preventExtensions(C.location) }&quot; threw object &quot;SecurityError (DOM Exception 18): Blocked a frame with or...&quot; (&quot;SecurityError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
-PASS [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| 
-PASS [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly 
-PASS [[Delete]] Should throw on cross-origin objects 
-PASS [[DefineOwnProperty]] Should throw for cross-origin objects 
-PASS [[Enumerate]] should return an empty iterator 
-PASS [[OwnPropertyKeys]] should return all properties from cross-origin objects 
-PASS A and B jointly observe the same identity for cross-origin Window and Location 
-PASS Cross-origin functions get local Function.prototype 
-PASS Cross-origin Window accessors get local Function.prototype 
-PASS Same-origin observers get different functions for cross-origin objects 
-PASS Same-origin observers get different accessors for cross-origin Window 
-PASS Same-origin observers get different accessors for cross-origin Location 

</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectsexceptionshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -1,329 +0,0 @@
</span><del>-&lt;!--  Once most browsers pass this test it can replace cross-origin-objects.html. It is meant to be
-     identical (please verify), except for also checking that the exceptions are correct.  --&gt;
-&lt;!doctype html&gt;
-&lt;meta charset=utf-8&gt;
-&lt;meta name=&quot;timeout&quot; content=&quot;long&quot;&gt;
-&lt;title&gt;Cross-origin behavior of Window and Location&lt;/title&gt;
-&lt;link rel=&quot;author&quot; title=&quot;Bobby Holley (:bholley)&quot; href=&quot;bobbyholley@gmail.com&quot;&gt;
-&lt;link rel=&quot;help&quot; href=&quot;https://html.spec.whatwg.org/multipage/#security-window&quot;&gt;
-&lt;link rel=&quot;help&quot; href=&quot;https://html.spec.whatwg.org/multipage/#security-location&quot;&gt;
-&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;/common/get-host-info.sub.js&quot;&gt;&lt;/script&gt;
-&lt;div id=log&gt;&lt;/div&gt;
-&lt;iframe id=&quot;B&quot;&gt;&lt;/iframe&gt;
-&lt;iframe id=&quot;C&quot;&gt;&lt;/iframe&gt;
-&lt;script&gt;
-/*
- * Setup boilerplate. This gives us a same-origin window &quot;B&quot; and a cross-origin
- * window &quot;C&quot;.
- */
-var host_info = get_host_info();
-
-setup({explicit_done: true});
-path = location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/frame.html';
-var B = document.getElementById('B').contentWindow;
-var C = document.getElementById('C').contentWindow;
-B.frameElement.uriToLoad = path;
-C.frameElement.uriToLoad = get_host_info().HTTP_REMOTE_ORIGIN + path;
-
-function reloadSubframes(cb) {
-  var iframes = document.getElementsByTagName('iframe');
-  iframes.forEach = Array.prototype.forEach;
-  var count = 0;
-  function frameLoaded() {
-    this.onload = null;
-    if (++count == iframes.length)
-      cb();
-  }
-  iframes.forEach(function(ifr) { ifr.onload = frameLoaded; ifr.setAttribute('src', ifr.uriToLoad); });
-}
-function isObject(x) { return Object(x) === x; }
-
-/*
- * Note: we eschew assert_equals in a lot of these tests, since the harness ends
- * up throwing when it tries to format a message involving a cross-origin object.
- */
-
-var testList = [];
-function addTest(fun, desc) { testList.push([fun, desc]); }
-
-
-/*
- * Basic sanity testing.
- */
-
-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(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, &quot;window.parent works same-origin&quot;);
-  assert_equals(C.parent, window, &quot;window.parent works cross-origin&quot;);
-  assert_equals(B.location.pathname, path, &quot;location.href works same-origin&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { C.location.pathname; }, &quot;location.pathname throws cross-origin&quot;);
-  assert_equals(B.frames, 'override', &quot;Overrides visible in the same-origin case&quot;);
-  assert_equals(C.frames, C, &quot;Overrides invisible in the cross-origin case&quot;);
-}, &quot;Basic sanity-checking&quot;);
-
-/*
- * Whitelist behavior.
- *
- * Also tests for [[GetOwnProperty]] and [[HasOwnProperty]] behavior.
- */
-
-var whitelistedWindowProps = ['location', 'postMessage', 'window', 'frames', 'self', 'top', 'parent',
-                              'opener', 'closed', 'close', 'blur', 'focus', 'length'];
-addTest(function() {
-  for (var prop in window) {
-    if (whitelistedWindowProps.indexOf(prop) != -1) {
-      C[prop]; // Shouldn't throw.
-      Object.getOwnPropertyDescriptor(C, prop); // Shouldn't throw.
-      assert_true(Object.prototype.hasOwnProperty.call(C, prop), &quot;hasOwnProperty for &quot; + prop);
-    } else {
-      assert_throws(&quot;SecurityError&quot;, function() { C[prop]; }, &quot;Should throw when accessing &quot; + prop + &quot; on Window&quot;);
-      assert_throws(&quot;SecurityError&quot;, function() { Object.getOwnPropertyDescriptor(C, prop); },
-                    &quot;Should throw when accessing property descriptor for &quot; + prop + &quot; on Window&quot;);
-      assert_throws(&quot;SecurityError&quot;, function() { Object.prototype.hasOwnProperty.call(C, prop); },
-                    &quot;Should throw when invoking hasOwnProperty for &quot; + prop + &quot; on Window&quot;);
-    }
-    if (prop != 'location')
-      assert_throws(&quot;SecurityError&quot;, function() { C[prop] = undefined; }, &quot;Should throw when writing to &quot; + prop + &quot; on Window&quot;);
-  }
-  for (var prop in location) {
-    if (prop == 'replace') {
-      C.location[prop]; // Shouldn't throw.
-      Object.getOwnPropertyDescriptor(C.location, prop); // Shouldn't throw.
-      assert_true(Object.prototype.hasOwnProperty.call(C.location, prop), &quot;hasOwnProperty for &quot; + prop);
-    }
-    else {
-      assert_throws(&quot;SecurityError&quot;, function() { C[prop]; }, &quot;Should throw when accessing &quot; + prop + &quot; on Location&quot;);
-      assert_throws(&quot;SecurityError&quot;, function() { Object.getOwnPropertyDescriptor(C, prop); },
-                    &quot;Should throw when accessing property descriptor for &quot; + prop + &quot; on Location&quot;);
-      assert_throws(&quot;SecurityError&quot;, function() { Object.prototype.hasOwnProperty.call(C, prop); },
-                    &quot;Should throw when invoking hasOwnProperty for &quot; + prop + &quot; on Location&quot;);
-    }
-    if (prop != 'href')
-      assert_throws(&quot;SecurityError&quot;, function() { C[prop] = undefined; }, &quot;Should throw when writing to &quot; + prop + &quot; on Location&quot;);
-  }
-}, &quot;Only whitelisted properties are accessible cross-origin&quot;);
-
-/*
- * ES Internal Methods.
- */
-
-/*
- * [[GetPrototypeOf]]
- */
-addTest(function() {
-  assert_true(Object.getPrototypeOf(C) === null, &quot;cross-origin Window proto is null&quot;);
-  assert_true(Object.getPrototypeOf(C.location) === null, &quot;cross-origin Location proto is null (__proto__)&quot;);
-  var protoGetter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').get;
-  assert_true(protoGetter.call(C) === null, &quot;cross-origin Window proto is null&quot;);
-  assert_true(protoGetter.call(C.location) === null, &quot;cross-origin Location proto is null (__proto__)&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { C.__proto__; }, &quot;__proto__ property not available cross-origin&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { C.location.__proto__; }, &quot;__proto__ property not available cross-origin&quot;);
-
-}, &quot;[[GetPrototypeOf]] should return null&quot;);
-
-/*
- * [[SetPrototypeOf]]
- */
-addTest(function() {
-  assert_throws(&quot;SecurityError&quot;, function() { C.__proto__ = new Object(); }, &quot;proto set on cross-origin Window&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { C.location.__proto__ = new Object(); }, &quot;proto set on cross-origin Location&quot;);
-  var setters = [Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set];
-  if (Object.setPrototypeOf)
-    setters.push(function(p) { Object.setPrototypeOf(this, p); });
-  setters.forEach(function(protoSetter) {
-    assert_throws(new TypeError, function() { protoSetter.call(C, new Object()); }, &quot;proto setter |call| on cross-origin Window&quot;);
-    assert_throws(new TypeError, function() { protoSetter.call(C.location, new Object()); }, &quot;proto setter |call| on cross-origin Location&quot;);
-  });
-}, &quot;[[SetPrototypeOf]] should throw&quot;);
-
-/*
- * [[IsExtensible]]
- */
-addTest(function() {
-  assert_true(Object.isExtensible(C), &quot;cross-origin Window should be extensible&quot;);
-  assert_true(Object.isExtensible(C.location), &quot;cross-origin Location should be extensible&quot;);
-}, &quot;[[IsExtensible]] should return true for cross-origin objects&quot;);
-
-/*
- * [[PreventExtensions]]
- */
-addTest(function() {
-  assert_throws(new TypeError, function() { Object.preventExtensions(C) },
-                &quot;preventExtensions on cross-origin Window should throw&quot;);
-  assert_throws(new TypeError, function() { Object.preventExtensions(C.location) },
-                &quot;preventExtensions on cross-origin Location should throw&quot;);
-}, &quot;[[PreventExtensions]] should throw for cross-origin objects&quot;);
-
-/*
- * [[GetOwnProperty]]
- */
-
-addTest(function() {
-  assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'close')), &quot;C.close is |own|&quot;);
-  assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'top')), &quot;C.top is |own|&quot;);
-  assert_true(isObject(Object.getOwnPropertyDescriptor(C.location, 'href')), &quot;C.location.href is |own|&quot;);
-  assert_true(isObject(Object.getOwnPropertyDescriptor(C.location, 'replace')), &quot;C.location.replace is |own|&quot;);
-}, &quot;[[GetOwnProperty]] - Properties on cross-origin objects should be reported |own|&quot;);
-
-function checkPropertyDescriptor(desc, propName, expectWritable) {
-  assert_true(isObject(desc), &quot;property descriptor for &quot; + propName + &quot; should exist&quot;);
-  assert_equals(desc.enumerable, false, &quot;property descriptor for &quot; + propName + &quot; should be non-enumerable&quot;);
-  assert_equals(desc.configurable, true, &quot;property descriptor for &quot; + propName + &quot; should be configurable&quot;);
-  if ('value' in desc)
-    assert_equals(desc.writable, expectWritable, &quot;property descriptor for &quot; + propName + &quot; should have writable: &quot; + expectWritable);
-  else
-    assert_equals(typeof desc.set != 'undefined', expectWritable,
-                  &quot;property descriptor for &quot; + propName + &quot; should &quot; + (expectWritable ? &quot;&quot; : &quot;not &quot;) + &quot;have setter&quot;);
-}
-
-addTest(function() {
-  whitelistedWindowProps.forEach(function(prop) {
-    var desc = Object.getOwnPropertyDescriptor(C, prop);
-    checkPropertyDescriptor(desc, prop, prop == 'location');
-  });
-  checkPropertyDescriptor(Object.getOwnPropertyDescriptor(C.location, 'replace'), 'replace', false);
-  checkPropertyDescriptor(Object.getOwnPropertyDescriptor(C.location, 'href'), 'href', true);
-  assert_equals(typeof Object.getOwnPropertyDescriptor(C.location, 'href').get, 'undefined', &quot;Cross-origin location should have no href getter&quot;);
-}, &quot;[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly&quot;);
-
-/*
- * [[Delete]]
- */
-addTest(function() {
-  assert_throws(&quot;SecurityError&quot;, function() { delete C[0]; }, &quot;Can't delete cross-origin indexed property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C[100]; }, &quot;Can't delete cross-origin indexed property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.location; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.parent; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.length; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.document; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.foopy; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.location.href; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.location.replace; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.location.port; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(&quot;SecurityError&quot;, function() { delete C.location.foopy; }, &quot;Can't delete cross-origin property&quot;);
-}, &quot;[[Delete]] Should throw on cross-origin objects&quot;);
-
-/*
- * [[DefineOwnProperty]]
- */
-function checkDefine(obj, prop) {
-  var valueDesc = { configurable: true, enumerable: false, writable: false, value: 2 };
-  var accessorDesc = { configurable: true, enumerable: false, get: function() {} };
-  assert_throws(&quot;SecurityError&quot;, function() { Object.defineProperty(obj, prop, valueDesc); }, &quot;Can't define cross-origin value property &quot; + prop);
-  assert_throws(&quot;SecurityError&quot;, function() { Object.defineProperty(obj, prop, accessorDesc); }, &quot;Can't define cross-origin accessor property &quot; + prop);
-}
-addTest(function() {
-  checkDefine(C, 'length');
-  checkDefine(C, 'parent');
-  checkDefine(C, 'location');
-  checkDefine(C, 'document');
-  checkDefine(C, 'foopy');
-  checkDefine(C.location, 'href');
-  checkDefine(C.location, 'replace');
-  checkDefine(C.location, 'port');
-  checkDefine(C.location, 'foopy');
-}, &quot;[[DefineOwnProperty]] Should throw for cross-origin objects&quot;);
-
-/*
- * [[Enumerate]]
- */
-
-addTest(function() {
-  for (var prop in C)
-    assert_unreached(&quot;Shouldn't have been able to enumerate &quot; + prop + &quot; on cross-origin Window&quot;);
-  for (var prop in C.location)
-    assert_unreached(&quot;Shouldn't have been able to enumerate &quot; + prop + &quot; on cross-origin Location&quot;);
-}, &quot;[[Enumerate]] should return an empty iterator&quot;);
-
-/*
- * [[OwnPropertyKeys]]
- */
-
-addTest(function() {
-  assert_array_equals(whitelistedWindowProps.sort(), Object.getOwnPropertyNames(C).sort(),
-                      &quot;Object.getOwnPropertyNames() gives the right answer for cross-origin Window&quot;);
-  assert_array_equals(Object.getOwnPropertyNames(C.location).sort(), ['href', 'replace'],
-                      &quot;Object.getOwnPropertyNames() gives the right answer for cross-origin Location&quot;);
-}, &quot;[[OwnPropertyKeys]] should return all properties from cross-origin objects&quot;);
-
-addTest(function() {
-  assert_true(B.eval('parent.C') === C, &quot;A and B observe the same identity for C's Window&quot;);
-  assert_true(B.eval('parent.C.location') === C.location, &quot;A and B observe the same identity for C's Location&quot;);
-}, &quot;A and B jointly observe the same identity for cross-origin Window and Location&quot;);
-
-function checkFunction(f, proto) {
-  var name = f.name || '&lt;missing name&gt;';
-  assert_equals(typeof f, 'function', name + &quot; is a function&quot;);
-  assert_equals(Object.getPrototypeOf(f), proto, f.name + &quot; has the right prototype&quot;);
-}
-
-addTest(function() {
-  checkFunction(C.close, Function.prototype);
-  checkFunction(C.location.replace, Function.prototype);
-}, &quot;Cross-origin functions get local Function.prototype&quot;);
-
-addTest(function() {
-  assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'parent')),
-              &quot;Need to be able to use Object.getOwnPropertyDescriptor do this test&quot;);
-  checkFunction(Object.getOwnPropertyDescriptor(C, 'parent').get, Function.prototype);
-  checkFunction(Object.getOwnPropertyDescriptor(C.location, 'href').set, Function.prototype);
-}, &quot;Cross-origin Window accessors get local Function.prototype&quot;);
-
-addTest(function() {
-  checkFunction(close, Function.prototype);
-  assert_true(close != B.close, 'same-origin Window functions get their own object');
-  assert_true(close != C.close, 'cross-origin Window functions get their own object');
-  var close_B = B.eval('parent.C.close');
-  assert_true(close != close_B, 'close_B is unique when viewed by the parent');
-  assert_true(close_B != C.close, 'different Window functions per-incumbent script settings object');
-  checkFunction(close_B, B.Function.prototype);
-
-  checkFunction(location.replace, Function.prototype);
-  assert_true(location.replace != C.location.replace, &quot;cross-origin Location functions get their own object&quot;);
-  var replace_B = B.eval('parent.C.location.replace');
-  assert_true(replace_B != C.location.replace, 'different Location functions per-incumbent script settings object');
-  checkFunction(replace_B, B.Function.prototype);
-}, &quot;Same-origin observers get different functions for cross-origin objects&quot;);
-
-addTest(function() {
-  assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'parent')),
-              &quot;Need to be able to use Object.getOwnPropertyDescriptor do this test&quot;);
-  var get_self_parent = Object.getOwnPropertyDescriptor(window, 'parent').get;
-  var get_parent_A = Object.getOwnPropertyDescriptor(C, 'parent').get;
-  var get_parent_B = B.eval('Object.getOwnPropertyDescriptor(parent.C, &quot;parent&quot;).get');
-  assert_true(get_self_parent != get_parent_A, 'different Window accessors per-incumbent script settings object');
-  assert_true(get_parent_A != get_parent_B, 'different Window accessors per-incumbent script settings object');
-  checkFunction(get_self_parent, Function.prototype);
-  checkFunction(get_parent_A, Function.prototype);
-  checkFunction(get_parent_B, B.Function.prototype);
-}, &quot;Same-origin observers get different accessors for cross-origin Window&quot;);
-
-addTest(function() {
-  var set_self_href = Object.getOwnPropertyDescriptor(window.location, 'href').set;
-  var set_href_A = Object.getOwnPropertyDescriptor(C.location, 'href').set;
-  var set_href_B = B.eval('Object.getOwnPropertyDescriptor(parent.C.location, &quot;href&quot;).set');
-  assert_true(set_self_href != set_href_A, 'different Location accessors per-incumbent script settings object');
-  assert_true(set_href_A != set_href_B, 'different Location accessors per-incumbent script settings object');
-  checkFunction(set_self_href, Function.prototype);
-  checkFunction(set_href_A, Function.prototype);
-  checkFunction(set_href_B, B.Function.prototype);
-}, &quot;Same-origin observers get different accessors for cross-origin Location&quot;);
-
-// We do a fresh load of the subframes for each test to minimize side-effects.
-// It would be nice to reload ourselves as well, but we can't do that without
-// disrupting the test harness.
-function runNextTest() {
-  var entry = testList.shift();
-  test(entry[0], entry[1]);
-  if (testList.length != 0)
-    reloadSubframes(runNextTest);
-  else
-    done();
-}
-reloadSubframes(runNextTest);
-
-&lt;/script&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -1,25 +1,46 @@
</span><del>-CONSOLE MESSAGE: line 1380: Blocked a frame with origin &quot;http://localhost:8800&quot; from accessing a frame with origin &quot;http://127.0.0.1:8800&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1380: Blocked a frame with origin &quot;http://localhost:8800&quot; from accessing a frame with origin &quot;http://127.0.0.1:8800&quot;. Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 397: Blocked a frame with origin &quot;http://localhost:8800&quot; from accessing a frame with origin &quot;http://127.0.0.1:8800&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 397: Blocked a frame with origin &quot;http://localhost:8800&quot; from accessing a frame with origin &quot;http://127.0.0.1:8800&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> 
</span><span class="cx"> PASS Basic sanity-checking 
</span><ins>+PASS Basic sanity-checking (exception type) 
</ins><span class="cx"> PASS Only whitelisted properties are accessible cross-origin 
</span><ins>+PASS Only whitelisted properties are accessible cross-origin (exception type) 
</ins><span class="cx"> PASS [[GetPrototypeOf]] should return null 
</span><ins>+PASS [[GetPrototypeOf]] should return null (exception type) 
</ins><span class="cx"> PASS [[SetPrototypeOf]] should throw 
</span><ins>+PASS [[SetPrototypeOf]] should throw (exception type) 
</ins><span class="cx"> PASS [[IsExtensible]] should return true for cross-origin objects 
</span><ins>+PASS [[IsExtensible]] should return true for cross-origin objects (exception type) 
</ins><span class="cx"> PASS [[PreventExtensions]] should throw for cross-origin objects 
</span><ins>+FAIL [[PreventExtensions]] should throw for cross-origin objects (exception type) assert_throws: preventExtensions on cross-origin Location should throw function &quot;function () { Object.preventExtensions(C.location) }&quot; threw object &quot;SecurityError (DOM Exception 18): Blocked a frame with or...&quot; (&quot;SecurityError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</ins><span class="cx"> PASS [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| 
</span><ins>+PASS [[GetOwnProperty]] - Properties on cross-origin objects should be reported |own| (exception type) 
</ins><span class="cx"> FAIL [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly assert_equals: property descriptor for 0 should be configurable expected true but got false
</span><ins>+FAIL [[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly (exception type) assert_unreached: Main test failed Reached unreachable code
</ins><span class="cx"> PASS [[Delete]] Should throw on cross-origin objects 
</span><ins>+PASS [[Delete]] Should throw on cross-origin objects (exception type) 
</ins><span class="cx"> PASS [[DefineOwnProperty]] Should throw for cross-origin objects 
</span><ins>+PASS [[DefineOwnProperty]] Should throw for cross-origin objects (exception type) 
</ins><span class="cx"> PASS [[Enumerate]] should return an empty iterator 
</span><ins>+PASS [[Enumerate]] should return an empty iterator (exception type) 
</ins><span class="cx"> FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.getOwnPropertyNames() gives the right answer for cross-origin Window lengths differ, expected 15 got 13
</span><ins>+FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects (exception type) assert_unreached: Main test failed Reached unreachable code
</ins><span class="cx"> FAIL [[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects assert_array_equals: Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window lengths differ, expected 3 got 0
</span><ins>+FAIL [[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects (exception type) assert_unreached: Main test failed Reached unreachable code
</ins><span class="cx"> FAIL [[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices assert_array_equals: Reflect.ownKeys should start with the indices exposed on the cross-origin window. property 0, expected &quot;0&quot; but got &quot;blur&quot;
</span><ins>+FAIL [[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices (exception type) assert_unreached: Main test failed Reached unreachable code
</ins><span class="cx"> PASS A and B jointly observe the same identity for cross-origin Window and Location 
</span><ins>+PASS A and B jointly observe the same identity for cross-origin Window and Location (exception type) 
</ins><span class="cx"> PASS Cross-origin functions get local Function.prototype 
</span><ins>+PASS Cross-origin functions get local Function.prototype (exception type) 
</ins><span class="cx"> PASS Cross-origin Window accessors get local Function.prototype 
</span><ins>+PASS Cross-origin Window accessors get local Function.prototype (exception type) 
</ins><span class="cx"> PASS Same-origin observers get different functions for cross-origin objects 
</span><ins>+PASS Same-origin observers get different functions for cross-origin objects (exception type) 
</ins><span class="cx"> PASS Same-origin observers get different accessors for cross-origin Window 
</span><ins>+PASS Same-origin observers get different accessors for cross-origin Window (exception type) 
</ins><span class="cx"> PASS Same-origin observers get different accessors for cross-origin Location 
</span><ins>+PASS Same-origin observers get different accessors for cross-origin Location (exception type) 
</ins><span class="cx"> PASS {}.toString.call() does the right thing on cross-origin objects 
</span><ins>+PASS {}.toString.call() does the right thing on cross-origin objects (exception type) 
</ins><span class="cx">  
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectscrossoriginobjectshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">  * Basic sanity testing.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   // Note: we do not check location.host as its default port semantics are hard to reflect statically
</span><span class="cx">   assert_equals(location.hostname, host_info.ORIGINAL_HOST, 'Need to run the top-level test from domain ' + host_info.ORIGINAL_HOST);
</span><span class="cx">   assert_equals(get_port(location), host_info.HTTP_PORT, 'Need to run the top-level test from port ' + host_info.HTTP_PORT);
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">   assert_equals(B.parent, window, &quot;window.parent works same-origin&quot;);
</span><span class="cx">   assert_equals(C.parent, window, &quot;window.parent works cross-origin&quot;);
</span><span class="cx">   assert_equals(B.location.pathname, path, &quot;location.href works same-origin&quot;);
</span><del>-  assert_throws(null, function() { C.location.pathname; }, &quot;location.pathname throws cross-origin&quot;);
</del><ins>+  test_throws(exception_t, &quot;SecurityError&quot;, function() { C.location.pathname; }, &quot;location.pathname throws cross-origin&quot;);
</ins><span class="cx">   assert_equals(B.frames, 'override', &quot;Overrides visible in the same-origin case&quot;);
</span><span class="cx">   assert_equals(C.frames, C, &quot;Overrides invisible in the cross-origin case&quot;);
</span><span class="cx"> }, &quot;Basic sanity-checking&quot;);
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">                           Symbol.isConcatSpreadable];
</span><span class="cx"> var whitelistedWindowProps = whitelistedWindowPropNames.concat(whitelistedSymbols);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   for (var prop in window) {
</span><span class="cx">     if (whitelistedWindowProps.indexOf(prop) != -1) {
</span><span class="cx">       C[prop]; // Shouldn't throw.
</span><span class="lines">@@ -88,14 +88,14 @@
</span><span class="cx">       Object.getOwnPropertyDescriptor(C, prop); // Shouldn't throw.
</span><span class="cx">       assert_true(Object.prototype.hasOwnProperty.call(C, prop), &quot;hasOwnProperty for &quot; + String(prop));
</span><span class="cx">     } else {
</span><del>-      assert_throws(null, function() { C[prop]; }, &quot;Should throw when accessing &quot; + String(prop) + &quot; on Window&quot;);
-      assert_throws(null, function() { Object.getOwnPropertyDescriptor(C, prop); },
</del><ins>+      test_throws(exception_t, &quot;SecurityError&quot;, function() { C[prop]; }, &quot;Should throw when accessing &quot; + String(prop) + &quot; on Window&quot;);
+      test_throws(exception_t, &quot;SecurityError&quot;, function() { Object.getOwnPropertyDescriptor(C, prop); },
</ins><span class="cx">                     &quot;Should throw when accessing property descriptor for &quot; + prop + &quot; on Window&quot;);
</span><del>-      assert_throws(null, function() { Object.prototype.hasOwnProperty.call(C, prop); },
</del><ins>+      test_throws(exception_t, &quot;SecurityError&quot;, function() { Object.prototype.hasOwnProperty.call(C, prop); },
</ins><span class="cx">                     &quot;Should throw when invoking hasOwnProperty for &quot; + prop + &quot; on Window&quot;);
</span><span class="cx">     }
</span><span class="cx">     if (prop != 'location')
</span><del>-      assert_throws(null, function() { C[prop] = undefined; }, &quot;Should throw when writing to &quot; + prop + &quot; on Window&quot;);
</del><ins>+      test_throws(exception_t, &quot;SecurityError&quot;, function() { C[prop] = undefined; }, &quot;Should throw when writing to &quot; + prop + &quot; on Window&quot;);
</ins><span class="cx">   }
</span><span class="cx">   for (var prop in location) {
</span><span class="cx">     if (prop == 'replace') {
</span><span class="lines">@@ -104,14 +104,14 @@
</span><span class="cx">       assert_true(Object.prototype.hasOwnProperty.call(C.location, prop), &quot;hasOwnProperty for &quot; + prop);
</span><span class="cx">     }
</span><span class="cx">     else {
</span><del>-      assert_throws(null, function() { C[prop]; }, &quot;Should throw when accessing &quot; + prop + &quot; on Location&quot;);
-      assert_throws(null, function() { Object.getOwnPropertyDescriptor(C, prop); },
</del><ins>+      test_throws(exception_t, &quot;SecurityError&quot;, function() { C[prop]; }, &quot;Should throw when accessing &quot; + prop + &quot; on Location&quot;);
+      test_throws(exception_t, &quot;SecurityError&quot;, function() { Object.getOwnPropertyDescriptor(C, prop); },
</ins><span class="cx">                     &quot;Should throw when accessing property descriptor for &quot; + prop + &quot; on Location&quot;);
</span><del>-      assert_throws(null, function() { Object.prototype.hasOwnProperty.call(C, prop); },
</del><ins>+      test_throws(exception_t, &quot;SecurityError&quot;, function() { Object.prototype.hasOwnProperty.call(C, prop); },
</ins><span class="cx">                     &quot;Should throw when invoking hasOwnProperty for &quot; + prop + &quot; on Location&quot;);
</span><span class="cx">     }
</span><span class="cx">     if (prop != 'href')
</span><del>-      assert_throws(null, function() { C[prop] = undefined; }, &quot;Should throw when writing to &quot; + prop + &quot; on Location&quot;);
</del><ins>+      test_throws(exception_t, &quot;SecurityError&quot;, function() { C[prop] = undefined; }, &quot;Should throw when writing to &quot; + prop + &quot; on Location&quot;);
</ins><span class="cx">   }
</span><span class="cx"> }, &quot;Only whitelisted properties are accessible cross-origin&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -122,14 +122,14 @@
</span><span class="cx"> /*
</span><span class="cx">  * [[GetPrototypeOf]]
</span><span class="cx">  */
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_true(Object.getPrototypeOf(C) === null, &quot;cross-origin Window proto is null&quot;);
</span><span class="cx">   assert_true(Object.getPrototypeOf(C.location) === null, &quot;cross-origin Location proto is null (__proto__)&quot;);
</span><span class="cx">   var protoGetter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').get;
</span><span class="cx">   assert_true(protoGetter.call(C) === null, &quot;cross-origin Window proto is null&quot;);
</span><span class="cx">   assert_true(protoGetter.call(C.location) === null, &quot;cross-origin Location proto is null (__proto__)&quot;);
</span><del>-  assert_throws(null, function() { C.__proto__; }, &quot;__proto__ property not available cross-origin&quot;);
-  assert_throws(null, function() { C.location.__proto__; }, &quot;__proto__ property not available cross-origin&quot;);
</del><ins>+  test_throws(exception_t, &quot;SecurityError&quot;, function() { C.__proto__; }, &quot;__proto__ property not available cross-origin&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { C.location.__proto__; }, &quot;__proto__ property not available cross-origin&quot;);
</ins><span class="cx"> 
</span><span class="cx"> }, &quot;[[GetPrototypeOf]] should return null&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -136,15 +136,15 @@
</span><span class="cx"> /*
</span><span class="cx">  * [[SetPrototypeOf]]
</span><span class="cx">  */
</span><del>-addTest(function() {
-  assert_throws(null, function() { C.__proto__ = new Object(); }, &quot;proto set on cross-origin Window&quot;);
-  assert_throws(null, function() { C.location.__proto__ = new Object(); }, &quot;proto set on cross-origin Location&quot;);
</del><ins>+addTest(function(exception_t) {
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { C.__proto__ = new Object(); }, &quot;proto set on cross-origin Window&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { C.location.__proto__ = new Object(); }, &quot;proto set on cross-origin Location&quot;);
</ins><span class="cx">   var setters = [Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set];
</span><span class="cx">   if (Object.setPrototypeOf)
</span><span class="cx">     setters.push(function(p) { Object.setPrototypeOf(this, p); });
</span><span class="cx">   setters.forEach(function(protoSetter) {
</span><del>-    assert_throws(null, function() { protoSetter.call(C, new Object()); }, &quot;proto setter |call| on cross-origin Window&quot;);
-    assert_throws(null, function() { protoSetter.call(C.location, new Object()); }, &quot;proto setter |call| on cross-origin Location&quot;);
</del><ins>+    test_throws(exception_t, new TypeError, function() { protoSetter.call(C, new Object()); }, &quot;proto setter |call| on cross-origin Window&quot;);
+    test_throws(exception_t, new TypeError, function() { protoSetter.call(C.location, new Object()); }, &quot;proto setter |call| on cross-origin Location&quot;);
</ins><span class="cx">   });
</span><span class="cx"> }, &quot;[[SetPrototypeOf]] should throw&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * [[IsExtensible]]
</span><span class="cx">  */
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_true(Object.isExtensible(C), &quot;cross-origin Window should be extensible&quot;);
</span><span class="cx">   assert_true(Object.isExtensible(C.location), &quot;cross-origin Location should be extensible&quot;);
</span><span class="cx"> }, &quot;[[IsExtensible]] should return true for cross-origin objects&quot;);
</span><span class="lines">@@ -159,10 +159,10 @@
</span><span class="cx"> /*
</span><span class="cx">  * [[PreventExtensions]]
</span><span class="cx">  */
</span><del>-addTest(function() {
-  assert_throws(null, function() { Object.preventExtensions(C) },
</del><ins>+addTest(function(exception_t) {
+  test_throws(exception_t, new TypeError, function() { Object.preventExtensions(C) },
</ins><span class="cx">                 &quot;preventExtensions on cross-origin Window should throw&quot;);
</span><del>-  assert_throws(null, function() { Object.preventExtensions(C.location) },
</del><ins>+  test_throws(exception_t, new TypeError, function() { Object.preventExtensions(C.location) },
</ins><span class="cx">                 &quot;preventExtensions on cross-origin Location should throw&quot;);
</span><span class="cx"> }, &quot;[[PreventExtensions]] should throw for cross-origin objects&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx">  * [[GetOwnProperty]]
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'close')), &quot;C.close is |own|&quot;);
</span><span class="cx">   assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'top')), &quot;C.top is |own|&quot;);
</span><span class="cx">   assert_true(isObject(Object.getOwnPropertyDescriptor(C.location, 'href')), &quot;C.location.href is |own|&quot;);
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">                   &quot;property descriptor for &quot; + propName + &quot; should &quot; + (expectWritable ? &quot;&quot; : &quot;not &quot;) + &quot;have setter&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   whitelistedWindowProps.forEach(function(prop) {
</span><span class="cx">     var desc = Object.getOwnPropertyDescriptor(C, prop);
</span><span class="cx">     checkPropertyDescriptor(desc, prop, prop == 'location');
</span><span class="lines">@@ -214,39 +214,39 @@
</span><span class="cx"> /*
</span><span class="cx">  * [[Delete]]
</span><span class="cx">  */
</span><del>-addTest(function() {
-  assert_throws(null, function() { delete C[0]; }, &quot;Can't delete cross-origin indexed property&quot;);
-  assert_throws(null, function() { delete C[100]; }, &quot;Can't delete cross-origin indexed property&quot;);
-  assert_throws(null, function() { delete C.location; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.parent; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.length; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.document; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.foopy; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.location.href; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.location.replace; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.location.port; }, &quot;Can't delete cross-origin property&quot;);
-  assert_throws(null, function() { delete C.location.foopy; }, &quot;Can't delete cross-origin property&quot;);
</del><ins>+addTest(function(exception_t) {
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C[0]; }, &quot;Can't delete cross-origin indexed property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C[100]; }, &quot;Can't delete cross-origin indexed property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.location; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.parent; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.length; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.document; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.foopy; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.location.href; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.location.replace; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.location.port; }, &quot;Can't delete cross-origin property&quot;);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { delete C.location.foopy; }, &quot;Can't delete cross-origin property&quot;);
</ins><span class="cx"> }, &quot;[[Delete]] Should throw on cross-origin objects&quot;);
</span><span class="cx"> 
</span><span class="cx"> /*
</span><span class="cx">  * [[DefineOwnProperty]]
</span><span class="cx">  */
</span><del>-function checkDefine(obj, prop) {
</del><ins>+function checkDefine(exception_t, obj, prop) {
</ins><span class="cx">   var valueDesc = { configurable: true, enumerable: false, writable: false, value: 2 };
</span><span class="cx">   var accessorDesc = { configurable: true, enumerable: false, get: function() {} };
</span><del>-  assert_throws(null, function() { Object.defineProperty(obj, prop, valueDesc); }, &quot;Can't define cross-origin value property &quot; + prop);
-  assert_throws(null, function() { Object.defineProperty(obj, prop, accessorDesc); }, &quot;Can't define cross-origin accessor property &quot; + prop);
</del><ins>+  test_throws(exception_t, &quot;SecurityError&quot;, function() { Object.defineProperty(obj, prop, valueDesc); }, &quot;Can't define cross-origin value property &quot; + prop);
+  test_throws(exception_t, &quot;SecurityError&quot;, function() { Object.defineProperty(obj, prop, accessorDesc); }, &quot;Can't define cross-origin accessor property &quot; + prop);
</ins><span class="cx"> }
</span><del>-addTest(function() {
-  checkDefine(C, 'length');
-  checkDefine(C, 'parent');
-  checkDefine(C, 'location');
-  checkDefine(C, 'document');
-  checkDefine(C, 'foopy');
-  checkDefine(C.location, 'href');
-  checkDefine(C.location, 'replace');
-  checkDefine(C.location, 'port');
-  checkDefine(C.location, 'foopy');
</del><ins>+addTest(function(exception_t) {
+  checkDefine(exception_t, C, 'length');
+  checkDefine(exception_t, C, 'parent');
+  checkDefine(exception_t, C, 'location');
+  checkDefine(exception_t, C, 'document');
+  checkDefine(exception_t, C, 'foopy');
+  checkDefine(exception_t, C.location, 'href');
+  checkDefine(exception_t, C.location, 'replace');
+  checkDefine(exception_t, C.location, 'port');
+  checkDefine(exception_t, C.location, 'foopy');
</ins><span class="cx"> }, &quot;[[DefineOwnProperty]] Should throw for cross-origin objects&quot;);
</span><span class="cx"> 
</span><span class="cx"> /*
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">  * [[Enumerate]]
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   for (var prop in C)
</span><span class="cx">     assert_unreached(&quot;Shouldn't have been able to enumerate &quot; + prop + &quot; on cross-origin Window&quot;);
</span><span class="cx">   for (var prop in C.location)
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx">  * [[OwnPropertyKeys]]
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_array_equals(Object.getOwnPropertyNames(C).sort(),
</span><span class="cx">                       whitelistedWindowPropNames,
</span><span class="cx">                       &quot;Object.getOwnPropertyNames() gives the right answer for cross-origin Window&quot;);
</span><span class="lines">@@ -273,7 +273,7 @@
</span><span class="cx">                       &quot;Object.getOwnPropertyNames() gives the right answer for cross-origin Location&quot;);
</span><span class="cx"> }, &quot;[[OwnPropertyKeys]] should return all properties from cross-origin objects&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_array_equals(Object.getOwnPropertySymbols(C), whitelistedSymbols,
</span><span class="cx">     &quot;Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window&quot;);
</span><span class="cx">   assert_array_equals(Object.getOwnPropertySymbols(C.location),
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">     &quot;Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Location&quot;);
</span><span class="cx"> }, &quot;[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   var allWindowProps = Reflect.ownKeys(C);
</span><span class="cx">   indexedWindowProps = allWindowProps.slice(0, whitelistedWindowIndices.length);
</span><span class="cx">   stringWindowProps = allWindowProps.slice(0, -1 * whitelistedSymbols.length);
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">                       &quot;Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Location.&quot;)
</span><span class="cx"> }, &quot;[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_true(B.eval('parent.C') === C, &quot;A and B observe the same identity for C's Window&quot;);
</span><span class="cx">   assert_true(B.eval('parent.C.location') === C.location, &quot;A and B observe the same identity for C's Location&quot;);
</span><span class="cx"> }, &quot;A and B jointly observe the same identity for cross-origin Window and Location&quot;);
</span><span class="lines">@@ -313,12 +313,12 @@
</span><span class="cx">   assert_equals(Object.getPrototypeOf(f), proto, f.name + &quot; has the right prototype&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   checkFunction(C.close, Function.prototype);
</span><span class="cx">   checkFunction(C.location.replace, Function.prototype);
</span><span class="cx"> }, &quot;Cross-origin functions get local Function.prototype&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'parent')),
</span><span class="cx">               &quot;Need to be able to use Object.getOwnPropertyDescriptor do this test&quot;);
</span><span class="cx">   checkFunction(Object.getOwnPropertyDescriptor(C, 'parent').get, Function.prototype);
</span><span class="lines">@@ -325,7 +325,7 @@
</span><span class="cx">   checkFunction(Object.getOwnPropertyDescriptor(C.location, 'href').set, Function.prototype);
</span><span class="cx"> }, &quot;Cross-origin Window accessors get local Function.prototype&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   checkFunction(close, Function.prototype);
</span><span class="cx">   assert_true(close != B.close, 'same-origin Window functions get their own object');
</span><span class="cx">   assert_true(close != C.close, 'cross-origin Window functions get their own object');
</span><span class="lines">@@ -341,7 +341,7 @@
</span><span class="cx">   checkFunction(replace_B, B.Function.prototype);
</span><span class="cx"> }, &quot;Same-origin observers get different functions for cross-origin objects&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_true(isObject(Object.getOwnPropertyDescriptor(C, 'parent')),
</span><span class="cx">               &quot;Need to be able to use Object.getOwnPropertyDescriptor do this test&quot;);
</span><span class="cx">   var get_self_parent = Object.getOwnPropertyDescriptor(window, 'parent').get;
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx">   checkFunction(get_parent_B, B.Function.prototype);
</span><span class="cx"> }, &quot;Same-origin observers get different accessors for cross-origin Window&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   var set_self_href = Object.getOwnPropertyDescriptor(window.location, 'href').set;
</span><span class="cx">   var set_href_A = Object.getOwnPropertyDescriptor(C.location, 'href').set;
</span><span class="cx">   var set_href_B = B.eval('Object.getOwnPropertyDescriptor(parent.C.location, &quot;href&quot;).set');
</span><span class="lines">@@ -365,17 +365,39 @@
</span><span class="cx">   checkFunction(set_href_B, B.Function.prototype);
</span><span class="cx"> }, &quot;Same-origin observers get different accessors for cross-origin Location&quot;);
</span><span class="cx"> 
</span><del>-addTest(function() {
</del><ins>+addTest(function(exception_t) {
</ins><span class="cx">   assert_equals({}.toString.call(C), &quot;[object Object]&quot;);
</span><span class="cx">   assert_equals({}.toString.call(C.location), &quot;[object Object]&quot;);
</span><span class="cx"> }, &quot;{}.toString.call() does the right thing on cross-origin objects&quot;);
</span><span class="cx"> 
</span><ins>+// Separate test for throwing at all and throwing the right exception type
+// so that we can test that all implementations could pass while implementing
+// the observables that are actually important for security and interop, so
+// they would notice if they ever regressed them.
+function test_throws(exception_t, code, func, description) {
+  assert_throws(null, func, description);
+  exception_t.step(function() {
+    assert_throws(code, func, description);
+  });
+}
+
</ins><span class="cx"> // We do a fresh load of the subframes for each test to minimize side-effects.
</span><span class="cx"> // It would be nice to reload ourselves as well, but we can't do that without
</span><span class="cx"> // disrupting the test harness.
</span><span class="cx"> function runNextTest() {
</span><span class="cx">   var entry = testList.shift();
</span><del>-  test(entry[0], entry[1]);
</del><ins>+  var fun = entry[0];
+  var desc = entry[1];
+  var main_t = async_test(desc);
+  var exception_t = async_test(desc + ' (exception type)');
+  main_t.add_cleanup(function() {
+    exception_t.unreached_func('Main test failed')();
+  });
+  main_t.step(function() {
+    fun(exception_t);
+  });
+  exception_t.done();
+  main_t.done();
</ins><span class="cx">   if (testList.length != 0)
</span><span class="cx">     reloadSubframes(runNextTest);
</span><span class="cx">   else
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectsframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-  &lt;!--  Two subframes to give us some indexed properties  --&gt;
</del><ins>+  &lt;!-- Two subframes to give us some indexed properties --&gt;
</ins><span class="cx">   &lt;iframe&gt;&lt;/iframe&gt;
</span><span class="cx">   &lt;iframe&gt;&lt;/iframe&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsersorigincrossoriginobjectsw3cimportlog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log (211731 => 211732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log        2017-02-06 17:36:15 UTC (rev 211731)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log        2017-02-06 17:47:02 UTC (rev 211732)
</span><span class="lines">@@ -15,7 +15,6 @@
</span><span class="cx"> None
</span><span class="cx"> ------------------------------------------------------------------------
</span><span class="cx"> List of files:
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html
</del><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html
</span></span></pre>
</div>
</div>

</body>
</html>