OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function() { | 5 (function() { |
6 | 6 |
7 'use strict'; | 7 'use strict'; |
8 | 8 |
9 module('base'); | 9 module('base'); |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 a: 'a', | 68 a: 'a', |
69 foo: 'foo', | 69 foo: 'foo', |
70 escapist: ':/?#[]@$&+,;=' | 70 escapist: ':/?#[]@$&+,;=' |
71 }); | 71 }); |
72 QUnit.equal( | 72 QUnit.equal( |
73 result, | 73 result, |
74 'http://www.chromium.org?a=a&foo=foo' + | 74 'http://www.chromium.org?a=a&foo=foo' + |
75 '&escapist=%3A%2F%3F%23%5B%5D%40%24%26%2B%2C%3B%3D'); | 75 '&escapist=%3A%2F%3F%23%5B%5D%40%24%26%2B%2C%3B%3D'); |
76 }); | 76 }); |
77 | 77 |
78 test('escapeHTML(str) should escape special characters', function() { | |
79 QUnit.equal( | |
80 base.escapeHTML('<script>alert("hello")</script>'), | |
81 '<script>alert("hello")</script>'); | |
Jamie
2014/08/26 00:54:21
Are there any other characters that should be esca
| |
82 }); | |
83 | |
78 QUnit.asyncTest('Promise.sleep(delay) should fulfill the promise after |delay|', | 84 QUnit.asyncTest('Promise.sleep(delay) should fulfill the promise after |delay|', |
79 function() { | 85 function() { |
80 var isCalled = false; | 86 var isCalled = false; |
81 var clock = this.clock; | 87 var clock = this.clock; |
82 | 88 |
83 base.Promise.sleep(100).then(function(){ | 89 base.Promise.sleep(100).then(function(){ |
84 isCalled = true; | 90 isCalled = true; |
85 ok(true, 'Promise.sleep() is fulfilled after delay.'); | 91 ok(true, 'Promise.sleep() is fulfilled after delay.'); |
86 QUnit.start(); | 92 QUnit.start(); |
87 }); | 93 }); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 | 232 |
227 source.addEventListener('foo', sink.listener); | 233 source.addEventListener('foo', sink.listener); |
228 source.raiseEvent('foo'); | 234 source.raiseEvent('foo'); |
229 sinon.assert.calledOnce(sink.listener); | 235 sinon.assert.calledOnce(sink.listener); |
230 | 236 |
231 source.raiseEvent('foo'); | 237 source.raiseEvent('foo'); |
232 sinon.assert.calledOnce(sink.listener); | 238 sinon.assert.calledOnce(sink.listener); |
233 }); | 239 }); |
234 | 240 |
235 })(); | 241 })(); |
OLD | NEW |