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

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: s/settings/options/, moved .cc into options dir, addressed JS readability. 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 +
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);

Powered by Google App Engine
This is Rietveld 408576698