-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge: cyberfox 52.0b7 with cyberfox 52.0b6
- Loading branch information
1 parent
3f7c407
commit ad43916
Showing
164 changed files
with
6,305 additions
and
3,630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
browser/base/content/test/popupNotifications/browser_popupNotification_keyboard.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
function test() { | ||
waitForExplicitFinish(); | ||
|
||
ok(PopupNotifications, "PopupNotifications object exists"); | ||
ok(PopupNotifications.panel, "PopupNotifications panel exists"); | ||
|
||
setup(); | ||
} | ||
|
||
var tests = [ | ||
// Test that for persistent notifications, | ||
// the secondary action is triggered by pressing the escape key. | ||
{ id: "Test#1", | ||
run() { | ||
this.notifyObj = new BasicNotification(this.id); | ||
this.notifyObj.options.persistent = true; | ||
showNotification(this.notifyObj); | ||
}, | ||
onShown(popup) { | ||
checkPopup(popup, this.notifyObj); | ||
EventUtils.synthesizeKey("VK_ESCAPE", {}); | ||
}, | ||
onHidden(popup) { | ||
ok(!this.notifyObj.mainActionClicked, "mainAction was not clicked"); | ||
ok(this.notifyObj.secondaryActionClicked, "secondaryAction was clicked"); | ||
ok(!this.notifyObj.dismissalCallbackTriggered, "dismissal callback wasn't triggered"); | ||
ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered"); | ||
} | ||
}, | ||
// Test that for non-persistent notifications, the escape key dismisses the notification. | ||
{ id: "Test#2", | ||
*run() { | ||
yield waitForWindowReadyForPopupNotifications(window); | ||
this.notifyObj = new BasicNotification(this.id); | ||
this.notification = showNotification(this.notifyObj); | ||
}, | ||
onShown(popup) { | ||
checkPopup(popup, this.notifyObj); | ||
EventUtils.synthesizeKey("VK_ESCAPE", {}); | ||
}, | ||
onHidden(popup) { | ||
ok(!this.notifyObj.mainActionClicked, "mainAction was not clicked"); | ||
ok(!this.notifyObj.secondaryActionClicked, "secondaryAction was not clicked"); | ||
ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered"); | ||
ok(!this.notifyObj.removedCallbackTriggered, "removed callback was not triggered"); | ||
this.notification.remove(); | ||
} | ||
}, | ||
// Test that the space key on an anchor element focuses an active notification | ||
{ id: "Test#3", | ||
*run() { | ||
this.notifyObj = new BasicNotification(this.id); | ||
this.notifyObj.anchorID = "geo-notification-icon"; | ||
this.notifyObj.addOptions({ | ||
persistent: true | ||
}); | ||
this.notification = showNotification(this.notifyObj); | ||
}, | ||
*onShown(popup) { | ||
checkPopup(popup, this.notifyObj); | ||
let anchor = document.getElementById(this.notifyObj.anchorID); | ||
anchor.focus(); | ||
is(document.activeElement, anchor); | ||
EventUtils.synthesizeKey(" ", {}); | ||
is(document.activeElement, popup.childNodes[0].button); | ||
this.notification.remove(); | ||
}, | ||
onHidden(popup) { } | ||
}, | ||
]; |
Oops, something went wrong.