summaryrefslogtreecommitdiff
path: root/toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
committerMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
commit81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch)
tree6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js
parent28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff)
downloadpalemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js')
-rw-r--r--toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js b/toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js
new file mode 100644
index 000000000..0eaebcbdd
--- /dev/null
+++ b/toolkit/devtools/styleinspector/test/browser_ruleview_media-queries.js
@@ -0,0 +1,31 @@
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Tests that we correctly display appropriate media query titles in the
+// rule view.
+
+const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
+
+add_task(function*() {
+ yield addTab(TEST_URI);
+ let {inspector, view} = yield openRuleView();
+
+ yield selectNode("div", inspector);
+
+ let elementStyle = view._elementStyle;
+
+ let _strings = Services.strings
+ .createBundle("chrome://global/locale/devtools/styleinspector.properties");
+
+ let inline = _strings.GetStringFromName("rule.sourceInline");
+
+ is(elementStyle.rules.length, 3, "Should have 3 rules.");
+ is(elementStyle.rules[0].title, inline, "check rule 0 title");
+ is(elementStyle.rules[1].title, inline +
+ ":15 @media screen and (min-width: 1px)", "check rule 1 title");
+ is(elementStyle.rules[2].title, inline + ":8", "check rule 2 title");
+});
+