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

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

Issue 2646633002: IntersectionObserver: remove gc-timing-revealing execeptions. (Closed)
Patch Set: 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 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 {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // (http://crbug.com/595672/). 73 // (http://crbug.com/595672/).
74 function initializeObserverThenRemoveRootDiv() { 74 function initializeObserverThenRemoveRootDiv() {
75 let rootDiv = document.getElementById("root"); 75 let rootDiv = document.getElementById("root");
76 let observer = new IntersectionObserver(c => {}, {root: rootDiv}); 76 let observer = new IntersectionObserver(c => {}, {root: rootDiv});
77 rootDiv.parentNode.removeChild(rootDiv); 77 rootDiv.parentNode.removeChild(rootDiv);
78 return observer; 78 return observer;
79 } 79 }
80 80
81 observer = initializeObserverThenRemoveRootDiv(); 81 observer = initializeObserverThenRemoveRootDiv();
82 gc(); 82 gc();
83 83 observer.observe(target);
84 try { 84 observer.unobserve(target);
85 observer.observe(target); 85 observer.disconnect();
86 testFailed("IntersectionObserver.observe() with a deleted root did not throw ."); 86 shouldBeEqualToNumber("0", observer.takeRecords().length);
87 } catch(e) {
88 exc = e;
89 shouldBeType("exc", "DOMException");
90 shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
91 }
92
93 try {
94 observer.unobserve(target);
95 testFailed("IntersectionObserver.unobserve() with a deleted root did not thr ow.");
96 } catch(e) {
97 exc = e;
98 shouldBeType("exc", "DOMException");
99 shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
100 }
101
102 try {
103 observer.disconnect();
104 testFailed("IntersectionObserver.disconnect() with a deleted root did not th row.");
105 } catch(e) {
106 exc = e;
107 shouldBeType("exc", "DOMException");
108 shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
109 }
110
111 try {
112 observer.takeRecords();
113 testFailed("IntersectionObserver.takeRecords() with a deleted root did not t hrow.");
114 } catch(e) {
115 exc = e;
116 shouldBeType("exc", "DOMException");
117 shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
118 }
119 </script> 87 </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