browser/devtools/tilt/test/browser_tilt_04_initialization.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     3 "use strict";
     5 function test() {
     6   if (!isTiltEnabled()) {
     7     info("Skipping initialization test because Tilt isn't enabled.");
     8     return;
     9   }
    10   if (!isWebGLSupported()) {
    11     info("Skipping initialization test because WebGL isn't supported.");
    12     return;
    13   }
    15   waitForExplicitFinish();
    17   createTab(function() {
    18     let id = TiltUtils.getWindowId(gBrowser.selectedBrowser.contentWindow);
    20     is(id, Tilt.currentWindowId,
    21       "The unique window identifiers should match for the same window.");
    23     createTilt({
    24       onTiltOpen: function(instance)
    25       {
    26         is(document.activeElement, instance.presenter.canvas,
    27           "The visualizer canvas should be focused on initialization.");
    29         ok(Tilt.visualizers[id] instanceof TiltVisualizer,
    30           "A new instance of the visualizer wasn't created properly.");
    31         ok(Tilt.visualizers[id].isInitialized(),
    32           "The new instance of the visualizer wasn't initialized properly.");
    33       },
    34       onTiltClose: function()
    35       {
    36         is(document.activeElement, gBrowser.selectedBrowser,
    37           "The focus wasn't correctly given back to the selectedBrowser.");
    39         is(Tilt.visualizers[id], null,
    40           "The current instance of the visualizer wasn't destroyed properly.");
    41       },
    42       onEnd: function()
    43       {
    44         cleanup();
    45       }
    46     }, true, function suddenDeath()
    47     {
    48       info("Tilt could not be initialized properly.");
    49       cleanup();
    50     });
    51   });
    52 }
    54 function cleanup() {
    55   gBrowser.removeCurrentTab();
    56   finish();
    57 }

mercurial