OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * @fileoverview Library providing basic test framework functionality. | 6 * @fileoverview Library providing basic test framework functionality. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /** |
10 * Namespace for |Test|. | 10 * Namespace for |Test|. |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 var namespace = this; | 565 var namespace = this; |
566 for(var i = 0; i < path.length - 1; i++) { | 566 for(var i = 0; i < path.length - 1; i++) { |
567 var fieldName = path[i]; | 567 var fieldName = path[i]; |
568 if(!namespace[fieldName]) | 568 if(!namespace[fieldName]) |
569 namespace[fieldName] = {}; | 569 namespace[fieldName] = {}; |
570 | 570 |
571 namespace = namespace[fieldName]; | 571 namespace = namespace[fieldName]; |
572 } | 572 } |
573 | 573 |
574 var fieldName = path[path.length-1]; | 574 var fieldName = path[path.length-1]; |
575 assertEquals(undefined, namespace[fieldName]); | |
576 namespace[fieldName] = theFunction; | 575 namespace[fieldName] = theFunction; |
577 } | 576 } |
578 | 577 |
579 /** | 578 /** |
580 * Empty function for use in making mocks. | 579 * Empty function for use in making mocks. |
581 * @const | 580 * @const |
582 */ | 581 */ |
583 function emptyFunction() {} | 582 function emptyFunction() {} |
584 | 583 |
585 /** | 584 /** |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 exports.TEST = TEST; | 1750 exports.TEST = TEST; |
1752 exports.TEST_F = TEST_F; | 1751 exports.TEST_F = TEST_F; |
1753 exports.RUNTIME_TEST_F = TEST_F; | 1752 exports.RUNTIME_TEST_F = TEST_F; |
1754 exports.GEN = GEN; | 1753 exports.GEN = GEN; |
1755 exports.GEN_INCLUDE = GEN_INCLUDE; | 1754 exports.GEN_INCLUDE = GEN_INCLUDE; |
1756 exports.WhenTestDone = WhenTestDone; | 1755 exports.WhenTestDone = WhenTestDone; |
1757 | 1756 |
1758 // Import the Mock4JS helpers. | 1757 // Import the Mock4JS helpers. |
1759 Mock4JS.addMockSupport(exports); | 1758 Mock4JS.addMockSupport(exports); |
1760 })(this); | 1759 })(this); |
OLD | NEW |