Skip to content
This repository has been archived by the owner on Apr 24, 2021. It is now read-only.

FF Support + Testing #64

Merged
merged 1 commit into from
Apr 4, 2016
Merged

FF Support + Testing #64

merged 1 commit into from
Apr 4, 2016

Conversation

gauntface
Copy link
Contributor

@wibblymat

This PR brings FF back into support (Latest stable FF doesn't support permissions API),

This also uses FF for testing the with the actual API.

This has largely left the tests not too dissimilar (all the changes are hidden in the state-stub.js file).

I also changes supported() to isSupported() <- Sorry it was driving me insane.

@gauntface gauntface force-pushed the ff-support-testing branch 2 times, most recently from 22544bc to 579455e Compare April 1, 2016 10:58
@@ -175,6 +174,9 @@ export default class PushClient extends EventDispatch {
*/
unsubscribe() {
return this.getRegistration()
.catch(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd move this down to just before the final .then. If the catch happens here then we know that the next two .thens are NOOPs, so might as well not bother running them.

@wibblymat
Copy link
Contributor

Reviewed

@gauntface
Copy link
Contributor Author

@wibblymat just added changes from your review - thanks a lot.

I think the late catching of a bad registration is adding confusion to the API here, but I've got a semi-reasonable approach for the current version.

I've raised an issue to discuss if there is a better way of managing this #66

// H/T to web-push for this trick to get permissions accepted / denied
initialisePromise = globalDriverReference.executeScript(() => {
/* global window, Components */
window.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assume this is the line you were referring to that didn't have any external docs available around it. Can we link up to web-push's repo given we're referring to it a line or two above? (in case folks wonder what that project is)

@gauntface
Copy link
Contributor Author

@wibblymat are you generally happy with this to merge in?

@addyosmani
Copy link
Contributor

Fwiw, LGTM for a merge. Would be good to get Mat's final call on it however

@@ -57,13 +58,39 @@ describe('Test Propel', function() {

const queueUnitTest = browserInfo => {
it(`should pass all tests in ${browserInfo.prettyName}`, () => {

switch (browserInfo.seleniumBrowserId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think that a switch with only one case is harder to read than an if

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be folded into the next if, in fact, right?

@wibblymat
Copy link
Contributor

One comment on style, substance LGTM :)

…s work and moving back to Notification API to get FF support back on the roadmap
@gauntface gauntface merged commit 5224e0a into master Apr 4, 2016
@gauntface gauntface deleted the ff-support-testing branch April 4, 2016 13:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants