Chromium Code Reviews| Index: chrome/test/data/webui/test_api.js |
| diff --git a/chrome/test/data/webui/test_api.js b/chrome/test/data/webui/test_api.js |
| index c9dddc252f351a37714c5fbc80980648d4680103..6ff124f32acd0d51247091cc4e811292d96763a6 100644 |
| --- a/chrome/test/data/webui/test_api.js |
| +++ b/chrome/test/data/webui/test_api.js |
| @@ -43,6 +43,18 @@ |
| assertBool(test, false, message); |
| } |
| + function assertEqualsArray(expected, actual, message) { |
| + if (expected.length != actual.length) |
| + throw new Error('Test Error. Actual length: ' + actual.length + |
|
Mike Mammarella
2011/07/07 23:48:08
For multiline bodies use {}. I don't personally ca
Sheridan Rawlins
2011/07/08 00:02:05
Done.
|
| + '\nExpected length: ' + expected.length + '\n' + |
| + message); |
| + for(var i in expected) { |
|
James Hawkins
2011/07/08 00:03:33
Don't use for (var i in blah).
James Hawkins
2011/07/08 00:03:33
Space after 'for'.
Sheridan Rawlins
2011/07/08 22:45:49
Done.
Sheridan Rawlins
2011/07/08 22:45:49
Function not used. Deleted.
|
| + if (expected.length != actual.length) |
| + throw new Error('Test Error. Actual: ' + actual + '\nExpected: ' + |
| + expected + '\n' + message); |
| + } |
| + } |
| + |
| function assertEquals(expected, actual, message) { |
| if (expected != actual) { |
| throw new Error('Test Error. Actual: ' + actual + '\nExpected: ' + |
| @@ -92,13 +104,17 @@ |
| function preloadJavascriptLibraries(overload_chrome_send) { |
|
Mike Mammarella
2011/07/07 23:48:08
Looks like this variable and old_chrome should hav
Sheridan Rawlins
2011/07/08 00:02:05
Done.
|
| if (overload_chrome_send) |
| - chrome = { 'send': send }; |
| + chrome = { |
| + '__proto__': old_chrome, |
| + 'send': send, |
| + }; |
| } |
| // Exports. |
| window.assertTrue = assertTrue; |
| window.assertFalse = assertFalse; |
| window.assertEquals = assertEquals; |
| + window.assertEqualsArray = assertEqualsArray; |
| window.assertNotReached = assertNotReached; |
| window.expectTrue = createExpect(assertTrue); |
| window.expectFalse = createExpect(assertFalse); |