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

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

Issue 354733002: Notifications API support for images with multiple scale factors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates custom bindings tests. Created 6 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
« no previous file with comments | « chrome/renderer/resources/extensions/notifications_custom_bindings.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/notifications_test_util.js
diff --git a/chrome/renderer/resources/extensions/notifications_test_util.js b/chrome/renderer/resources/extensions/notifications_test_util.js
index 85a30eee2bc1eeca029744e8ad0fca4885edbae6..d0d839a5cdd521f78b1a2df0db3b0171c0b5b8ce 100644
--- a/chrome/renderer/resources/extensions/notifications_test_util.js
+++ b/chrome/renderer/resources/extensions/notifications_test_util.js
@@ -40,14 +40,22 @@ var requireNative = function(library) {
var exports = {};
-var $Array = {
- push: function (ary, val) {
- ary.push(val);
- }
-};
+function makeStaticFunction(obj, methodName) {
+ return function() {
+ var self = arguments[0];
+ var args = Array.prototype.slice.call(arguments, 1);
+ return obj.prototype[methodName].apply(self, args);
+ };
+}
-var $Function = {
- bind: function (fn, context) {
- return fn.bind(context);
- }
-};
+var $Array = { self: Array };
+["push", "concat", "splice", "forEach"].forEach(function (name) {
+ $Array[name] = makeStaticFunction(Array, name);
+});
+
+var $Function = { self: Function };
+["bind"].forEach(function(name) {
+ $Function[name] = makeStaticFunction(Function, name);
+});
+
+var $String = { self: String };
« no previous file with comments | « chrome/renderer/resources/extensions/notifications_custom_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698