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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 // 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