gecko-dev/dom/push/test/xpcshell/test_notification_version_string.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.9 KiB
JavaScript
Raw Normal View History

Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
'use strict';
const {PushDB, PushService, PushServiceWebSocket} = serviceExports;
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
const userAgentID = 'ba31ac13-88d4-4984-8e6b-8731315a7cf8';
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
function run_test() {
do_get_profile();
setPrefs({
userAgentID: userAgentID,
});
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
run_next_test();
}
add_task(async function test_notification_version_string() {
let db = PushServiceWebSocket.newPushDB();
registerCleanupFunction(() => {return db.drop().then(_ => db.close());});
await db.put({
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
channelID: '6ff97d56-d0c0-43bc-8f5b-61b855e1d93b',
pushEndpoint: 'https://example.org/updates/1',
scope: 'https://example.com/page/1',
originAttributes: '',
version: 2,
quota: Infinity,
systemRecord: true,
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
});
let notifyPromise = promiseObserverNotification(PushServiceComponent.pushTopic);
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
let ackDone;
let ackPromise = new Promise(resolve => ackDone = resolve);
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
PushService.init({
serverURI: "wss://push.example.org/",
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
db,
makeWebSocket(uri) {
return new MockWebSocket(uri, {
onHello(request) {
this.serverSendMsg(JSON.stringify({
messageType: 'hello',
status: 200,
uaid: userAgentID,
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
}));
this.serverSendMsg(JSON.stringify({
messageType: 'notification',
updates: [{
channelID: '6ff97d56-d0c0-43bc-8f5b-61b855e1d93b',
version: '4'
}]
}));
},
onACK: ackDone
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
});
}
});
let {subject: message, data: scope} = await notifyPromise;
equal(message.QueryInterface(Ci.nsIPushMessage).data, null,
'Unexpected data for Simple Push message');
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
await ackPromise;
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
let storeRecord = await db.getByKeyID(
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
'6ff97d56-d0c0-43bc-8f5b-61b855e1d93b');
strictEqual(storeRecord.version, 4, 'Wrong record version');
equal(storeRecord.quota, Infinity, 'Wrong quota');
Bug 1150683 - Add xpcshell tests for nsIPushNotificationService. r=dougt --- dom/push/moz.build | 4 + dom/push/test/xpcshell/head.js | 450 +++++++++++++++++++++ dom/push/test/xpcshell/test_notification_ack.js | 127 ++++++ .../test/xpcshell/test_notification_duplicate.js | 82 ++++ dom/push/test/xpcshell/test_notification_error.js | 127 ++++++ .../test/xpcshell/test_notification_incomplete.js | 109 +++++ .../xpcshell/test_notification_version_string.js | 72 ++++ dom/push/test/xpcshell/test_register_case.js | 64 +++ dom/push/test/xpcshell/test_register_flush.js | 103 +++++ .../test/xpcshell/test_register_invalid_channel.js | 60 +++ .../xpcshell/test_register_invalid_endpoint.js | 62 +++ .../test/xpcshell/test_register_invalid_json.js | 61 +++ dom/push/test/xpcshell/test_register_no_id.js | 65 +++ .../test/xpcshell/test_register_request_queue.js | 65 +++ dom/push/test/xpcshell/test_register_rollback.js | 88 ++++ dom/push/test/xpcshell/test_register_success.js | 76 ++++ dom/push/test/xpcshell/test_register_timeout.js | 102 +++++ dom/push/test/xpcshell/test_register_wrong_id.js | 71 ++++ dom/push/test/xpcshell/test_register_wrong_type.js | 67 +++ dom/push/test/xpcshell/test_registration_error.js | 39 ++ .../xpcshell/test_registration_missing_scope.js | 28 ++ dom/push/test/xpcshell/test_registration_none.js | 28 ++ .../test/xpcshell/test_registration_success.js | 67 +++ .../test/xpcshell/test_unregister_empty_scope.js | 37 ++ dom/push/test/xpcshell/test_unregister_error.js | 65 +++ .../test/xpcshell/test_unregister_invalid_json.js | 78 ++++ .../test/xpcshell/test_unregister_not_found.js | 35 ++ dom/push/test/xpcshell/test_unregister_success.js | 60 +++ dom/push/test/xpcshell/xpcshell.ini | 32 ++ 29 files changed, 2324 insertions(+) create mode 100644 dom/push/test/xpcshell/head.js create mode 100644 dom/push/test/xpcshell/test_notification_ack.js create mode 100644 dom/push/test/xpcshell/test_notification_duplicate.js create mode 100644 dom/push/test/xpcshell/test_notification_error.js create mode 100644 dom/push/test/xpcshell/test_notification_incomplete.js create mode 100644 dom/push/test/xpcshell/test_notification_version_string.js create mode 100644 dom/push/test/xpcshell/test_register_case.js create mode 100644 dom/push/test/xpcshell/test_register_flush.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_channel.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_endpoint.js create mode 100644 dom/push/test/xpcshell/test_register_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_register_no_id.js create mode 100644 dom/push/test/xpcshell/test_register_request_queue.js create mode 100644 dom/push/test/xpcshell/test_register_rollback.js create mode 100644 dom/push/test/xpcshell/test_register_success.js create mode 100644 dom/push/test/xpcshell/test_register_timeout.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_id.js create mode 100644 dom/push/test/xpcshell/test_register_wrong_type.js create mode 100644 dom/push/test/xpcshell/test_registration_error.js create mode 100644 dom/push/test/xpcshell/test_registration_missing_scope.js create mode 100644 dom/push/test/xpcshell/test_registration_none.js create mode 100644 dom/push/test/xpcshell/test_registration_success.js create mode 100644 dom/push/test/xpcshell/test_unregister_empty_scope.js create mode 100644 dom/push/test/xpcshell/test_unregister_error.js create mode 100644 dom/push/test/xpcshell/test_unregister_invalid_json.js create mode 100644 dom/push/test/xpcshell/test_unregister_not_found.js create mode 100644 dom/push/test/xpcshell/test_unregister_success.js create mode 100644 dom/push/test/xpcshell/xpcshell.ini
2015-04-21 18:10:50 +00:00
});