Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
2 /* Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/ */
5 "use strict";
7 // Checking selector counts, matched rules and titles in the computed-view
9 const {PropertyView} = devtools.require("devtools/styleinspector/computed-view");
10 const TEST_URI = TEST_URL_ROOT + "doc_matched_selectors.html";
12 let test = asyncTest(function*() {
13 yield addTab(TEST_URI);
14 let {toolbox, inspector, view} = yield openComputedView();
16 yield selectNode("#test", inspector);
17 yield testMatchedSelectors(view);
18 });
20 function* testMatchedSelectors(view) {
21 info("checking selector counts, matched rules and titles");
23 is(getNode("#test"), view.viewedElement.rawNode(),
24 "style inspector node matches the selected node");
26 let propertyView = new PropertyView(view, "color");
27 propertyView.buildMain();
28 propertyView.buildSelectorContainer();
29 propertyView.matchedExpanded = true;
31 yield propertyView.refreshMatchedSelectors();
33 let numMatchedSelectors = propertyView.matchedSelectors.length;
34 is(numMatchedSelectors, 6, "CssLogic returns the correct number of matched selectors for div");
35 is(propertyView.hasMatchedSelectors, true, "hasMatchedSelectors returns true");
36 }