| Index: LayoutTests/http/tests/resources/testharness-helpers.js
|
| diff --git a/LayoutTests/http/tests/resources/testharness-helpers.js b/LayoutTests/http/tests/resources/testharness-helpers.js
|
| index a8322d0cbfdfa8d2e8cf62de94810523ecb40ad7..12960e30ac8ce9423dc11c7bea9841cec950f012 100644
|
| --- a/LayoutTests/http/tests/resources/testharness-helpers.js
|
| +++ b/LayoutTests/http/tests/resources/testharness-helpers.js
|
| @@ -32,78 +32,6 @@ function assert_promise_rejects(promise, code, description) {
|
| });
|
| }
|
|
|
| -// Equivalent to testharness.js's assert_object_equals(), but correctly
|
| -// tests that property ownership is the same.
|
| -// TODO(jsbell): Upstream this to assert_object_equals and remove.
|
| -function assert_object_equals_fixed(actual, expected, description)
|
| -{
|
| - function check_equal(actual, expected, stack)
|
| - {
|
| - stack.push(actual);
|
| - var p;
|
| - for (p in actual) {
|
| - assert_equals(expected.hasOwnProperty(p), actual.hasOwnProperty(p),
|
| - "different property ownership: " + p + " - " + description);
|
| -
|
| - if (typeof actual[p] === "object" && actual[p] !== null) {
|
| - if (stack.indexOf(actual[p]) === -1) {
|
| - check_equal(actual[p], expected[p], stack);
|
| - }
|
| - } else {
|
| - assert_equals(actual[p], expected[p], description);
|
| - }
|
| - }
|
| - for (p in expected) {
|
| - assert_equals(expected.hasOwnProperty(p), actual.hasOwnProperty(p),
|
| - "different property ownership: " + p + " - " + description);
|
| - }
|
| - stack.pop();
|
| - }
|
| - check_equal(actual, expected, []);
|
| -}
|
| -
|
| -// Equivalent to assert_in_array, but uses the object-aware equivalence relation
|
| -// provided by assert_object_equals_fixed().
|
| -function assert_object_in_array(actual, expected_array, description) {
|
| - assert_true(expected_array.some(function(element) {
|
| - try {
|
| - assert_object_equals_fixed(actual, element);
|
| - return true;
|
| - } catch (e) {
|
| - return false;
|
| - }
|
| - }), description);
|
| -}
|
| -
|
| -// Assert that the two arrays |actual| and |expected| contain the same set of
|
| -// elements as determined by assert_object_equals_fixed. The order is not significant.
|
| -//
|
| -// |expected| is assumed to not contain any duplicates as determined by
|
| -// assert_object_equals_fixed().
|
| -function assert_array_equivalent(actual, expected, description) {
|
| - assert_true(Array.isArray(actual), description);
|
| - assert_equals(actual.length, expected.length, description);
|
| - expected.forEach(function(expected_element) {
|
| - // assert_in_array treats the first argument as being 'actual', and the
|
| - // second as being 'expected array'. We are switching them around because
|
| - // we want to be resilient against the |actual| array containing
|
| - // duplicates.
|
| - assert_object_in_array(expected_element, actual, description);
|
| - });
|
| -}
|
| -
|
| -// Asserts that two arrays |actual| and |expected| contain the same set of
|
| -// elements as determined by assert_object_equals(). The corresponding elements
|
| -// must occupy corresponding indices in their respective arrays.
|
| -function assert_array_objects_equals(actual, expected, description) {
|
| - assert_true(Array.isArray(actual), description);
|
| - assert_equals(actual.length, expected.length, description);
|
| - actual.forEach(function(value, index) {
|
| - assert_object_equals(value, expected[index],
|
| - description + ' : object[' + index + ']');
|
| - });
|
| -}
|
| -
|
| // Asserts that |object| that is an instance of some interface has the attribute
|
| // |attribute_name| following the conditions specified by WebIDL, but it's
|
| // acceptable that the attribute |attribute_name| is an own property of the
|
|
|