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

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

Issue 17450012: Fix test failure in list_selection_model_test.html and port to automated browser test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Documentation tweaks. Created 7 years, 6 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/webui_resource_test.js
diff --git a/chrome/test/data/webui/webui_resource_test.js b/chrome/test/data/webui/webui_resource_test.js
index 1cd3aececc419ad5a203ebd29e5c470051e5fc48..53c96523dccf0384a72381e4f822081798756a5e 100644
--- a/chrome/test/data/webui/webui_resource_test.js
+++ b/chrome/test/data/webui/webui_resource_test.js
@@ -72,6 +72,30 @@ function assertThrows(f) {
}
/**
+ * Verifies that the contents of the expected and observed arrays match.
+ * @param {Array} expected The expected result.
Dan Beam 2013/06/20 21:38:03 !Array
kevers 2013/06/21 13:30:49 Done.
+ * @param {Array} observed The actual result.
+ */
+function assertArrayEquals(expected, observed) {
+ var v1 = Array.prototype.slice.call(expected);
Dan Beam 2013/06/20 21:38:03 Array.prototype.slice.call(null) TypeError: Array.
+ var v2 = Array.prototype.slice.call(observed);
+ var equal = v1.length == v2.length;
+ if (equal) {
+ for (var i = 0; i < v1.length; i++) {
+ if (v1[i] !== v2[i]) {
+ equal = false;
+ break;
+ }
+ }
+ }
+ if (!equal) {
+ var message = 'Assertion Failed\n Observed: ' + v2 +
+ '\n Expected: ' + v1;
+ throw new Error(message);
+ }
+}
+
+/**
* Runs all functions starting with test and reports success or
* failure of the test suite.
*/

Powered by Google App Engine
This is Rietveld 408576698