Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8371)

Unified Diff: chrome/test/data/webui/test_api.js

Issue 7237030: Added options browser_tests using the generator and js handler framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows doesn't allow OVERRIDE on destructors. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 +
+ '\nExpected length: ' + expected.length + '\n' +
+ message);
+ for(var i in expected) {
+ if (expected.length != actual.length)
David Tseng 2011/07/07 19:26:28 not sure what you're doing here? Did you mean to
Sheridan Rawlins 2011/07/07 23:39:23 Yes, but I'm writing it in a way, which will play
+ 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) {
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);

Powered by Google App Engine
This is Rietveld 408576698