Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 91 lines (74 sloc) 3.166 kB
5a48736 @dclarke a suite with no doctest
authored
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
474c934 @dclarke app review, clean up
authored
4
5 <!-- Any copyright is dedicated to the Public Domain.
6 - http://creativecommons.org/publicdomain/zero/1.0/
7 - https://bugzilla.mozilla.org/show_bug.cgi?id=741549
5a48736 @dclarke a suite with no doctest
authored
8 -->
474c934 @dclarke app review, clean up
authored
9
5a48736 @dclarke a suite with no doctest
authored
10 <window title="Mozilla Bug "
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
12 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
13 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
14 <script type="application/javascript" src="apphelper.js"/>
d403d5c @dclarke latest installment of changes
authored
15 <script type="application/javascript" src="jshelper.js"/>
5a48736 @dclarke a suite with no doctest
authored
16 <!-- test results are displayed in the html:body -->
17 <body xmlns="http://www.w3.org/1999/xhtml">
18 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id="
19 target="_blank">Mozilla Bug </a>
d318f19 @dclarke one test failed, on tryserver
authored
20 <iframe id="no_delegated_install" onload="go();" src="http://sub2.test2.example.org:80/chrome/dom/tests/mochitest/webapps/apps/include.html"/>
5a48736 @dclarke a suite with no doctest
authored
21 </body>
22
588a400 @dclarke changes due to review
authored
23 <script>
5a48736 @dclarke a suite with no doctest
authored
24
d318f19 @dclarke one test failed, on tryserver
authored
25 function go() {
26 runAll(steps);
27 }
5a48736 @dclarke a suite with no doctest
authored
28
d403d5c @dclarke latest installment of changes
authored
29 steps = [setUp, no_args, parse_error, invalid_manifest, permission_denied, invalid_content,
3d97355 @dclarke last push
authored
30 mgmt_api_errors, mgmt_api_add_listener, tearDown];
d403d5c @dclarke latest installment of changes
authored
31
32 function setUp(next) {
474c934 @dclarke app review, clean up
authored
33 debug("in " + arguments.callee.name);
d403d5c @dclarke latest installment of changes
authored
34 uninstallAll(next);
35 }
36
37 function no_args(next) {
474c934 @dclarke app review, clean up
authored
38 debug("in " + arguments.callee.name);
d403d5c @dclarke latest installment of changes
authored
39 try {
40 navigator.mozApps.install();
41 } catch (e) {
42 ok(e.message == "Not enough arguments \[mozIDOMApplicationRegistry.install\]", "install returned " + e.message);
43 next();
44 }
5a48736 @dclarke a suite with no doctest
authored
45 }
46
d403d5c @dclarke latest installment of changes
authored
47 function parse_error(next) {
474c934 @dclarke app review, clean up
authored
48 debug("in " + arguments.callee.name);
d403d5c @dclarke latest installment of changes
authored
49 mozAppscb(navigator.mozApps.install(SERVERS['json_syntax_error'], null),
50 [{ status: "== \"error\"",
3d97355 @dclarke last push
authored
51 name: "== \"MANIFEST_PARSE_ERROR\""}], ok, next);
d403d5c @dclarke latest installment of changes
authored
52 }
0f95923 @dclarke several error conditions + install - working
authored
53
d403d5c @dclarke latest installment of changes
authored
54 function invalid_manifest(next) {
474c934 @dclarke app review, clean up
authored
55 debug("in " + arguments.callee.name);
d403d5c @dclarke latest installment of changes
authored
56 mozAppscb(navigator.mozApps.install(SERVERS['missing_required_field'], null),
57 [{ status: "== \"error\"",
3d97355 @dclarke last push
authored
58 name: "== \"INVALID_MANIFEST\""}], ok, next);
d403d5c @dclarke latest installment of changes
authored
59 }
0f95923 @dclarke several error conditions + install - working
authored
60
d403d5c @dclarke latest installment of changes
authored
61 function permission_denied(next) {
474c934 @dclarke app review, clean up
authored
62 debug("in " + arguments.callee.name);
d403d5c @dclarke latest installment of changes
authored
63 mozAppscb(navigator.mozApps.install(SERVERS['no_delegated_install'], null),
64 [{ status: "== \"error\"",
05cbf38 @dclarke try server build fixes
authored
65 name: "== \"DENIED\""}], todo, next);
d403d5c @dclarke latest installment of changes
authored
66 }
67
68 function invalid_content(next) {
474c934 @dclarke app review, clean up
authored
69 debug("in " + arguments.callee.name);
d403d5c @dclarke latest installment of changes
authored
70 mozAppscb(navigator.mozApps.install(SERVERS['bad_content_type'], null),
71 [{ status: "== \"error\"",
3d97355 @dclarke last push
authored
72 name: "== \"INVALID_MANIFEST\""}], todo, next);
d403d5c @dclarke latest installment of changes
authored
73 }
74
3d97355 @dclarke last push
authored
75 function mgmt_api_errors(next) {
474c934 @dclarke app review, clean up
authored
76 debug("in " + arguments.callee.name);
3d97355 @dclarke last push
authored
77 onIframeLoad("no_delegated_install", ok, next);
d403d5c @dclarke latest installment of changes
authored
78 document.getElementById("no_delegated_install").contentWindow.postMessage("mgmt.getAll", '*');
79 }
987a049 @dclarke updates to have errors, test case fail more gracefully.
authored
80
3d97355 @dclarke last push
authored
81 function mgmt_api_add_listener(next) {
474c934 @dclarke app review, clean up
authored
82 debug("in " + arguments.callee.name);
3d97355 @dclarke last push
authored
83 onIframeLoad("no_delegated_install", todo, next);
84 document.getElementById("no_delegated_install").contentWindow.postMessage("mgmt.event_error", '*');
85 }
86
5a48736 @dclarke a suite with no doctest
authored
87 </script>
88
89 </window>
90
Something went wrong with that request. Please try again.