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

Side by Side Diff: third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html

Issue 2132863002: IntersectionObserver: check threshold parameters for NaN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <div id="root"></div> 2 <div id="root"></div>
3 <div id="target"></div> 3 <div id="target"></div>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script src="../resources/gc.js"></script> 5 <script src="../resources/gc.js"></script>
6 <script> 6 <script>
7 description("Test for observer exceptions."); 7 description("Test for observer exceptions.");
8 var exc; 8 var exc;
9 9
10 try { 10 try {
11 new IntersectionObserver(e => {}, {threshold: [1.1]}); 11 new IntersectionObserver(e => {}, {threshold: [1.1]});
12 testFailed("IntersectionObserver constructor did not throw due to invalid th reshold."); 12 testFailed("IntersectionObserver constructor did not throw due to invalid th reshold.");
13 } catch(e) { 13 } catch(e) {
14 exc = e; 14 exc = e;
15 shouldBeType("exc", "RangeError"); 15 shouldBeType("exc", "RangeError");
16 } 16 }
17 17
18 try { 18 try {
19 new IntersectionObserver(e => {}, {threshold: ["foo"]});
20 testFailed("IntersectionObserver constructor did not throw due to invalid th reshold.");
21 } catch(e) {
22 exc = e;
23 shouldBeType("exc", "RangeError");
24 }
25
26 try {
19 new IntersectionObserver(e => {}, {rootMargin: "1"}); 27 new IntersectionObserver(e => {}, {rootMargin: "1"});
20 testFailed("IntersectionObserver constructor did not throw due to invalid ro otMargin."); 28 testFailed("IntersectionObserver constructor did not throw due to invalid ro otMargin.");
21 } catch(e) { 29 } catch(e) {
22 exc = e; 30 exc = e;
23 shouldBeType("exc", "DOMException"); 31 shouldBeType("exc", "DOMException");
24 shouldBe("exc.code", "DOMException.SYNTAX_ERR"); 32 shouldBe("exc.code", "DOMException.SYNTAX_ERR");
25 } 33 }
26 34
27 try { 35 try {
28 new IntersectionObserver(e => {}, {rootMargin: "2em"}); 36 new IntersectionObserver(e => {}, {rootMargin: "2em"});
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 110
103 try { 111 try {
104 observer.takeRecords(); 112 observer.takeRecords();
105 testFailed("IntersectionObserver.takeRecords() with a deleted root did not t hrow."); 113 testFailed("IntersectionObserver.takeRecords() with a deleted root did not t hrow.");
106 } catch(e) { 114 } catch(e) {
107 exc = e; 115 exc = e;
108 shouldBeType("exc", "DOMException"); 116 shouldBeType("exc", "DOMException");
109 shouldBe("exc.code", "DOMException.INVALID_STATE_ERR"); 117 shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
110 } 118 }
111 </script> 119 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698