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

Unified Diff: chrome/renderer/resources/extensions/test_custom_bindings.js

Issue 17451011: Make the externally connectable browser test clobber all of the builtins, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hopefully fix tests 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/renderer/resources/extensions/test_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/test_custom_bindings.js b/chrome/renderer/resources/extensions/test_custom_bindings.js
index ad0bd257bc7b191958cc968fe6691ae2bf7434d1..231e339ec5ffb778dd91f9a61ef51982d5433a75 100644
--- a/chrome/renderer/resources/extensions/test_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/test_custom_bindings.js
@@ -61,8 +61,10 @@ binding.registerCustomHook(function(api) {
var redundantPrefix = 'Error\n';
chrome.test.fail(
'Callback has already been run. ' +
- 'First call:\n' + called.slice(redundantPrefix.length) + '\n' +
- 'Second call:\n' + new Error().stack.slice(redundantPrefix.length));
+ 'First call:\n' +
+ $String.slice(called, redundantPrefix.length) + '\n' +
+ 'Second call:\n' +
+ $String.slice(new Error().stack, redundantPrefix.length));
}
called = new Error().stack;
@@ -151,12 +153,16 @@ binding.registerCustomHook(function(api) {
return false;
for (var p in actual) {
- if (actual.hasOwnProperty(p) && !expected.hasOwnProperty(p))
+ if ($Object.hasOwnProperty(actual, p) &&
+ !$Object.hasOwnProperty(expected, p)) {
return false;
+ }
}
for (var p in expected) {
- if (expected.hasOwnProperty(p) && !actual.hasOwnProperty(p))
+ if ($Object.hasOwnProperty(expected, p) &&
+ !$Object.hasOwnProperty(actual, p)) {
return false;
+ }
}
for (var p in expected) {
@@ -225,7 +231,7 @@ binding.registerCustomHook(function(api) {
function safeFunctionApply(func, args) {
try {
if (func)
- func.apply(null, args);
+ $Function.apply(func, null, args);
} catch (e) {
var msg = "uncaught exception " + e;
chromeTest.fail(msg);

Powered by Google App Engine
This is Rietveld 408576698