Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/observer-attributes.html

Issue 2560253004: IntersectionObserver: convert tests to testharness.js (Closed)
Patch Set: Address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..53f6acca5611119d833e915d224cd105a95b1a21 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_equals(observer.root, null) },
+ "observer.root");
+ test(function() { assert_array_equals(observer.thresholds, [0]) },
+ "observer.thresholds");
+ test(function() { assert_equals(observer.rootMargin, "0px 0px 0px 0px") },
+ "observer.rootMargin");
+ 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_equals(observer.root, rootDiv) },
+ "observer.root");
+ test(function() { assert_array_equals(observer.thresholds, [0, 0.25, 0.5, 1.0]) },
+ "observer.thresholds");
+ test(function() { assert_equals(observer.rootMargin, "10% 20px 10% 20px") },
+ "observer.rootMargin");
+}, "Observer attribute getters.");
+
</script>

Powered by Google App Engine
This is Rietveld 408576698