browser/devtools/styleinspector/test/browser_ruleview_media-queries.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:dc982175267d
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/ */
4
5 "use strict";
6
7 // Tests that we correctly display appropriate media query titles in the
8 // rule view.
9
10 const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
11
12 let test = asyncTest(function*() {
13 yield addTab(TEST_URI);
14 let {inspector, view} = yield openRuleView();
15
16 yield selectNode("div", inspector);
17
18 let elementStyle = view._elementStyle;
19
20 let _strings = Services.strings
21 .createBundle("chrome://global/locale/devtools/styleinspector.properties");
22
23 let inline = _strings.GetStringFromName("rule.sourceInline");
24
25 is(elementStyle.rules.length, 3, "Should have 3 rules.");
26 is(elementStyle.rules[0].title, inline, "check rule 0 title");
27 is(elementStyle.rules[1].title, inline +
28 ":15 @media screen and (min-width: 1px)", "check rule 1 title");
29 is(elementStyle.rules[2].title, inline + ":8", "check rule 2 title");
30 });
31

mercurial