Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 |