Bug 752216. (Gv1-FF) browser_popupNotification.js: Use locationbar to simplify test 19. r=gavin.

This commit is contained in:
Serge Gautherie 2012-05-10 01:58:26 +02:00
Родитель 9424fc7eaa
Коммит 67397318e7
1 изменённых файлов: 4 добавлений и 12 удалений

Просмотреть файл

@ -261,7 +261,6 @@ var tests = [
// switch back to the old browser // switch back to the old browser
gBrowser.selectedTab = this.oldSelectedTab; gBrowser.selectedTab = this.oldSelectedTab;
}, },
onHidden: function (popup) { onHidden: function (popup) {
// actually remove the notification to prevent it from reappearing // actually remove the notification to prevent it from reappearing
@ -601,14 +600,10 @@ var tests = [
// Test notification when chrome is hidden // Test notification when chrome is hidden
{ // Test #19 { // Test #19
run: function () { run: function () {
this.oldSelectedTab = gBrowser.selectedTab; window.locationbar.visible = false;
gBrowser.selectedTab = gBrowser.addTab("about:blank"); this.notifyObj = new basicNotification();
this.notification = showNotification(this.notifyObj);
let self = this; window.locationbar.visible = true;
loadURI("about:addons", function() {
self.notifyObj = new basicNotification();
self.notification = showNotification(self.notifyObj);
});
}, },
onShown: function (popup) { onShown: function (popup) {
checkPopup(popup, this.notifyObj); checkPopup(popup, this.notifyObj);
@ -619,9 +614,6 @@ var tests = [
ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered"); ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered");
this.notification.remove(); this.notification.remove();
ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered"); ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered");
gBrowser.removeTab(gBrowser.selectedTab);
gBrowser.selectedTab = this.oldSelectedTab;
} }
}, },
// Test notification is removed when dismissed if removeOnDismissal is true // Test notification is removed when dismissed if removeOnDismissal is true