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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/styleinspector/test/browser_ruleview_media-queries.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
     1.5 +/* Any copyright is dedicated to the Public Domain.
     1.6 + http://creativecommons.org/publicdomain/zero/1.0/ */
     1.7 +
     1.8 +"use strict";
     1.9 +
    1.10 +// Tests that we correctly display appropriate media query titles in the
    1.11 +// rule view.
    1.12 +
    1.13 +const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
    1.14 +
    1.15 +let test = asyncTest(function*() {
    1.16 +  yield addTab(TEST_URI);
    1.17 +  let {inspector, view} = yield openRuleView();
    1.18 +
    1.19 +  yield selectNode("div", inspector);
    1.20 +
    1.21 +  let elementStyle = view._elementStyle;
    1.22 +
    1.23 +  let _strings = Services.strings
    1.24 +    .createBundle("chrome://global/locale/devtools/styleinspector.properties");
    1.25 +
    1.26 +  let inline = _strings.GetStringFromName("rule.sourceInline");
    1.27 +
    1.28 +  is(elementStyle.rules.length, 3, "Should have 3 rules.");
    1.29 +  is(elementStyle.rules[0].title, inline, "check rule 0 title");
    1.30 +  is(elementStyle.rules[1].title, inline +
    1.31 +    ":15 @media screen and (min-width: 1px)", "check rule 1 title");
    1.32 +  is(elementStyle.rules[2].title, inline + ":8", "check rule 2 title");
    1.33 +});
    1.34 +

mercurial