Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / remove-from-document-config-controls-no-crash.html
blobc7c78ce37468df961f6cde0d7425759560ecd8e2
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body>
7 <video id="v"></video>
8 <script>
9 description("Verify that removing a video element from the DOM does not crash.");
11 window.jsTestIsAsync = true;
13 if (window.testRunner) {
14 testRunner.dumpAsText();
15 testRunner.waitUntilDone();
18 function runTest() {
19 if (!window.internals) {
20 finishJSTest();
21 return;
23 var video = document.getElementById('v');
24 var videoShadow = window.internals.shadowRoot(video);
25 traverse(videoShadow);
27 document.body.removeChild(video);
28 finishJSTest();
31 function traverse(node) {
32 if (!node)
33 return;
34 if (node.attributes)
35 Array.prototype.forEach.call(node.attributes, function (n) { node[n && n.localName] = 2; });
36 if (node.childNodes)
37 Array.prototype.forEach.call(node.childNodes, traverse);
38 if (node.localName == 'input')
39 traverse(window.internals.shadowRoot(node));
41 window.onload = runTest;
42 </script>
43 </html>