Wed, 31 Dec 2014 06:55:46 +0100
Added tag TORBROWSER_REPLICA for changeset 6474c204b198
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3 "use strict";
5 let pickDone = false;
7 function test() {
8 if (!isTiltEnabled()) {
9 info("Skipping picking test because Tilt isn't enabled.");
10 return;
11 }
12 if (!isWebGLSupported()) {
13 info("Skipping picking test because WebGL isn't supported.");
14 return;
15 }
17 waitForExplicitFinish();
19 createTab(function() {
20 createTilt({
21 onTiltOpen: function(instance)
22 {
23 let presenter = instance.presenter;
24 let canvas = presenter.canvas;
26 presenter._onSetupMesh = function() {
27 let p = getPickablePoint(presenter);
29 presenter.pickNode(p[0], p[1], {
30 onpick: function(data)
31 {
32 ok(data.index > 0,
33 "Simply picking a node didn't work properly.");
35 pickDone = true;
36 Services.obs.addObserver(cleanup, DESTROYED, false);
37 Tilt.destroy(Tilt.currentWindowId);
38 }
39 });
40 };
41 }
42 }, false, function suddenDeath()
43 {
44 info("Tilt could not be initialized properly.");
45 cleanup();
46 });
47 });
48 }
50 function cleanup() {
51 if (pickDone) { Services.obs.removeObserver(cleanup, DESTROYED); }
52 gBrowser.removeCurrentTab();
53 finish();
54 }