OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/tracing/base/utils.html"> | 7 <link rel="import" href="/tracing/base/utils.html"> |
8 | 8 |
9 <script> | 9 <script> |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
12 tr.b.unittest.testSuite(function() { | 12 tr.b.unittest.testSuite(function() { |
13 test('getUsingPath', function() { | 13 test('getUsingPath', function() { |
14 var z = tr.b.getUsingPath('x.y.z', {'x': {'y': {'z': 3}}}); | 14 var z = tr.b.getUsingPath('x.y.z', {'x': {'y': {'z': 3}}}); |
15 assert.equal(z, 3); | 15 assert.equal(z, 3); |
16 | 16 |
17 var w = tr.b.getUsingPath('x.w', {'x': {'y': {'z': 3}}}); | 17 var w = tr.b.getUsingPath('x.w', {'x': {'y': {'z': 3}}}); |
18 assert.isUndefined(w); | 18 assert.isUndefined(w); |
19 }); | 19 }); |
20 | 20 |
21 test('testExceptionNaming', function() { | 21 test('testExceptionNaming', function() { |
22 var err = new Error('asdf'); | 22 var err = new Error('asdf'); |
23 err.name = 'MyError'; | 23 err.name = 'MyError'; |
24 | 24 |
25 var ex = tr.b.normalizeException(err); | 25 var ex = tr.b.normalizeException(err); |
26 assert.equal(ex.typeName, 'MyError'); | 26 assert.equal(ex.typeName, 'MyError'); |
27 }); | 27 }); |
| 28 |
| 29 test('formatDate', function() { |
| 30 assert.strictEqual(tr.b.formatDate(new Date(0)), '1970-01-01 00:00:00'); |
| 31 }); |
28 }); | 32 }); |
29 </script> | 33 </script> |
OLD | NEW |