Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3 "use strict";
5 let tiltOpened = false;
7 function test() {
8 if (!isTiltEnabled()) {
9 info("Skipping destruction test because Tilt isn't enabled.");
10 return;
11 }
12 if (!isWebGLSupported()) {
13 info("Skipping destruction test because WebGL isn't supported.");
14 return;
15 }
17 waitForExplicitFinish();
19 createTab(function() {
20 createTilt({
21 onTiltOpen: function()
22 {
23 tiltOpened = true;
25 Services.obs.addObserver(finalize, DESTROYED, false);
26 EventUtils.sendKey("ESCAPE");
27 }
28 }, false, function suddenDeath()
29 {
30 info("Tilt could not be initialized properly.");
31 cleanup();
32 });
33 });
34 }
36 function finalize() {
37 let id = TiltUtils.getWindowId(gBrowser.selectedBrowser.contentWindow);
39 is(Tilt.visualizers[id], null,
40 "The current instance of the visualizer wasn't destroyed properly.");
42 cleanup();
43 }
45 function cleanup() {
46 if (tiltOpened) { Services.obs.removeObserver(finalize, DESTROYED); }
47 gBrowser.removeCurrentTab();
48 finish();
49 }