annotate js/tests.js @ 106:aad1c0a17ba4

added JSON support for iphone.
author Atul Varma <avarma@mozilla.com>
date Thu, 29 Apr 2010 11:11:04 -0700
parents eb2cc1f89869
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
1 function raises(error, func, message) {
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
2 if (!message)
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
3 message = "function raises error: " + error;
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
4
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
5 try {
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
6 func();
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
7 ok(false, message + " (no error was raised)");
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
8 } catch (e) {
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
9 equals(e.message, error, message);
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
10 }
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
11 }
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
12
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
13 $(window).ready(function runTests() {
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
14 for (name in window) {
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
15 if (name.match(/^test.+/) &&
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
16 name != "testDone" &&
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
17 name != "testStart" &&
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
18 typeof(window[name]) == "function") {
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
19 test(name, window[name]);
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
20 }
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
21 }
eb2cc1f89869 Added a test suite, basic CommonJS module loader, and a new main.html file that will be a unified UI to all three pages (dashboard, user-finder, bug-filer).
Atul Varma <avarma@mozilla.com>
parents:
diff changeset
22 });