Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 function test() {
2 waitForExplicitFinish();
4 gBrowser.selectedTab = gBrowser.addTab();
6 SpecialPowers.setIntPref("ui.tooltipDelay", 0);
8 let doStopPropagation = function (aEvent)
9 {
10 aEvent.stopPropagation();
11 }
13 let onPopupShown = function (aEvent)
14 {
15 is(aEvent.originalTarget.localName, "tooltip", "tooltip is showing");
17 let doc = gBrowser.contentDocument;
18 let win = gBrowser.contentWindow;
19 let p2 = doc.getElementById("p2");
20 setTimeout(function () {
21 EventUtils.synthesizeMouseAtCenter(p2, { type: "mousemove" }, win); }, 0);
22 }
24 let onPopupHiding = function (aEvent)
25 {
26 is(aEvent.originalTarget.localName, "tooltip", "tooltip is hiding");
28 let doc = gBrowser.contentDocument;
30 doc.removeEventListener("mousemove", doStopPropagation, true);
31 doc.removeEventListener("mouseenter", doStopPropagation, true);
32 doc.removeEventListener("mouseleave", doStopPropagation, true);
33 doc.removeEventListener("mouseover", doStopPropagation, true);
34 doc.removeEventListener("mouseout", doStopPropagation, true);
35 document.removeEventListener("popupshown", onPopupShown, true);
36 document.removeEventListener("popuphiding", onPopupHiding, true);
38 SpecialPowers.clearUserPref("ui.tooltipDelay");
40 gBrowser.removeCurrentTab();
41 finish();
42 }
44 let onLoad = function (aEvent)
45 {
46 let doc = gBrowser.contentDocument;
47 let win = gBrowser.contentWindow;
48 let p1 = doc.getElementById("p1");
49 let p2 = doc.getElementById("p2");
51 EventUtils.synthesizeMouseAtCenter(p2, { type: "mousemove" }, win);
53 doc.addEventListener("mousemove", doStopPropagation, true);
54 doc.addEventListener("mouseenter", doStopPropagation, true);
55 doc.addEventListener("mouseleave", doStopPropagation, true);
56 doc.addEventListener("mouseover", doStopPropagation, true);
57 doc.addEventListener("mouseout", doStopPropagation, true);
58 document.addEventListener("popupshown", onPopupShown, true);
59 document.addEventListener("popuphiding", onPopupHiding, true);
61 EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win);
62 }
64 gBrowser.selectedBrowser.addEventListener("load", function loadListener() {
65 gBrowser.selectedBrowser.removeEventListener("load", loadListener, true);
66 setTimeout(onLoad, 0);
67 }, true);
69 content.location = "data:text/html," +
70 "<p id=\"p1\" title=\"tooltip is here\">This paragraph has a tooltip.</p>" +
71 "<p id=\"p2\">This paragraph doesn't have tooltip.</p>";
72 }