| Index: third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html
|
| diff --git a/third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html b/third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html
|
| index 1da557dd409739693a25bf3a4dd0e801d8d2203f..f811158727c921bb523b0a676b5f06835c16fdef 100644
|
| --- a/third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html
|
| +++ b/third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html
|
| @@ -1,5 +1,6 @@
|
| <!DOCTYPE html>
|
| <div id="root"></div>
|
| +<div id="target"></div>
|
| <script src="../resources/js-test.js"></script>
|
| <script src="../resources/gc.js"></script>
|
| <script>
|
| @@ -50,4 +51,45 @@
|
| exc = e;
|
| shouldBeType("exc", "TypeError");
|
| }
|
| +
|
| + observer = new IntersectionObserver(c => {}, {root: rootDiv});
|
| + rootDiv.parentNode.removeChild(rootDiv);
|
| + rootDiv = null;
|
| + gc();
|
| +
|
| + try {
|
| + observer.observe(target);
|
| + testFailed("IntersectionObserver.observe() with a deleted root did not throw.");
|
| + } catch(e) {
|
| + exc = e;
|
| + shouldBeType("exc", "DOMException");
|
| + shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
|
| + }
|
| +
|
| + try {
|
| + observer.unobserve(target);
|
| + testFailed("IntersectionObserver.unobserve() with a deleted root did not throw.");
|
| + } catch(e) {
|
| + exc = e;
|
| + shouldBeType("exc", "DOMException");
|
| + shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
|
| + }
|
| +
|
| + try {
|
| + observer.disconnect();
|
| + testFailed("IntersectionObserver.disconnect() with a deleted root did not throw.");
|
| + } catch(e) {
|
| + exc = e;
|
| + shouldBeType("exc", "DOMException");
|
| + shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
|
| + }
|
| +
|
| + try {
|
| + observer.takeRecords();
|
| + testFailed("IntersectionObserver.takeRecords() with a deleted root did not throw.");
|
| + } catch(e) {
|
| + exc = e;
|
| + shouldBeType("exc", "DOMException");
|
| + shouldBe("exc.code", "DOMException.INVALID_STATE_ERR");
|
| + }
|
| </script>
|
|
|