blob: 57700d7f5a723b4d487da646b091a8294b854c30 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`This test confirms that updating the shadow dom is reflected to the Inspector.\n`);
await TestRunner.loadModule('elements_test_runner');
await TestRunner.showPanel('elements');
await TestRunner.loadHTML(`
<p id="description"></p>
<div id="container">
<div id="host"></div>
</div>
`);
await TestRunner.evaluateInPagePromise(`
var shadowRoot = host.attachShadow({mode: 'open'});
shadowRoot.innerHTML = "<div></div>";
`);
await TestRunner.evaluateInPagePromise(`
function updateShadowDOM()
{
shadowRoot.removeChild(shadowRoot.firstChild);
}
`);
ElementsTestRunner.expandElementsTree(function() {
TestRunner.evaluateInPage('updateShadowDOM()', function() {
ElementsTestRunner.expandElementsTree(function() {
var containerElem = ElementsTestRunner.expandedNodeWithId('container');
ElementsTestRunner.dumpElementsTree(containerElem);
TestRunner.completeTest();
});
});
});
})();