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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/resources/extensions/notifications_custom_bindings.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // NotificationsTestUtil contains stubs for the global classes and 5 // NotificationsTestUtil contains stubs for the global classes and
6 // variables used by notifications_custom_bindings.js that are not 6 // variables used by notifications_custom_bindings.js that are not
7 // available with gtestjs tests. 7 // available with gtestjs tests.
8 var require = function(library) { 8 var require = function(library) {
9 return { 9 return {
10 binding: { 10 binding: {
(...skipping 22 matching lines...) Expand all
33 image: { width: 0, height: 0 }, 33 image: { width: 0, height: 0 },
34 buttonIcon: { width: 0, height: 0} 34 buttonIcon: { width: 0, height: 0}
35 }; 35 };
36 } 36 }
37 } 37 }
38 }[library]; 38 }[library];
39 } 39 }
40 40
41 var exports = {}; 41 var exports = {};
42 42
43 var $Array = { 43 function makeStaticFunction(obj, methodName) {
44 push: function (ary, val) { 44 return function() {
45 ary.push(val); 45 var self = arguments[0];
46 } 46 var args = Array.prototype.slice.call(arguments, 1);
47 }; 47 return obj.prototype[methodName].apply(self, args);
48 };
49 }
48 50
49 var $Function = { 51 var $Array = { self: Array };
50 bind: function (fn, context) { 52 ["push", "concat", "splice", "forEach"].forEach(function (name) {
51 return fn.bind(context); 53 $Array[name] = makeStaticFunction(Array, name);
52 } 54 });
53 }; 55
56 var $Function = { self: Function };
57 ["bind"].forEach(function(name) {
58 $Function[name] = makeStaticFunction(Function, name);
59 });
60
61 var $String = { self: String };
OLDNEW
« 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