Chromium Code Reviews| 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 document.getElementById('status').appendChild(span); | |
| 9 span.innerHTML = message + '<br />'; | |
|
jsbell
2011/11/28 20:29:16
We should go the rest of the way and avoid using i
hans
2011/11/29 14:44:34
Done.
| |
| 8 } | 10 } |
| 9 | 11 |
| 10 function done(message) | 12 function done(message) |
| 11 { | 13 { |
| 12 if (document.location.hash == '#fail') | 14 if (document.location.hash == '#fail') |
| 13 return; | 15 return; |
| 14 if (message) | 16 if (message) |
| 15 debug('PASS: ' + message); | 17 debug('PASS: ' + message); |
| 16 else | 18 else |
| 17 debug('PASS'); | 19 debug('PASS'); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 | 108 |
| 107 function shouldBeTrue(_a) { shouldBe(_a, "true"); } | 109 function shouldBeTrue(_a) { shouldBe(_a, "true"); } |
| 108 function shouldBeFalse(_a) { shouldBe(_a, "false"); } | 110 function shouldBeFalse(_a) { shouldBe(_a, "false"); } |
| 109 function shouldBeNaN(_a) { shouldBe(_a, "NaN"); } | 111 function shouldBeNaN(_a) { shouldBe(_a, "NaN"); } |
| 110 function shouldBeNull(_a) { shouldBe(_a, "null"); } | 112 function shouldBeNull(_a) { shouldBe(_a, "null"); } |
| 111 function shouldBeEqualToString(a, b) | 113 function shouldBeEqualToString(a, b) |
| 112 { | 114 { |
| 113 var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; | 115 var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; |
| 114 shouldBe(a, unevaledString); | 116 shouldBe(a, unevaledString); |
| 115 } | 117 } |
| OLD | NEW |