browser/components/customizableui/test/browser_877006_missing_view.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.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 "use strict";
michael@0 6
michael@0 7 // Should be able to add broken view widget
michael@0 8 add_task(function testAddbrokenViewWidget() {
michael@0 9 const kWidgetId = 'test-877006-broken-widget';
michael@0 10 let widgetSpec = {
michael@0 11 id: kWidgetId,
michael@0 12 type: 'view',
michael@0 13 viewId: 'idontexist',
michael@0 14 /* Empty handler so we try to attach it maybe? */
michael@0 15 onViewShowing: function() {
michael@0 16 }
michael@0 17 };
michael@0 18
michael@0 19 let noError = true;
michael@0 20 try {
michael@0 21 CustomizableUI.createWidget(widgetSpec);
michael@0 22 CustomizableUI.addWidgetToArea(kWidgetId, CustomizableUI.AREA_NAVBAR);
michael@0 23 } catch (ex) {
michael@0 24 Cu.reportError(ex);
michael@0 25 noError = false;
michael@0 26 }
michael@0 27 ok(noError, "Should not throw an exception trying to add a broken view widget.");
michael@0 28
michael@0 29 noError = true;
michael@0 30 try {
michael@0 31 CustomizableUI.destroyWidget(kWidgetId);
michael@0 32 } catch (ex) {
michael@0 33 Cu.reportError(ex);
michael@0 34 noError = false;
michael@0 35 }
michael@0 36 ok(noError, "Should not throw an exception trying to remove the broken view widget.");
michael@0 37 });
michael@0 38
michael@0 39 add_task(function asyncCleanup() {
michael@0 40 yield resetCustomization();
michael@0 41 });

mercurial