Skip to content

Commit e3daa52

Browse files
committed
Update latest qunit
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
1 parent 280b757 commit e3daa52

File tree

4 files changed

+58
-58
lines changed

4 files changed

+58
-58
lines changed

jquery.eventsource.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* jQuery.EventSource (jQuery.eventsource)
3-
*
3+
*
44
* Copyright (c) 2011 Rick Waldron
55
* Dual licensed under the MIT and GPL licenses.
66
*/
@@ -12,7 +12,7 @@
1212
});
1313

1414
var stream = {
15-
15+
1616
defaults: {
1717
// Stream identity
1818
label: null,
@@ -23,7 +23,7 @@
2323
message: jQuery.noop
2424
},
2525
setup: {
26-
stream: {},
26+
stream: {},
2727
lastEventId: 0,
2828
isHostApi: false,
2929
retry: 500,
@@ -65,7 +65,7 @@
6565
stream.cache = tmp;
6666

6767
return stream.cache;
68-
},
68+
},
6969
streams: function( label ) {
7070

7171
if ( !label || label === "*" ) {
@@ -77,7 +77,7 @@
7777
},
7878
_private: {
7979

80-
// Open a host api event source
80+
// Open a host api event source
8181
openEventSource: function( options ) {
8282
var label = options.label;
8383

@@ -91,7 +91,7 @@
9191
}, false);
9292

9393
stream.cache[label].stream.addEventListener("message", function(event) {
94-
94+
9595
var streamData = [];
9696

9797
if ( stream.cache[ label ] ) {
@@ -107,12 +107,12 @@
107107
lastEventId: stream.cache[ label ].lastEventId
108108
}, event);
109109

110-
// TODO: Add custom event triggering
110+
// TODO: Add custom event triggering
111111
}
112112
}, false);
113113

114114
return stream.cache[ label ].stream;
115-
},
115+
},
116116
// open fallback event source
117117
openPollingSource: function( options ) {
118118
var label = options.label,
@@ -139,7 +139,7 @@
139139
return !!sdata && sdata;
140140
}),
141141
idx = 0, length = streamData.length,
142-
rretryprefix = /retry/,
142+
rretryprefix = /retry/,
143143
retries;
144144

