Bug 1635593 [wpt PR 23409] - Fix testharness.js's assert_object_equals error message, a=testonly
authorOriol Brufau <obrufau@igalia.com>
Wed, 13 May 2020 09:42:25 +0000
changeset 531088 1224006b0542d1571943252f4f5758e836e5af40
parent 531087 d22e7a4d2fab84ae707c11eff1e66f7ca0c6125c
child 531089 5256c0243c5190f2eae7d8ed816e63b94631a6c6
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1635593, 23409, 2181322, 765713
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1635593 [wpt PR 23409] - Fix testharness.js's assert_object_equals error message, a=testonly Automatic update from web-platform-tests Fix testharness.js's assert_object_equals error message When using assert_object_equals, if the two objects have the same property but with different values, then the error message used to say that the actual and expected values of the property were the root objects themselves. This patch fixes it so that the error message references the actual and expected value of the property. Change-Id: If9e6a5445db13444e22fd58729614c8c73046aea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2181322 Commit-Queue: Oriol Brufau <obrufau@igalia.com> Reviewed-by: Philip J├Ągenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#765713} -- wpt-commits: 027bdebf6a3052d664903d4488170a16419837ef wpt-pr: 23409
testing/web-platform/tests/resources/testharness.js
--- a/testing/web-platform/tests/resources/testharness.js
+++ b/testing/web-platform/tests/resources/testharness.js
@@ -1207,17 +1207,17 @@ policies and contribution forms [3].
 
                  if (typeof actual[p] === "object" && actual[p] !== null) {
                      if (stack.indexOf(actual[p]) === -1) {
                          check_equal(actual[p], expected[p], stack);
                      }
                  } else {
                      assert(same_value(actual[p], expected[p]), "assert_object_equals", description,
                                                        "property ${p} expected ${expected} got ${actual}",
-                                                       {p:p, expected:expected, actual:actual});
+                                                       {p:p, expected:expected[p], actual:actual[p]});
                  }
              }
              for (p in expected) {
                  assert(actual.hasOwnProperty(p),
                         "assert_object_equals", description,
                         "expected property ${p} missing", {p:p});
              }
              stack.pop();