Chromium Code Reviews| Index: webkit/data/layout_tests/chrome/fast/js/resources/js-test-pre.js |
| =================================================================== |
| --- webkit/data/layout_tests/chrome/fast/js/resources/js-test-pre.js (revision 13843) |
| +++ webkit/data/layout_tests/chrome/fast/js/resources/js-test-pre.js (working copy) |
| @@ -83,6 +83,24 @@ |
| function shouldBeFalse(_a) { shouldBe(_a, "false"); } |
| function shouldBeNaN(_a) { shouldBe(_a, "NaN"); } |
| +function shouldBeNull(_a) |
| +{ |
| + var exception; |
| + var _av; |
| + try { |
| + _av = eval(_a); |
| + } catch (e) { |
| + exception = e; |
| + } |
| + |
| + if (exception) |
| + testFailed(_a + " should be null. Threw exception " + exception); |
| + else if (_av == null) |
| + testPassed(_a + " is null."); |
| + else |
| + testFailed(_a + " should be null. was " + _av); |
| +} |
|
Pam (message me for reviews)
2009/04/16 21:59:31
function shouldBeNull() already exists in the real
|
| + |
| function shouldBeUndefined(_a) |
| { |
| var exception; |