145145
if ( jQuery.isArray( streamData ) ) {
@@ -148,7 +148,7 @@
148148

149149
if ( streamData[ idx ] ) {
150150

151-
if ( rretryprefix.test( streamData[ idx ] ) &&
151+
if ( rretryprefix.test( streamData[ idx ] ) &&
152152
(retries = streamData[ idx ].split("retry: ")).length ) {
153153

154154
if ( retries.length === 2 && !retries[ 0 ] ) {
@@ -207,15 +207,15 @@
207207
// Plugin sub function
208208
if ( options && !jQuery.isPlainObject( options ) && pluginFns.public[ options ] ) {
209209
// If no label was passed, send message to all streams
210-
return pluginFns.public[ options ](
210+
return pluginFns.public[ options ](
211211
arguments[1] ?
212212
arguments[1] :
213213
"*"
214214
);
215215
}
216216

217217
// If params were passed in as an object, normalize to a query string
218-
options.data = options.data && jQuery.isPlainObject( options.data ) ?
218+
options.data = options.data && jQuery.isPlainObject( options.data ) ?
219219
jQuery.param( options.data ) :
220220
options.data;
221221

@@ -240,7 +240,7 @@
240240
};
241241

242242

243-
// Determine and declare `event stream` source,
243+
// Determine and declare `event stream` source,
244244
// whether will be host api or XHR fallback
245245
streamType = !isHostApi ?
246246
// If not host api, open a polling fallback

test/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<head>
44
<meta charset="UTF-8" />
55
<title>jquery.eventsource.unit</title>
6-
7-
<link href="qunit/qunit.css" rel="stylesheet">
6+
7+
<link href="http://code.jquery.com/qunit/qunit-git.css" rel="stylesheet">
88

99
<script src="http://code.jquery.com/jquery.js"></script>
10-
<script src="qunit/qunit.js"></script>
11-
10+
<script src="http://code.jquery.com/qunit/qunit-git.js"></script>
11+
1212
<script src="../jquery.eventsource.js"></script>
1313
<script src="jquery.eventsource.unit.js"></script>
1414

@@ -23,7 +23,7 @@ <h2 id="qunit-userAgent"></h2>
2323
</div>
2424

2525
</body>
26-
26+
2727
<iframe src="specit.html" style="width:100%;height:600px;border:0px;"></iframe>
28-
28+
2929
</html>

test/jquery.eventsource.unit.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function sizeOf(obj) {
1010

1111
$(function() {
1212

13-
var params = location.search.slice( 1 ).split( "&" ),
13+
var params = location.search.slice( 1 ).split( "&" ),
1414
pairs = {};
1515

1616
$.each( params, function(idx, param) {
@@ -29,10 +29,10 @@ $(function() {
2929
test("is a function", function() {
3030

3131
expect(7);
32-
32+
3333
ok( jQuery.eventsource, "exists" );
3434
equal( typeof jQuery.eventsource, "function", "jQuery.eventsource() is a Function" );
35-
35+
3636
ok( jQuery.eventsource.streams, "jQuery.eventsource.streams exists" );
3737
equal( typeof jQuery.eventsource.streams, "function", "jQuery.eventsource.streams() is a Function" );
3838

@@ -42,21 +42,21 @@ test("is a function", function() {
4242
equal( sizeOf( jQuery.eventsource.streams() ), 0, "There are no streams");
4343

4444
});
45-
46-
test("callbacks", function() {
47-
48-
var expects = 12,
45+
46+
test("callbacks", function() {
47+
48+
var expects = 12,
4949
count = 0;
5050

5151
expect( expects );
52-
53-
function plus() {
52+
53+
function plus() {
5454
if ( ++count === expects ) {
55-
start();
55+
start();
5656
}
5757
}
5858

59-
function okPlus() {
59+
function okPlus() {
6060
ok.apply(null, arguments);
6161
plus();
6262
}
@@ -71,10 +71,10 @@ test("callbacks", function() {
7171
},
7272
message: function(data) {
7373
okPlus( true, "#1 fires onmessage callback" );
74-
74+
7575
okPlus( data, "#1 returns data");
76-
77-
okPlus( typeof jQuery.eventsource("close", "text-event-source") === "object", 'jQuery.eventsource("close", "text-event-source") must return an object' );
76+
77+
okPlus( typeof jQuery.eventsource("close", "text-event-source") === "object", 'jQuery.eventsource("close", "text-event-source") must return an object' );
7878
}
7979
});
8080

@@ -90,11 +90,11 @@ test("callbacks", function() {
9090

9191
okPlus( true, "#2 fires onmessage callback" );
9292
okPlus( data, "#2 returns data");
93-
okPlus( typeof jQuery.eventsource("close", "text-event-source-ct") === "object", 'jQuery.eventsource("close", "text-event-source-ct") must return an object' );
93+
okPlus( typeof jQuery.eventsource("close", "text-event-source-ct") === "object", 'jQuery.eventsource("close", "text-event-source-ct") must return an object' );
9494

9595
}
9696
});
97-
97+
9898
// PLAIN TEXT EXAMPLE HAS CONTENT TYPE
9999

100100
jQuery.eventsource({
@@ -108,7 +108,7 @@ test("callbacks", function() {
108108

109109
okPlus( true, "#3 fires onmessage callback" );
110110
okPlus( data, "#3 returns data");
111-
okPlus( typeof jQuery.eventsource("close", "json-event-source") === "object", 'jQuery.eventsource("close", "json-event-source") must return an object' );
111+
okPlus( typeof jQuery.eventsource("close", "json-event-source") === "object", 'jQuery.eventsource("close", "json-event-source") must return an object' );
112112

113113
}
114114
});
@@ -156,15 +156,15 @@ test("open/close", function() {
156156

157157

158158
test("multiple concurrent sources scope tests", function() {
159-
var expects = 12,
160-
count = 0,
159+
var expects = 12,
160+
count = 0,
161161
down = 3;
162162

163163
expect( expects );
164164

165-
function plus() {
165+
function plus() {
166166
if ( ++count === expects ) {
167-
start();
167+
start();
168168
}
169169
}
170170

@@ -200,18 +200,18 @@ test("multiple concurrent sources scope tests", function() {
200200

201201
test("breakage tests", function() {
202202

203-
var expects = 7,
203+
var expects = 7,
204204
count = 0;
205205

206206
expect( expects );
207-
208-
function plus() {
207+
208+
function plus() {
209209
if ( ++count === expects ) {
210210
start();
211211
}
212212
}
213213

214-
function okPlus() {
214+
function okPlus() {
215215
ok.apply(null, arguments);
216216
plus();
217217
}
@@ -292,7 +292,7 @@ test("breakage tests", function() {
292292
}
293293
});
294294

295-
test("streams object", function() {
295+
test("streams object", function() {
296296

297297
var expects = 13,
298298
count = 0;
@@ -408,24 +408,24 @@ test("settable retry time in ms", function() {
408408

409409
test("streams Are Closed", function() {
410410

411-
var expects = 2,
411+
var expects = 2,
412412
count = 0;
413413

414414
expect( expects );
415-
416-
function plus() {
415+
416+
function plus() {
417417
if ( ++count === expects ) {
418-
start();
418+
start();
419419
}
420420
}
421421

422422
stop();
423423

424424
jQuery.eventsource.close();
425-
425+
426426
equal(sizeOf(jQuery.eventsource.streams()), 0, "there are 0 active streams");
427427
plus();
428428

429-
ok( typeof jQuery.eventsource.streams() === "object", 'jQuery.eventsource.streams() must return an object' );
429+
ok( typeof jQuery.eventsource.streams() === "object", 'jQuery.eventsource.streams() must return an object' );
430430
plus();
431431
});

test/specit.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
<head>
44
<meta charset="UTF-8" />
55
<title>jquery.eventsource.specit</title>
6-
7-
<link href="qunit/qunit.css" rel="stylesheet">
6+
7+
<link href="http://code.jquery.com/qunit/qunit-git.css" rel="stylesheet">
88
<script src="http://code.jquery.com/jquery.js"></script>
99
<script src="qunit/qunit.js"></script>
1010

1111
<script src="//github.com/joshuaclayton/specit/raw/master/specit.js"></script>
12-
12+
1313
<script src="../jquery.eventsource.js"></script>
1414
<script src="jquery.eventsource.specit.js"></script>
15-
15+
1616
<script>
17-
17+
1818
$(function () {
1919

2020
if(top.location != location) {
21-
21+
2222
$('body').css({
2323
marginLeft: '0px',
2424
marginTop: '0px'
2525
});
26-
26+
2727
}
2828
});
2929
</script>

0 commit comments

Comments
 (0)