browser/components/customizableui/test/browser_941083_invalidate_wrapper_cache_createWidget.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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/. */
     5 "use strict";
     7 // See https://bugzilla.mozilla.org/show_bug.cgi?id=941083
     9 const kWidgetId = "test-invalidate-wrapper-cache";
    11 // Check createWidget invalidates the widget cache
    12 add_task(function() {
    13   let groupWrapper = CustomizableUI.getWidget(kWidgetId);
    14   ok(groupWrapper, "Should get group wrapper.");
    15   let singleWrapper = groupWrapper.forWindow(window);
    16   ok(singleWrapper, "Should get single wrapper.");
    18   CustomizableUI.createWidget({id: kWidgetId, label: "Test invalidating widgets caching"});
    20   let newGroupWrapper = CustomizableUI.getWidget(kWidgetId);
    21   ok(newGroupWrapper, "Should get a group wrapper again.");
    22   isnot(newGroupWrapper, groupWrapper, "Wrappers shouldn't be the same.");
    23   isnot(newGroupWrapper.provider, groupWrapper.provider, "Wrapper providers shouldn't be the same.");
    25   let newSingleWrapper = newGroupWrapper.forWindow(window);
    26   isnot(newSingleWrapper, singleWrapper, "Single wrappers shouldn't be the same.");
    27   isnot(newSingleWrapper.provider, singleWrapper.provider, "Single wrapper providers shouldn't be the same.");
    29   CustomizableUI.destroyWidget(kWidgetId);
    30   ok(!CustomizableUI.getWidget(kWidgetId), "Shouldn't get a wrapper after destroying the widget.");
    31 });

mercurial