michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function testEntryPoint(aRoot) { michael@0: do_check_true(aRoot.name == "hello world"); michael@0: do_check_true(aRoot.description == "A bold name"); michael@0: do_check_true(aRoot.developer.name == "Blink Inc."); michael@0: michael@0: let permissions = aRoot.permissions; michael@0: do_check_true(permissions.contacts.description == "Required for autocompletion in the share screen"); michael@0: do_check_true(permissions.alarms.description == "Required to schedule notifications"); michael@0: } michael@0: michael@0: function run_test() { michael@0: Components.utils.import("resource:///modules/AppsUtils.jsm"); michael@0: michael@0: do_check_true(!!AppsUtils); michael@0: michael@0: // Test manifest, with one entry point. michael@0: let manifest = { michael@0: name: "hello world", michael@0: description: "A bold name", michael@0: developer: { michael@0: name: "Blink Inc.", michael@0: url: "http://blink.org" michael@0: }, michael@0: permissions : { michael@0: "contacts": { michael@0: "description": "Required for autocompletion in the share screen", michael@0: "access": "readcreate" michael@0: }, michael@0: "alarms": { michael@0: "description": "Required to schedule notifications" michael@0: } michael@0: }, michael@0: michael@0: entry_points: { michael@0: "subapp": { michael@0: name: "hello world", michael@0: description: "A bold name", michael@0: developer: { michael@0: name: "Blink Inc.", michael@0: url: "http://blink.org" michael@0: }, michael@0: permissions : { michael@0: "contacts": { michael@0: "description": "Required for autocompletion in the share screen", michael@0: "access": "readcreate" michael@0: }, michael@0: "alarms": { michael@0: "description": "Required to schedule notifications" michael@0: } michael@0: } michael@0: } michael@0: } michael@0: } michael@0: michael@0: AppsUtils.sanitizeManifest(manifest); michael@0: michael@0: // Check the main section and the subapp entry point. michael@0: testEntryPoint(manifest); michael@0: testEntryPoint(manifest.entry_points.subapp); michael@0: }