tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_historySwipeAnimation.js (1202B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 function test() {
      6  waitForExplicitFinish();
      7 
      8  BrowserCommands.openTab();
      9  let tab = gBrowser.selectedTab;
     10  registerCleanupFunction(function () {
     11    gBrowser.removeTab(tab);
     12  });
     13 
     14  ok(gHistorySwipeAnimation, "gHistorySwipeAnimation exists.");
     15 
     16  if (!gHistorySwipeAnimation._isSupported()) {
     17    is(
     18      gHistorySwipeAnimation.active,
     19      false,
     20      "History swipe animation is not " +
     21        "active when not supported by the platform."
     22    );
     23    finish();
     24    return;
     25  }
     26 
     27  gHistorySwipeAnimation.init();
     28 
     29  is(
     30    gHistorySwipeAnimation.active,
     31    true,
     32    "History swipe animation support " +
     33      "was successfully initialized when supported."
     34  );
     35 
     36  test0();
     37 
     38  function test0() {
     39    // Test uninit of gHistorySwipeAnimation.
     40    // This test MUST be the last one to execute.
     41    gHistorySwipeAnimation.uninit();
     42    is(
     43      gHistorySwipeAnimation.active,
     44      false,
     45      "History swipe animation support was successfully uninitialized"
     46    );
     47    finish();
     48  }
     49 }