зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 964de5d960fa
The changes these tests depend on were backed out, but I didn't realise that and pushed this. Backing out and pushing again.
This commit is contained in:
Родитель
90857a5bc2
Коммит
552b7cd770
|
@ -57,20 +57,17 @@ add_task(function* test_pushNotifications() {
|
|||
subscriptionUri: serverURL + '/pushNotifications/subscription1',
|
||||
pushEndpoint: serverURL + '/pushEndpoint1',
|
||||
pushReceiptEndpoint: serverURL + '/pushReceiptEndpoint1',
|
||||
scope: 'https://example.com/page/1',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
scope: 'https://example.com/page/1'
|
||||
}, {
|
||||
subscriptionUri: serverURL + '/pushNotifications/subscription2',
|
||||
pushEndpoint: serverURL + '/pushEndpoint2',
|
||||
pushReceiptEndpoint: serverURL + '/pushReceiptEndpoint2',
|
||||
scope: 'https://example.com/page/2',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
scope: 'https://example.com/page/2'
|
||||
}, {
|
||||
subscriptionUri: serverURL + '/pushNotifications/subscription3',
|
||||
pushEndpoint: serverURL + '/pushEndpoint3',
|
||||
pushReceiptEndpoint: serverURL + '/pushReceiptEndpoint3',
|
||||
scope: 'https://example.com/page/3',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
scope: 'https://example.com/page/3'
|
||||
}];
|
||||
|
||||
for (let record of records) {
|
||||
|
|
|
@ -47,8 +47,7 @@ add_task(function* test_pushSubscriptionNoConnection() {
|
|||
|
||||
yield rejects(
|
||||
PushNotificationService.register(
|
||||
'https://example.net/page/invalid-response',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
'https://example.net/page/invalid-response'),
|
||||
function(error) {
|
||||
return error && error.includes("Error");
|
||||
},
|
||||
|
@ -88,8 +87,7 @@ add_task(function* test_pushSubscriptionMissingLocation() {
|
|||
|
||||
yield rejects(
|
||||
PushNotificationService.register(
|
||||
'https://example.net/page/invalid-response',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
'https://example.net/page/invalid-response'),
|
||||
function(error) {
|
||||
return error && error.includes("Return code 201, but the answer is bogus");
|
||||
},
|
||||
|
@ -115,8 +113,7 @@ add_task(function* test_pushSubscriptionMissingLink() {
|
|||
|
||||
yield rejects(
|
||||
PushNotificationService.register(
|
||||
'https://example.net/page/invalid-response',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
'https://example.net/page/invalid-response'),
|
||||
function(error) {
|
||||
return error && error.includes("Return code 201, but the answer is bogus");
|
||||
},
|
||||
|
@ -142,8 +139,7 @@ add_task(function* test_pushSubscriptionMissingLink1() {
|
|||
|
||||
yield rejects(
|
||||
PushNotificationService.register(
|
||||
'https://example.net/page/invalid-response',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
'https://example.net/page/invalid-response'),
|
||||
function(error) {
|
||||
return error && error.includes("Return code 201, but the answer is bogus");
|
||||
},
|
||||
|
@ -169,8 +165,7 @@ add_task(function* test_pushSubscriptionLocationBogus() {
|
|||
|
||||
yield rejects(
|
||||
PushNotificationService.register(
|
||||
'https://example.net/page/invalid-response',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
'https://example.net/page/invalid-response'),
|
||||
function(error) {
|
||||
return error && error.includes("Return code 201, but URI is bogus.");
|
||||
},
|
||||
|
@ -196,8 +191,7 @@ add_task(function* test_pushSubscriptionNot2xxCode() {
|
|||
|
||||
yield rejects(
|
||||
PushNotificationService.register(
|
||||
'https://example.net/page/invalid-response',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
'https://example.net/page/invalid-response'),
|
||||
function(error) {
|
||||
return error && error.includes("Error");
|
||||
},
|
||||
|
|
|
@ -57,8 +57,7 @@ add_task(function* test_pushSubscriptionSuccess() {
|
|||
});
|
||||
|
||||
let newRecord = yield PushNotificationService.register(
|
||||
'https://example.org/1',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
'https://example.org/1'
|
||||
);
|
||||
|
||||
var subscriptionUri = serverURL + '/pushSubscriptionSuccesss';
|
||||
|
@ -100,8 +99,7 @@ add_task(function* test_pushSubscriptionMissingLink2() {
|
|||
});
|
||||
|
||||
let newRecord = yield PushNotificationService.register(
|
||||
'https://example.org/no_receiptEndpoint',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
'https://example.org/no_receiptEndpoint'
|
||||
);
|
||||
|
||||
var subscriptionUri = serverURL + '/subscriptionMissingLink2';
|
||||
|
|
|
@ -25,8 +25,7 @@ add_task(function* test_registrations_error() {
|
|||
});
|
||||
|
||||
yield rejects(
|
||||
PushNotificationService.registration('https://example.net/1',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })),
|
||||
PushNotificationService.registration('https://example.net/1'),
|
||||
function(error) {
|
||||
return error == 'Database error';
|
||||
},
|
||||
|
|
|
@ -41,20 +41,17 @@ add_task(function* test_pushNotifications() {
|
|||
subscriptionUri: serverURL + '/subscriptionA',
|
||||
pushEndpoint: serverURL + '/pushEndpointA',
|
||||
pushReceiptEndpoint: serverURL + '/pushReceiptEndpointA',
|
||||
scope: 'https://example.net/a',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
scope: 'https://example.net/a'
|
||||
}, {
|
||||
subscriptionUri: serverURL + '/subscriptionB',
|
||||
pushEndpoint: serverURL + '/pushEndpointB',
|
||||
pushReceiptEndpoint: serverURL + '/pushReceiptEndpointB',
|
||||
scope: 'https://example.net/b',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
scope: 'https://example.net/b'
|
||||
}, {
|
||||
subscriptionUri: serverURL + '/subscriptionC',
|
||||
pushEndpoint: serverURL + '/pushEndpointC',
|
||||
pushReceiptEndpoint: serverURL + '/pushReceiptEndpointC',
|
||||
scope: 'https://example.net/c',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false })
|
||||
scope: 'https://example.net/c'
|
||||
}];
|
||||
|
||||
for (let record of records) {
|
||||
|
@ -67,8 +64,7 @@ add_task(function* test_pushNotifications() {
|
|||
});
|
||||
|
||||
let registration = yield PushNotificationService.registration(
|
||||
'https://example.net/a',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false }));
|
||||
'https://example.net/a');
|
||||
equal(
|
||||
registration.pushEndpoint,
|
||||
serverURL + '/pushEndpointA',
|
||||
|
|
|
@ -53,8 +53,7 @@ add_task(function* test_pushUnsubscriptionSuccess() {
|
|||
subscriptionUri: serverURL + '/subscriptionUnsubscriptionSuccess',
|
||||
pushEndpoint: serverURL + '/pushEndpointUnsubscriptionSuccess',
|
||||
pushReceiptEndpoint: serverURL + '/receiptPushEndpointUnsubscriptionSuccess',
|
||||
scope: 'https://example.com/page/unregister-success',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false }),
|
||||
scope: 'https://example.com/page/unregister-success'
|
||||
});
|
||||
|
||||
PushService.init({
|
||||
|
@ -63,8 +62,7 @@ add_task(function* test_pushUnsubscriptionSuccess() {
|
|||
});
|
||||
|
||||
yield PushNotificationService.unregister(
|
||||
'https://example.com/page/unregister-success',
|
||||
ChromeUtils.originAttributesToSuffix({ appId: Ci.nsIScriptSecurityManager.NO_APP_ID, inBrowser: false }));
|
||||
'https://example.com/page/unregister-success');
|
||||
let record = yield db.getByKeyID(serverURL + '/subscriptionUnsubscriptionSuccess');
|
||||
ok(!record, 'Unregister did not remove record');
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче