OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 debug(message) | 5 function debug(message) |
6 { | 6 { |
7 document.getElementById('status').innerHTML += '<br/>' + message; | 7 var span = document.createElement("span"); |
| 8 span.appendChild(document.createTextNode(message)); |
| 9 span.appendChild(document.createElement("br")); |
| 10 document.getElementById('status').appendChild(span); |
8 } | 11 } |
9 | 12 |
10 function done(message) | 13 function done(message) |
11 { | 14 { |
12 if (document.location.hash == '#fail') | 15 if (document.location.hash == '#fail') |
13 return; | 16 return; |
14 if (message) | 17 if (message) |
15 debug('PASS: ' + message); | 18 debug('PASS: ' + message); |
16 else | 19 else |
17 debug('PASS'); | 20 debug('PASS'); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 109 |
107 function shouldBeTrue(_a) { shouldBe(_a, "true"); } | 110 function shouldBeTrue(_a) { shouldBe(_a, "true"); } |
108 function shouldBeFalse(_a) { shouldBe(_a, "false"); } | 111 function shouldBeFalse(_a) { shouldBe(_a, "false"); } |
109 function shouldBeNaN(_a) { shouldBe(_a, "NaN"); } | 112 function shouldBeNaN(_a) { shouldBe(_a, "NaN"); } |
110 function shouldBeNull(_a) { shouldBe(_a, "null"); } | 113 function shouldBeNull(_a) { shouldBe(_a, "null"); } |
111 function shouldBeEqualToString(a, b) | 114 function shouldBeEqualToString(a, b) |
112 { | 115 { |
113 var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; | 116 var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; |
114 shouldBe(a, unevaledString); | 117 shouldBe(a, unevaledString); |
115 } | 118 } |
OLD | NEW |