Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cross-origin-objects.html and cross-origin-objects-exceptions.html #4690

Merged
merged 2 commits into from
Feb 6, 2017

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Feb 1, 2017

See #4662 (comment)

The exception type check is tested in a separate subtest, but it is
now in the same file so we don't get out of sync.


I changed cross-origin-objects.html and removed cross-origin-objects-exceptions.html; it's unclear to me if there was some change for the latter that was not in the former, that we want to keep?

cc @cdumez @bzbarsky @domenic

@zcorpan zcorpan force-pushed the zcorpan/merge-cross-origin-objects-tests branch from f6f856a to 2d5074b Compare February 1, 2017 09:30
@wpt-pr-bot wpt-pr-bot added the html label Feb 1, 2017
@wpt-stability-bot
Copy link

wpt-stability-bot commented Feb 1, 2017

Chrome (unstable channel)

Testing web-platform-tests at revision dfab1c2
Using browser at version 57.0.2987.19 dev
Starting 10 test iterations
All results were stable

All results

/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
Subtest Results
OK
{}.toString.call() does the right thing on cross-origin objects FAIL
Same-origin observers get different accessors for cross-origin Window FAIL
[[PreventExtensions]] should throw for cross-origin objects (exception type) FAIL
[[IsExtensible]] should return true for cross-origin objects (exception type) PASS
[[Enumerate]] should return an empty iterator (exception type) PASS
[[Delete]] Should throw on cross-origin objects (exception type) PASS
[[OwnPropertyKeys]] should return all properties from cross-origin objects FAIL
[[GetPrototypeOf]] should return null PASS
Only whitelisted properties are accessible cross-origin (exception type) PASS
[[DefineOwnProperty]] Should throw for cross-origin objects (exception type) PASS
Same-origin observers get different accessors for cross-origin Location (exception type) FAIL
[[GetPrototypeOf]] should return null (exception type) PASS
[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly (exception type) FAIL
[[OwnPropertyKeys]] should return all properties from cross-origin objects (exception type) FAIL
[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly FAIL
Same-origin observers get different functions for cross-origin objects (exception type) FAIL
Cross-origin Window accessors get local Function.prototype FAIL
Same-origin observers get different functions for cross-origin objects FAIL
A and B jointly observe the same identity for cross-origin Window and Location PASS
Cross-origin Window accessors get local Function.prototype (exception type) FAIL
[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices FAIL
A and B jointly observe the same identity for cross-origin Window and Location (exception type) PASS
[[IsExtensible]] should return true for cross-origin objects PASS
Basic sanity-checking (exception type) PASS
Only whitelisted properties are accessible cross-origin PASS
[[Enumerate]] should return an empty iterator PASS
`[[GetOwnProperty]] - Properties on cross-origin objects should be reported own
[[PreventExtensions]] should throw for cross-origin objects PASS
Same-origin observers get different accessors for cross-origin Location FAIL
`[[GetOwnProperty]] - Properties on cross-origin objects should be reported own
Cross-origin functions get local Function.prototype PASS
[[DefineOwnProperty]] Should throw for cross-origin objects PASS
[[SetPrototypeOf]] should throw PASS
Same-origin observers get different accessors for cross-origin Window (exception type) FAIL
Basic sanity-checking PASS
[[Delete]] Should throw on cross-origin objects PASS
Cross-origin functions get local Function.prototype (exception type) PASS
[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects FAIL
{}.toString.call() does the right thing on cross-origin objects (exception type) FAIL
[[SetPrototypeOf]] should throw (exception type) FAIL
[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects (exception type) FAIL
[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices (exception type) FAIL

@wpt-stability-bot
Copy link

wpt-stability-bot commented Feb 1, 2017

Firefox (nightly channel)

Testing web-platform-tests at revision dfab1c2
Using browser at version BuildID 20170123125947; SourceStamp 36486fdc3813ef7943ae5b07b4128866d1938a6c
Starting 10 test iterations
All results were stable

All results

/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
Subtest Results
OK
{}.toString.call() does the right thing on cross-origin objects PASS
Same-origin observers get different accessors for cross-origin Window PASS
[[PreventExtensions]] should throw for cross-origin objects (exception type) PASS
[[IsExtensible]] should return true for cross-origin objects (exception type) PASS
[[Enumerate]] should return an empty iterator (exception type) PASS
[[Delete]] Should throw on cross-origin objects (exception type) FAIL
[[OwnPropertyKeys]] should return all properties from cross-origin objects PASS
[[GetPrototypeOf]] should return null PASS
Only whitelisted properties are accessible cross-origin (exception type) FAIL
[[DefineOwnProperty]] Should throw for cross-origin objects (exception type) FAIL
Same-origin observers get different accessors for cross-origin Location (exception type) PASS
[[GetPrototypeOf]] should return null (exception type) FAIL
[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly (exception type) PASS
[[OwnPropertyKeys]] should return all properties from cross-origin objects (exception type) PASS
[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly PASS
Same-origin observers get different functions for cross-origin objects (exception type) PASS
Cross-origin Window accessors get local Function.prototype PASS
Same-origin observers get different functions for cross-origin objects PASS
A and B jointly observe the same identity for cross-origin Window and Location PASS
Cross-origin Window accessors get local Function.prototype (exception type) PASS
[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices PASS
A and B jointly observe the same identity for cross-origin Window and Location (exception type) PASS
[[IsExtensible]] should return true for cross-origin objects PASS
Basic sanity-checking (exception type) FAIL
Only whitelisted properties are accessible cross-origin PASS
[[Enumerate]] should return an empty iterator PASS
`[[GetOwnProperty]] - Properties on cross-origin objects should be reported own
[[PreventExtensions]] should throw for cross-origin objects PASS
Same-origin observers get different accessors for cross-origin Location PASS
`[[GetOwnProperty]] - Properties on cross-origin objects should be reported own
Cross-origin functions get local Function.prototype PASS
[[DefineOwnProperty]] Should throw for cross-origin objects PASS
[[SetPrototypeOf]] should throw PASS
Same-origin observers get different accessors for cross-origin Window (exception type) PASS
Basic sanity-checking PASS
[[Delete]] Should throw on cross-origin objects PASS
Cross-origin functions get local Function.prototype (exception type) PASS
[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects PASS
{}.toString.call() does the right thing on cross-origin objects (exception type) PASS
[[SetPrototypeOf]] should throw (exception type) FAIL
[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects (exception type) PASS
[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices (exception type) PASS

"preventExtensions on cross-origin Window should throw");
assert_throws(null, function() { Object.preventExtensions(C.location) },
test_throws(exception_t, "SecurityError", function() { Object.preventExtensions(C.location) },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be new TypeError, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yes. Fixed now.

@bzbarsky
Copy link
Contributor

bzbarsky commented Feb 1, 2017

it's unclear to me if there was some change for the latter that was not in the former

There really shouldn't have been. Worth checking the diff between the two before the most recent changes to cross-origin-objects.html.

Thank you for doing this. This is much more maintainable...

@zcorpan
Copy link
Member Author

zcorpan commented Feb 2, 2017

The diff between cross-origin-objects.html and cross-origin-objects-exceptions.html on current master:

Simons-MacBook-Pro:web-platform-tests zcorpan$ git checkout master
M	resources
M	tools
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Simons-MacBook-Pro:web-platform-tests zcorpan$ mv html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html html/browsers/origin/cross-origin-objects/cross-origin-objects.html
Simons-MacBook-Pro:web-platform-tests zcorpan$ git diff html/browsers/origin/cross-origin-objects/cross-origin-objects.html
diff --git a/html/browsers/origin/cross-origin-objects/cross-origin-objects.html b/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
index 7560fcd..58c362a 100644
--- a/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
+++ b/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
@@ -1,3 +1,5 @@
+<!-- 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. -->
 <!doctype html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">
@@ -12,7 +14,6 @@
 <iframe id="B"></iframe>
 <iframe id="C"></iframe>
 <script>
-
 /*
  * Setup boilerplate. This gives us a same-origin window "B" and a cross-origin
  * window "C".
@@ -59,7 +60,7 @@ addTest(function() {
   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");
-  assert_throws(null, function() { C.location.pathname; }, "location.pathname throws cross-origin");
+  assert_throws("SecurityError", function() { C.location.pathname; }, "location.pathname throws cross-origin");
   assert_equals(B.frames, 'override', "Overrides visible in the same-origin case");
   assert_equals(C.frames, C, "Overrides invisible in the cross-origin case");
 }, "Basic sanity-checking");
@@ -71,31 +72,26 @@ addTest(function() {
  */
 
 var whitelistedWindowIndices = ['0', '1'];
-var whitelistedWindowPropNames = ['location', 'postMessage', 'window', 'frames', 'self', 'top', 'parent',
-                                  'opener', 'closed', 'close', 'blur', 'focus', 'length'];
-whitelistedWindowPropNames = whitelistedWindowPropNames.concat(whitelistedWindowIndices);
-whitelistedWindowPropNames.sort();
-var whitelistedLocationPropNames = ['href', 'replace'];
-whitelistedLocationPropNames.sort();
-var whitelistedSymbols = [Symbol.toStringTag, Symbol.hasInstance,
-                          Symbol.isConcatSpreadable];
-var whitelistedWindowProps = whitelistedWindowPropNames.concat(whitelistedSymbols);
+var whitelistedWindowProps = ['location', 'postMessage', 'window', 'frames', 'self', 'top', 'parent',
+                              'opener', 'closed', 'close', 'blur', 'focus', 'length'];
+whitelistedWindowProps = whitelistedWindowProps.concat(whitelistedWindowIndices);
+whitelistedWindowProps.sort();
 
 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), "hasOwnProperty for " + String(prop));
+      assert_true(Object.prototype.hasOwnProperty.call(C, prop), "hasOwnProperty for " + prop);
     } else {
-      assert_throws(null, function() { C[prop]; }, "Should throw when accessing " + String(prop) + " on Window");
-      assert_throws(null, function() { Object.getOwnPropertyDescriptor(C, prop); },
+      assert_throws("SecurityError", function() { C[prop]; }, "Should throw when accessing " + prop + " on Window");
+      assert_throws("SecurityError", function() { Object.getOwnPropertyDescriptor(C, prop); },
                     "Should throw when accessing property descriptor for " + prop + " on Window");
-      assert_throws(null, function() { Object.prototype.hasOwnProperty.call(C, prop); },
+      assert_throws("SecurityError", function() { Object.prototype.hasOwnProperty.call(C, prop); },
                     "Should throw when invoking hasOwnProperty for " + prop + " on Window");
     }
     if (prop != 'location')
-      assert_throws(null, function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Window");
+      assert_throws("SecurityError", function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Window");
   }
   for (var prop in location) {
     if (prop == 'replace') {
@@ -104,14 +100,14 @@ addTest(function() {
       assert_true(Object.prototype.hasOwnProperty.call(C.location, prop), "hasOwnProperty for " + prop);
     }
     else {
-      assert_throws(null, function() { C[prop]; }, "Should throw when accessing " + prop + " on Location");
-      assert_throws(null, function() { Object.getOwnPropertyDescriptor(C, prop); },
+      assert_throws("SecurityError", function() { C[prop]; }, "Should throw when accessing " + prop + " on Location");
+      assert_throws("SecurityError", function() { Object.getOwnPropertyDescriptor(C, prop); },
                     "Should throw when accessing property descriptor for " + prop + " on Location");
-      assert_throws(null, function() { Object.prototype.hasOwnProperty.call(C, prop); },
+      assert_throws("SecurityError", function() { Object.prototype.hasOwnProperty.call(C, prop); },
                     "Should throw when invoking hasOwnProperty for " + prop + " on Location");
     }
     if (prop != 'href')
-      assert_throws(null, function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
+      assert_throws("SecurityError", function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
   }
 }, "Only whitelisted properties are accessible cross-origin");
 
@@ -128,8 +124,8 @@ addTest(function() {
   var protoGetter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').get;
   assert_true(protoGetter.call(C) === null, "cross-origin Window proto is null");
   assert_true(protoGetter.call(C.location) === null, "cross-origin Location proto is null (__proto__)");
-  assert_throws(null, function() { C.__proto__; }, "__proto__ property not available cross-origin");
-  assert_throws(null, function() { C.location.__proto__; }, "__proto__ property not available cross-origin");
+  assert_throws("SecurityError", function() { C.__proto__; }, "__proto__ property not available cross-origin");
+  assert_throws("SecurityError", function() { C.location.__proto__; }, "__proto__ property not available cross-origin");
 
 }, "[[GetPrototypeOf]] should return null");
 
@@ -137,14 +133,14 @@ addTest(function() {
  * [[SetPrototypeOf]]
  */
 addTest(function() {
-  assert_throws(null, function() { C.__proto__ = new Object(); }, "proto set on cross-origin Window");
-  assert_throws(null, function() { C.location.__proto__ = new Object(); }, "proto set on cross-origin Location");
+  assert_throws("SecurityError", function() { C.__proto__ = new Object(); }, "proto set on cross-origin Window");
+  assert_throws("SecurityError", function() { C.location.__proto__ = new Object(); }, "proto set on cross-origin Location");
   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(null, function() { protoSetter.call(C, new Object()); }, "proto setter |call| on cross-origin Window");
-    assert_throws(null, function() { protoSetter.call(C.location, new Object()); }, "proto setter |call| on cross-origin Location");
+    assert_throws(new TypeError, function() { protoSetter.call(C, new Object()); }, "proto setter |call| on cross-origin Window");
+    assert_throws(new TypeError, function() { protoSetter.call(C.location, new Object()); }, "proto setter |call| on cross-origin Location");
   });
 }, "[[SetPrototypeOf]] should throw");
 
@@ -160,9 +156,9 @@ addTest(function() {
  * [[PreventExtensions]]
  */
 addTest(function() {
-  assert_throws(null, function() { Object.preventExtensions(C) },
+  assert_throws(new TypeError, function() { Object.preventExtensions(C) },
                 "preventExtensions on cross-origin Window should throw");
-  assert_throws(null, function() { Object.preventExtensions(C.location) },
+  assert_throws(new TypeError, function() { Object.preventExtensions(C.location) },
                 "preventExtensions on cross-origin Location should throw");
 }, "[[PreventExtensions]] should throw for cross-origin objects");
 
@@ -178,18 +174,9 @@ addTest(function() {
 }, "[[GetOwnProperty]] - Properties on cross-origin objects should be reported |own|");
 
 function checkPropertyDescriptor(desc, propName, expectWritable) {
-  var isSymbol = (typeof(propName) == "symbol");
-  propName = String(propName);
   assert_true(isObject(desc), "property descriptor for " + propName + " should exist");
   assert_equals(desc.enumerable, false, "property descriptor for " + propName + " should be non-enumerable");
   assert_equals(desc.configurable, true, "property descriptor for " + propName + " should be configurable");
-  if (isSymbol) {
-    assert_true("value" in desc,
-                "property descriptor for " + propName + " should be a value descriptor");
-    assert_equals(desc.value, undefined,
-                  "symbol-named cross-origin visible prop " + propName +
-                  " should come back as undefined");
-  }
   if ('value' in desc)
     assert_equals(desc.writable, expectWritable, "property descriptor for " + propName + " should have writable: " + expectWritable);
   else
@@ -205,27 +192,23 @@ addTest(function() {
   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', "Cross-origin location should have no href getter");
-  whitelistedSymbols.forEach(function(prop) {
-    var desc = Object.getOwnPropertyDescriptor(C.location, prop);
-    checkPropertyDescriptor(desc, prop, false);
-  });
 }, "[[GetOwnProperty]] - Property descriptors for cross-origin properties should be set up correctly");
 
 /*
  * [[Delete]]
  */
 addTest(function() {
-  assert_throws(null, function() { delete C[0]; }, "Can't delete cross-origin indexed property");
-  assert_throws(null, function() { delete C[100]; }, "Can't delete cross-origin indexed property");
-  assert_throws(null, function() { delete C.location; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.parent; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.length; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.document; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.foopy; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.location.href; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.location.replace; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.location.port; }, "Can't delete cross-origin property");
-  assert_throws(null, function() { delete C.location.foopy; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C[0]; }, "Can't delete cross-origin indexed property");
+  assert_throws("SecurityError", function() { delete C[100]; }, "Can't delete cross-origin indexed property");
+  assert_throws("SecurityError", function() { delete C.location; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.parent; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.length; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.document; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.foopy; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.location.href; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.location.replace; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.location.port; }, "Can't delete cross-origin property");
+  assert_throws("SecurityError", function() { delete C.location.foopy; }, "Can't delete cross-origin property");
 }, "[[Delete]] Should throw on cross-origin objects");
 
 /*
@@ -234,8 +217,8 @@ addTest(function() {
 function checkDefine(obj, prop) {
   var valueDesc = { configurable: true, enumerable: false, writable: false, value: 2 };
   var accessorDesc = { configurable: true, enumerable: false, get: function() {} };
-  assert_throws(null, function() { Object.defineProperty(obj, prop, valueDesc); }, "Can't define cross-origin value property " + prop);
-  assert_throws(null, function() { Object.defineProperty(obj, prop, accessorDesc); }, "Can't define cross-origin accessor property " + prop);
+  assert_throws("SecurityError", function() { Object.defineProperty(obj, prop, valueDesc); }, "Can't define cross-origin value property " + prop);
+  assert_throws("SecurityError", function() { Object.defineProperty(obj, prop, accessorDesc); }, "Can't define cross-origin accessor property " + prop);
 }
 addTest(function() {
   checkDefine(C, 'length');
@@ -265,44 +248,13 @@ addTest(function() {
  */
 
 addTest(function() {
-  assert_array_equals(Object.getOwnPropertyNames(C).sort(),
-                      whitelistedWindowPropNames,
+  assert_array_equals(Object.getOwnPropertyNames(C).sort(), whitelistedWindowProps.sort(),
                       "Object.getOwnPropertyNames() gives the right answer for cross-origin Window");
-  assert_array_equals(Object.getOwnPropertyNames(C.location).sort(),
-                      whitelistedLocationPropNames,
+  assert_array_equals(Object.getOwnPropertyNames(C.location).sort(), ['href', 'replace'],
                       "Object.getOwnPropertyNames() gives the right answer for cross-origin Location");
 }, "[[OwnPropertyKeys]] should return all properties from cross-origin objects");
 
 addTest(function() {
-  assert_array_equals(Object.getOwnPropertySymbols(C), whitelistedSymbols,
-    "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window");
-  assert_array_equals(Object.getOwnPropertySymbols(C.location),
-                      whitelistedSymbols,
-    "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Location");
-}, "[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects");
-
-addTest(function() {
-  var allWindowProps = Reflect.ownKeys(C);
-  indexedWindowProps = allWindowProps.slice(0, whitelistedWindowIndices.length);
-  stringWindowProps = allWindowProps.slice(0, -1 * whitelistedSymbols.length);
-  symbolWindowProps = allWindowProps.slice(-1 * whitelistedSymbols.length);
-  assert_array_equals(indexedWindowProps, whitelistedWindowIndices,
-                      "Reflect.ownKeys should start with the indices exposed on the cross-origin window.");
-  assert_array_equals(stringWindowProps.sort(), whitelistedWindowPropNames,
-                      "Reflect.ownKeys should continue with the cross-origin window properties for a cross-origin Window.");
-  assert_array_equals(symbolWindowProps, whitelistedSymbols,
-                      "Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Window.");
-
-  var allLocationProps = Reflect.ownKeys(C.location);
-  stringLocationProps = allLocationProps.slice(0, -1 * whitelistedSymbols.length);
-  symbolLocationProps = allLocationProps.slice(-1 * whitelistedSymbols.length);
-  assert_array_equals(stringLocationProps.sort(), whitelistedLocationPropNames,
-                      "Reflect.ownKeys should start with the cross-origin window properties for a cross-origin Location.")
-  assert_array_equals(symbolLocationProps, whitelistedSymbols,
-                      "Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Location.")
-}, "[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices");
-
-addTest(function() {
   assert_true(B.eval('parent.C') === C, "A and B observe the same identity for C's Window");
   assert_true(B.eval('parent.C.location') === C.location, "A and B observe the same identity for C's Location");
 }, "A and B jointly observe the same identity for cross-origin Window and Location");
@@ -365,11 +317,6 @@ addTest(function() {
   checkFunction(set_href_B, B.Function.prototype);
 }, "Same-origin observers get different accessors for cross-origin Location");
 
-addTest(function() {
-  assert_equals({}.toString.call(C), "[object Object]");
-  assert_equals({}.toString.call(C.location), "[object Object]");
-}, "{}.toString.call() does the right thing on cross-origin objects");
-
 // 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.

var whitelistedWindowProps = ['location', 'postMessage', 'window', 'frames', 'self', 'top', 'parent',
'opener', 'closed', 'close', 'blur', 'focus', 'length'];
whitelistedWindowProps = whitelistedWindowProps.concat(whitelistedWindowIndices);
whitelistedWindowProps.sort();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...no, sorry. This is actually whitelistedWindowPropNames. Sorting the symbols throws.

See #4662 (comment)

The exception type check is tested in a separate subtest, but it is
now in the same file so we don't get out of sync.
@bzbarsky
Copy link
Contributor

bzbarsky commented Feb 3, 2017

This looks good to me.

@cdumez
Copy link
Contributor

cdumez commented Feb 3, 2017

Looks fine to me too. Thanks for working on this.

@cdumez
Copy link
Contributor

cdumez commented Feb 3, 2017

I'll start aligning WebKit as soon as this lands.

@wpt-pr-bot
Copy link
Collaborator

@zcorpan zcorpan merged commit 12cb8d1 into master Feb 6, 2017
@zcorpan zcorpan deleted the zcorpan/merge-cross-origin-objects-tests branch February 6, 2017 15:08
@zcorpan
Copy link
Member Author

zcorpan commented Feb 6, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants