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.
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 the rule-view displays correctly on MathML elements
9 const TEST_URL = [
10 "data:text/html,",
11 "<div>",
12 " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">",
13 " <mfrac>",
14 " <msubsup>",
15 " <mi>a</mi>",
16 " <mi>i</mi>",
17 " <mi>j</mi>",
18 " </msubsup>",
19 " <msub>",
20 " <mi>x</mi>",
21 " <mn>0</mn>",
22 " </msub>",
23 " </mfrac>",
24 " </math>",
25 "</div>"
26 ].join("");
28 let test = asyncTest(function*() {
29 yield addTab(TEST_URL);
30 let {toolbox, inspector, view} = yield openRuleView();
32 info("Select the DIV node and verify the rule-view shows rules");
33 yield selectNode("div", inspector);
34 ok(view.element.querySelectorAll(".ruleview-rule").length,
35 "The rule-view shows rules for the div element");
37 info("Select various MathML nodes and verify the rule-view is empty");
38 yield selectNode("math", inspector);
39 ok(!view.element.querySelectorAll(".ruleview-rule").length,
40 "The rule-view is empty for the math element");
42 yield selectNode("msubsup", inspector);
43 ok(!view.element.querySelectorAll(".ruleview-rule").length,
44 "The rule-view is empty for the msubsup element");
46 yield selectNode("mn", inspector);
47 ok(!view.element.querySelectorAll(".ruleview-rule").length,
48 "The rule-view is empty for the mn element");
50 info("Select again the DIV node and verify the rule-view shows rules");
51 yield selectNode("div", inspector);
52 ok(view.element.querySelectorAll(".ruleview-rule").length,
53 "The rule-view shows rules for the div element");
54 });