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

Unified Diff: chrome/renderer/resources/extension_apitest.js

Issue 6468002: Implementation of getCurrentProxySettings for proxy settings API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/out/Debug
Patch Set: Removed todo and ask mpcomplete now. Created 9 years, 10 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
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | chrome/test/data/extensions/api_test/proxy/auto/test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extension_apitest.js
diff --git a/chrome/renderer/resources/extension_apitest.js b/chrome/renderer/resources/extension_apitest.js
index 4b6f939586916aa5182f75c38b87e7f423533bfe..4785fcd3dc052338f5f218b49b2c12ac1e5bd2fa 100644
--- a/chrome/renderer/resources/extension_apitest.js
+++ b/chrome/renderer/resources/extension_apitest.js
@@ -122,7 +122,41 @@ var chrome = chrome || {};
}
};
+ function checkDeepEq(expected, actual) {
+ for (var p in expected) {
+ var eq = true;
+ switch (typeof(expected[p])) {
+ case 'object':
+ eq = checkDeepEq(expected[p], actual[p]);
+ break;
+ case 'function':
+ eq = (typeof(actual[p]) != 'undefined' &&
+ expected[p].toString() == actual[p].toString());
+ break;
+ default:
+ eq = (expected[p] == actual[p] &&
+ typeof(expected[p]) == typeof(actual[p]));
+ break;
+ }
+ if (!eq)
+ return false;
+ }
+ for (var p in actual) {
+ if (typeof(expected[p]) == 'undefined')
+ return false;
+ }
+ return true;
+ }
+
chrome.test.assertEq = function(expected, actual) {
+ if (typeof(expected) == 'object') {
+ if (!checkDeepEq(expected, actual)) {
+ chrome.test.fail("API Test Error in " + testName(currentTest) +
+ "\nActual: " + JSON.stringify(actual) +
+ "\nExpected: " + JSON.stringify(expected));
+ }
+ return;
+ }
if (expected != actual) {
chrome.test.fail("API Test Error in " + testName(currentTest) +
"\nActual: " + actual + "\nExpected: " + expected);
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | chrome/test/data/extensions/api_test/proxy/auto/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698