| Index: third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html
|
| diff --git a/third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html b/third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html
|
| index 322497f8265bdf93368839c318b5a1d1ce5673ea..de10c19350f635559985924aa5ac77180e2540e4 100644
|
| --- a/third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html
|
| +++ b/third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html
|
| @@ -1,21 +1,31 @@
|
| <!DOCTYPE html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +
|
| <div id="root"></div>
|
| -<script src="../resources/js-test.js"></script>
|
| -<script>
|
| - description("Test for observer attribute getters.");
|
| - var rootDiv = document.getElementById("root");
|
|
|
| +<script>
|
| +test(function() {
|
| var observer = new IntersectionObserver(function(e) {}, {});
|
| - shouldBeNull("observer.root");
|
| - shouldBe("observer.thresholds", "[0]");
|
| - shouldBeEqualToString("observer.rootMargin", "0px 0px 0px 0px");
|
| + test(function() { assert_true(observer.root === null) },
|
| + "observer.root === null");
|
| + test(function() { assert_array_equals(observer.thresholds, [0]) },
|
| + "observer.thresholds == [0]");
|
| + test(function() { assert_equals(observer.rootMargin, "0px 0px 0px 0px") },
|
| + "observer.rootMargin == '0px 0px 0px 0px'");
|
|
|
| + var rootDiv = document.getElementById("root");
|
| observer = new IntersectionObserver(function(e) {}, {
|
| root: rootDiv,
|
| threshold: [0, 0.25, 0.5, 1.0],
|
| rootMargin: "10% 20px"
|
| });
|
| - shouldBe("observer.root", "rootDiv");
|
| - shouldBe("observer.thresholds", "[0, 0.25, 0.5, 1.0]");
|
| - shouldBeEqualToString("observer.rootMargin", "10% 20px 10% 20px");
|
| + test(function() { assert_true(observer.root === rootDiv) },
|
| + "observer.root === rootDiv");
|
| + test(function() { assert_array_equals(observer.thresholds, [0, 0.25, 0.5, 1.0]) },
|
| + "observer.thresholds == [0, 0.25, 0.5, 1.0]");
|
| + test(function() { assert_equals(observer.rootMargin, "10% 20px 10% 20px") },
|
| + "observer.rootMargin == '10% 20px 10% 20px'");
|
| +}, "Test for observer attribute getters.");
|
| +
|
| </script>
|
|
|