Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ |
michael@0 | 2 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 4 | |
michael@0 | 5 | "use strict"; |
michael@0 | 6 | |
michael@0 | 7 | // Tests that we correctly display appropriate media query titles in the |
michael@0 | 8 | // rule view. |
michael@0 | 9 | |
michael@0 | 10 | const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html"; |
michael@0 | 11 | |
michael@0 | 12 | let test = asyncTest(function*() { |
michael@0 | 13 | yield addTab(TEST_URI); |
michael@0 | 14 | let {inspector, view} = yield openRuleView(); |
michael@0 | 15 | |
michael@0 | 16 | yield selectNode("div", inspector); |
michael@0 | 17 | |
michael@0 | 18 | let elementStyle = view._elementStyle; |
michael@0 | 19 | |
michael@0 | 20 | let _strings = Services.strings |
michael@0 | 21 | .createBundle("chrome://global/locale/devtools/styleinspector.properties"); |
michael@0 | 22 | |
michael@0 | 23 | let inline = _strings.GetStringFromName("rule.sourceInline"); |
michael@0 | 24 | |
michael@0 | 25 | is(elementStyle.rules.length, 3, "Should have 3 rules."); |
michael@0 | 26 | is(elementStyle.rules[0].title, inline, "check rule 0 title"); |
michael@0 | 27 | is(elementStyle.rules[1].title, inline + |
michael@0 | 28 | ":15 @media screen and (min-width: 1px)", "check rule 1 title"); |
michael@0 | 29 | is(elementStyle.rules[2].title, inline + ":8", "check rule 2 title"); |
michael@0 | 30 | }); |
michael@0 | 31 |