blob: 27223746e7354a3111c89c72c7211e39b5cf2e34 [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(`Verifies that filtering in StylesSidebarPane works as expected.\n`);
await TestRunner.loadModule('elements_test_runner');
await TestRunner.showPanel('elements');
await TestRunner.loadHTML(`
<style>
.mydiv {
border: 1px solid black;
padding: 10px 10px 10px 10px;
}
#inspected {
border-size: 2px;
}
</style>
<div style="margin: 1px;" class="mydiv" id="inspected"></div>
`);
TestRunner.runTestSuite([
function selectInitialNode(next) {
ElementsTestRunner.selectNodeAndWaitForStyles('inspected', next);
},
function testSimpleFiltering(next) {
ElementsTestRunner.filterMatchedStyles('padding');
ElementsTestRunner.dumpRenderedMatchedStyles();
next();
},
function testLonghandsAreAutoExpanded(next) {
ElementsTestRunner.filterMatchedStyles('-top');
ElementsTestRunner.dumpRenderedMatchedStyles();
next();
},
function testAutoExpandedLonghandsAreCollapsed(next) {
ElementsTestRunner.filterMatchedStyles(null);
ElementsTestRunner.dumpRenderedMatchedStyles();
next();
}
]);
})();