Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 base.dispose(obj); | 49 base.dispose(obj); |
| 50 sinon.assert.called(obj.dispose); | 50 sinon.assert.called(obj.dispose); |
| 51 }); | 51 }); |
| 52 | 52 |
| 53 test('dispose(obj) should not crash if |obj| is null', | 53 test('dispose(obj) should not crash if |obj| is null', |
| 54 function() { | 54 function() { |
| 55 expect(0); | 55 expect(0); |
| 56 base.dispose(null); | 56 base.dispose(null); |
| 57 }); | 57 }); |
| 58 | 58 |
| 59 test('urljoin(url, opt_param) should return url if |opt_param| is missing', | |
| 60 function() { | |
| 61 QUnit.equal( | |
| 62 base.urlJoin('http://www.chromium.org'), 'http://www.chromium.org'); | |
| 63 }); | |
| 64 | |
| 65 test('urljoin(url, opt_param) should urlencode |opt_param|', | |
| 66 function() { | |
| 67 var result = base.urlJoin('http://www.chromium.org', { | |
| 68 a: 'a', | |
| 69 foo: 'foo=' | |
|
Jamie
2014/08/12 20:42:55
Can you add a few more escape-requiring characters
kelvinp
2014/08/12 21:42:43
Done.
| |
| 70 }); | |
| 71 QUnit.equal(result, 'http://www.chromium.org?a=a&foo=foo%3D'); | |
| 72 }); | |
| 73 | |
| 59 QUnit.asyncTest('Promise.sleep(delay) should fulfill the promise after |delay|', | 74 QUnit.asyncTest('Promise.sleep(delay) should fulfill the promise after |delay|', |
| 60 function() { | 75 function() { |
| 61 var isCalled = false; | 76 var isCalled = false; |
| 62 var clock = this.clock; | 77 var clock = this.clock; |
| 63 | 78 |
| 64 base.Promise.sleep(100).then(function(){ | 79 base.Promise.sleep(100).then(function(){ |
| 65 isCalled = true; | 80 isCalled = true; |
| 66 ok(true, 'Promise.sleep() is fulfilled after delay.'); | 81 ok(true, 'Promise.sleep() is fulfilled after delay.'); |
| 67 QUnit.start(); | 82 QUnit.start(); |
| 68 }); | 83 }); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 | 190 |
| 176 source.addEventListener('foo', sink.listener); | 191 source.addEventListener('foo', sink.listener); |
| 177 source.raiseEvent('foo'); | 192 source.raiseEvent('foo'); |
| 178 sinon.assert.calledOnce(sink.listener); | 193 sinon.assert.calledOnce(sink.listener); |
| 179 | 194 |
| 180 source.raiseEvent('foo'); | 195 source.raiseEvent('foo'); |
| 181 sinon.assert.calledOnce(sink.listener); | 196 sinon.assert.calledOnce(sink.listener); |
| 182 }); | 197 }); |
| 183 | 198 |
| 184 })(); | 199 })(); |
| OLD | NEW |