Skip to content

Commit 694ffe1

Browse files
Testing server communication is irrelevant now
1 parent 42d102a commit 694ffe1

File tree

3 files changed

+8
-61
lines changed

3 files changed

+8
-61
lines changed

Gruntfile.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,7 @@ module.exports = function (grunt) {
7373
base: ['.', 'test'],
7474
open: 'http://127.0.0.1:10000',
7575
keepalive: true,
76-
livereload: true,
77-
middleware: function(connect, options, middlewares) {
78-
// Log the information when cookies are sent to the server
79-
middlewares.unshift(function(request, response, next) {
80-
if ( request.headers.cookie ) {
81-
console.log('Cookie: ' + request.headers.cookie);
82-
}
83-
return next();
84-
});
85-
return middlewares;
86-
}
76+
livereload: true
8777
}
8878
}
8979
},

test/index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
</head>
1212
<body>
1313
<div id="qunit"></div>
14-
<div id="qunit-fixture">
15-
<form id="post_form" action="" target="post_iframe"></form>
16-
<iframe id='post_iframe' name="post_iframe"></iframe>
17-
</div>
14+
<div id="qunit-fixture"></div>
1815
</body>
1916
</html>

test/tests.js

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@
3333
});
3434
}());
3535

36-
window.submitToServer = function () {
37-
stop();
38-
return {
39-
then: function (afterLoading) {
40-
var iframe = document.getElementById('post_iframe');
41-
var form = document.getElementById('post_form');
42-
iframe.onload = function () {
43-
start();
44-
afterLoading.call(null, iframe.contentWindow.Cookies);
45-
};
46-
form.action = 'post_iframe.html?bust='.concat(+new Date());
47-
form.submit();
48-
}
49-
};
50-
};
51-
5236
var lifecycle = {
5337
teardown: function () {
5438
Cookies.defaults = {};
@@ -375,7 +359,7 @@ test('RFC 6265 - disallowed characters in cookie-name', function () {
375359
Cookies.remove(' ');
376360
});
377361

378-
test('cookie-name - browser processing for 2 bytes characters', function () {
362+
test('cookie-name - 2 bytes characters', function () {
379363
expect(2);
380364

381365
Cookies.set('ã', 'v');
@@ -384,7 +368,7 @@ test('cookie-name - browser processing for 2 bytes characters', function () {
384368
Cookies.remove('ã');
385369
});
386370

387-
test('cookie-name - browser processing for 3 bytes characters', function () {
371+
test('cookie-name - 3 bytes characters', function () {
388372
expect(2);
389373

390374
Cookies.set('₯', 'v');
@@ -393,7 +377,7 @@ test('cookie-name - browser processing for 3 bytes characters', function () {
393377
Cookies.remove('₯');
394378
});
395379

396-
test('cookie-name - browser processing for 4 bytes characters', function () {
380+
test('cookie-name - 4 bytes characters', function () {
397381
expect(2);
398382

399383
Cookies.set('𩸽', 'v');
@@ -402,7 +386,7 @@ test('cookie-name - browser processing for 4 bytes characters', function () {
402386
Cookies.remove('𩸽');
403387
});
404388

405-
test('cookie-value - browser processing for 2 bytes characters', function () {
389+
test('cookie-value - 2 bytes characters', function () {
406390
expect(2);
407391

408392
Cookies.set('c', 'ã');
@@ -411,7 +395,7 @@ test('cookie-value - browser processing for 2 bytes characters', function () {
411395
Cookies.remove('c');
412396
});
413397

414-
test('cookie-value - browser processing for 3 bytes characters', function () {
398+
test('cookie-value - 3 bytes characters', function () {
415399
expect(2);
416400

417401
Cookies.set('c', '₯');
@@ -420,7 +404,7 @@ test('cookie-value - browser processing for 3 bytes characters', function () {
420404
Cookies.remove('c');
421405
});
422406

423-
test('cookie-value - browser processing for 4 bytes characters', function () {
407+
test('cookie-value - 4 bytes characters', function () {
424408
expect(2);
425409

426410
Cookies.set('c', '𩸽');
@@ -429,30 +413,6 @@ test('cookie-value - browser processing for 4 bytes characters', function () {
429413
Cookies.remove('c');
430414
});
431415

432-
//test('server processing for 2 bytes characters', function () {
433-
// expect(1);
434-
// Cookies.set('ã', 'ã');
435-
// window.submitToServer().then(function (Cookies) {
436-
// strictEqual(Cookies.get('ã'), 'ã', 'should handle ã character');
437-
// });
438-
//});
439-
//
440-
//test('server processing for 3 bytes characters', function () {
441-
// expect(1);
442-
// Cookies.set('₯', '₯');
443-
// window.submitToServer().then(function (Cookies) {
444-
// strictEqual(Cookies.get('₯'), '₯', 'should handle ₯ character');
445-
// });
446-
//});
447-
//
448-
//test('server processing for 4 bytes characters', function () {
449-
// expect(1);
450-
// Cookies.set('𩸽', '𩸽');
451-
// window.submitToServer().then(function (Cookies) {
452-
// strictEqual(Cookies.get('𩸽'), '𩸽', 'should handle 𩸽 character');
453-
// });
454-
//});
455-
456416
module('removeCookie', lifecycle);
457417

458418
test('deletion', function () {

0 commit comments

Comments
 (0)