blob: b34dcb976f501ab14eb9c90570b9c4ded6980857 [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 verifies that template's content DocumentFragment is accessible from DevTools.\n`);
await TestRunner.loadModule('elements_test_runner');
await TestRunner.loadModule('console_test_runner');
await TestRunner.showPanel('elements');
await TestRunner.loadHTML(`
<p id="description"></p>
<template id="tpl">
<div>Hello!</div>
</template>
`);
ElementsTestRunner.expandElementsTree(function() {
var contentNode = ElementsTestRunner.expandedNodeWithId('tpl').templateContent();
UI.panels.elements.selectDOMNode(contentNode, true);
ConsoleTestRunner.evaluateInConsole('$0', callback);
});
function callback(result) {
TestRunner.addResult('SUCCESS');
TestRunner.completeTest();
}
})();