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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 // Tests that we correctly display appropriate media query titles in the
     8 // rule view.
    10 const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
    12 let test = asyncTest(function*() {
    13   yield addTab(TEST_URI);
    14   let {inspector, view} = yield openRuleView();
    16   yield selectNode("div", inspector);
    18   let elementStyle = view._elementStyle;
    20   let _strings = Services.strings
    21     .createBundle("chrome://global/locale/devtools/styleinspector.properties");
    23   let inline = _strings.GetStringFromName("rule.sourceInline");
    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 });

mercurial