michael@0: /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: // Tests that we correctly display appropriate media query titles in the michael@0: // rule view. michael@0: michael@0: const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html"; michael@0: michael@0: let test = asyncTest(function*() { michael@0: yield addTab(TEST_URI); michael@0: let {inspector, view} = yield openRuleView(); michael@0: michael@0: yield selectNode("div", inspector); michael@0: michael@0: let elementStyle = view._elementStyle; michael@0: michael@0: let _strings = Services.strings michael@0: .createBundle("chrome://global/locale/devtools/styleinspector.properties"); michael@0: michael@0: let inline = _strings.GetStringFromName("rule.sourceInline"); michael@0: michael@0: is(elementStyle.rules.length, 3, "Should have 3 rules."); michael@0: is(elementStyle.rules[0].title, inline, "check rule 0 title"); michael@0: is(elementStyle.rules[1].title, inline + michael@0: ":15 @media screen and (min-width: 1px)", "check rule 1 title"); michael@0: is(elementStyle.rules[2].title, inline + ":8", "check rule 2 title"); michael@0: }); michael@0: