OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <script> | 5 <script> |
6 test(function () { | 6 test(function () { |
7 assert_throws(RangeError(), function() { | 7 assert_throws(RangeError(), function() { |
8 new IntersectionObserver(e => {}, {threshold: [1.1]}) | 8 new IntersectionObserver(e => {}, {threshold: [1.1]}) |
9 }) | 9 }) |
10 }, "IntersectionObserver constructor with { threshold: [1.1] }"); | 10 }, "IntersectionObserver constructor with { threshold: [1.1] }"); |
11 | 11 |
12 test(function () { | 12 test(function () { |
13 assert_throws(RangeError(), function() { | 13 assert_throws(TypeError(), function() { |
14 new IntersectionObserver(e => {}, {threshold: ["foo"]}) | 14 new IntersectionObserver(e => {}, {threshold: ["foo"]}) |
15 }) | 15 }) |
16 }, 'IntersectionObserver constructor with { threshold: ["foo"] }'); | 16 }, 'IntersectionObserver constructor with { threshold: ["foo"] }'); |
17 | 17 |
18 test(function () { | 18 test(function () { |
19 assert_throws("SYNTAX_ERR", function() { | 19 assert_throws("SYNTAX_ERR", function() { |
20 new IntersectionObserver(e => {}, {rootMargin: "1"}) | 20 new IntersectionObserver(e => {}, {rootMargin: "1"}) |
21 }) | 21 }) |
22 }, 'IntersectionObserver constructor witth { rootMargin: "1" }'); | 22 }, 'IntersectionObserver constructor witth { rootMargin: "1" }'); |
23 | 23 |
(...skipping 15 matching lines...) Expand all Loading... |
39 }) | 39 }) |
40 }, 'IntersectionObserver constructor with { rootMargin: "1px 1px 1px 1px 1px" }'
); | 40 }, 'IntersectionObserver constructor with { rootMargin: "1px 1px 1px 1px 1px" }'
); |
41 | 41 |
42 test(function () { | 42 test(function () { |
43 assert_throws(TypeError(), function() { | 43 assert_throws(TypeError(), function() { |
44 let observer = new IntersectionObserver(c => {}, {}); | 44 let observer = new IntersectionObserver(c => {}, {}); |
45 observer.observe("foo"); | 45 observer.observe("foo"); |
46 }) | 46 }) |
47 }, 'IntersectionObserver.observe("foo")'); | 47 }, 'IntersectionObserver.observe("foo")'); |
48 </script> | 48 </script> |
OLD | NEW |