~ubuntu-branches/ubuntu/quantal/maas/quantal-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/tests/io/tests/transactionevents.html

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!doctype html>
2
 
<html>
3
 
<head>
4
 
<title>YUI io Transaction Events Tests</title>
5
 
</head>
6
 
 
7
 
<body class="yui3-skin-sam">
8
 
<h1>YUI io Transaction Events Tests</h1>
9
 
 
10
 
<script type="text/javascript" src="../../../build/yui/yui.js"></script>
11
 
<script type="text/javascript">
12
 
 
13
 
(function() {
14
 
    YUI({
15
 
        base: "../../../build/",
16
 
        filter: "debug",
17
 
        logExclude: {
18
 
            attribute: true,
19
 
            dom: true,
20
 
            node: true,
21
 
            event: true,
22
 
            base: true,
23
 
            widget: true,
24
 
            selector: true,
25
 
            io: true
26
 
        },
27
 
        useConsole: true
28
 
    }).use("test", "console", "io-base", function(Y) {
29
 
 
30
 
        var console = new Y.Console().render();
31
 
                var ioTransactionEventFlowTest = new Y.Test.Case(
32
 
        {
33
 
                name: 'Transaction flow test',
34
 
                testSuccess: function() {
35
 
                        var actual = [], t = this;
36
 
                        this.success = ['start', 'complete', 'success', 'end'],
37
 
                        this.compare = function() {
38
 
                                        for (var i=0; i < 4; i++) {
39
 
                                                Y.log(actual[i]);
40
 
                                                Y.Assert.areSame(t.success[i], actual[i]);
41
 
                                        }
42
 
                        };
43
 
                        Y.io('http.php?a=200', {
44
 
                                on: {
45
 
                                        start: function() {
46
 
                                                actual.push('start');
47
 
                                        },
48
 
                                        complete: function() {
49
 
                                                actual.push('complete');
50
 
                                        },
51
 
                                        success: function() {
52
 
                                                actual.push('success');
53
 
                                        },
54
 
                                        end: function() {
55
 
                                                actual.push('end');
56
 
                                                t.resume(t.compare);
57
 
                                        }
58
 
                                }
59
 
                        });
60
 
                        this.wait(null, 1000);
61
 
                },
62
 
                test404Failure: function() {
63
 
                        var actual = [], t = this;
64
 
                        this.failure = ['start', 'complete', 'failure', 'end'],
65
 
                        this.compare = function() {
66
 
                                        for (var i=0; i < 4; i++) {
67
 
                                                Y.log(actual[i]);
68
 
                                                Y.Assert.areSame(t.failure[i], actual[i]);
69
 
                                        }
70
 
                        };
71
 
                        Y.io('404.html', {
72
 
                                on: {
73
 
                                        start: function() {
74
 
                                                actual.push('start');
75
 
                                        },
76
 
                                        complete: function() {
77
 
                                                actual.push('complete');
78
 
                                        },
79
 
                                        failure: function() {
80
 
                                                actual.push('failure');
81
 
                                        },
82
 
                                        end: function() {
83
 
                                                actual.push('end');
84
 
                                                t.resume(t.compare);
85
 
                                        }
86
 
                                }
87
 
                        });
88
 
                        this.wait(null, 1000);
89
 
                },
90
 
                test500Failure: function() {
91
 
                        var actual = [], t = this;
92
 
                        this.failure = ['start', 'complete', 'failure', 'end'],
93
 
                        this.compare = function() {
94
 
                                        Y.Assert.areSame(500, t.status);
95
 
                                        for (var i=0; i < 4; i++) {
96
 
                                                Y.Assert.areSame(t.failure[i], actual[i]);
97
 
                                        }
98
 
                        };
99
 
                        Y.io('http.php?a=500', {
100
 
                                on: {
101
 
                                        start: function() {
102
 
                                                actual.push('start');
103
 
                                        },
104
 
                                        complete: function(id, o, a) {
105
 
                                                actual.push('complete');
106
 
                                        },
107
 
                                        failure: function(id, o, a) {
108
 
                                                actual.push('failure');
109
 
                                                t.status = o.status;
110
 
                                        },
111
 
                                        end: function() {
112
 
                                                actual.push('end');
113
 
                                                t.resume(t.compare);
114
 
                                        }
115
 
                                }
116
 
                        });
117
 
                        this.wait(null, 1000);
118
 
                },
119
 
                testHttpException: function() {
120
 
                        var actual = [], t = this;
121
 
                        this.failure = ['start', 'complete', 'failure', 'end'],
122
 
                        this.compare = function() {
123
 
                                Y.log(t.status);
124
 
                                        for (var i=0; i < 4; i++) {
125
 
                                                Y.Assert.areSame(t.failure[i], actual[i]);
126
 
                                        }
127
 
                        };
128
 
                        Y.io('http.php?a=999', {
129
 
                                on: {
130
 
                                        start: function() {
131
 
                                                actual.push('start');
132
 
                                        },
133
 
                                        complete: function() {
134
 
                                                actual.push('complete');
135
 
                                        },
136
 
                                        failure: function(id, o, a) {
137
 
                                                actual.push('failure');
138
 
                                                t.status = o.status;
139
 
                                        },
140
 
                                        end: function() {
141
 
                                                actual.push('end');
142
 
                                                t.resume(t.compare);
143
 
                                        }
144
 
                                }
145
 
                        });
146
 
                        this.wait(null, 1000);
147
 
                },
148
 
                test304: function() {
149
 
                        var actual = [], t = this;
150
 
                        this.success = ['start', 'complete', 'end'],
151
 
                        this.compare = function() {
152
 
                                Y.log(t.status);
153
 
                                        for (var i=0; i < 3; i++) {
154
 
                                                Y.Assert.areSame(t.success[i], actual[i]);
155
 
                                        }
156
 
                        };
157
 
                        Y.io('http.php?a=304', {
158
 
                                on: {
159
 
                                        start: function() {
160
 
                                                actual.push('start');
161
 
                                        },
162
 
                                        complete: function() {
163
 
                                                actual.push('complete');
164
 
                                        },
165
 
                                        end: function() {
166
 
                                                actual.push('end');
167
 
                                                t.resume(t.compare);
168
 
                                        }
169
 
                                }
170
 
                        });
171
 
                        this.wait(null, 1000);
172
 
                }
173
 
        });
174
 
                Y.Test.Runner.add(ioTransactionEventFlowTest);
175
 
                Y.Test.Runner.run();
176
 
        })
177
 
})();
178
 
</script>
179
 
</body>
180
 
</html>