OLD | NEW |
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 // This file contains various mock objects for the chrome platform to make | 5 // This file contains various mock objects for the chrome platform to make |
6 // unit testing easier. | 6 // unit testing easier. |
7 | 7 |
8 var chromeMocks = {}; | 8 var chromeMocks = {}; |
9 | 9 |
10 (function(){ | 10 (function(){ |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 chromeMocks.Identity.prototype.mock$clearToken = function() { | 242 chromeMocks.Identity.prototype.mock$clearToken = function() { |
243 this.token_ = undefined; | 243 this.token_ = undefined; |
244 }; | 244 }; |
245 | 245 |
246 /** @type {chromeMocks.Identity} */ | 246 /** @type {chromeMocks.Identity} */ |
247 chromeMocks.identity; | 247 chromeMocks.identity; |
248 | 248 |
249 /** @constructor */ | 249 /** @constructor */ |
250 chromeMocks.MetricsPrivate = function() {}; | 250 chromeMocks.MetricsPrivate = function() {}; |
251 | 251 |
| 252 chromeMocks.MetricsPrivate.prototype.MetricTypeType = { |
| 253 HISTOGRAM_LOG: 'histogram-log', |
| 254 HISTOGRAM_LINEAR: 'histogram-linear', |
| 255 }; |
| 256 |
252 chromeMocks.MetricsPrivate.prototype.recordValue = function() {}; | 257 chromeMocks.MetricsPrivate.prototype.recordValue = function() {}; |
253 | 258 |
254 /** @type {chromeMocks.MetricsPrivate} */ | 259 /** @type {chromeMocks.MetricsPrivate} */ |
255 chromeMocks.metricsPrivate; | 260 chromeMocks.metricsPrivate; |
256 | 261 |
257 /** @constructor */ | 262 /** @constructor */ |
258 chromeMocks.I18n = function() {}; | 263 chromeMocks.I18n = function() {}; |
259 | 264 |
260 /** | 265 /** |
261 * @param {string} messageName | 266 * @param {string} messageName |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 throw new Error('You must call activate() before restore().'); | 319 throw new Error('You must call activate() before restore().'); |
315 } | 320 } |
316 for (var components in originals_) { | 321 for (var components in originals_) { |
317 chrome[components] = originals_[components]; | 322 chrome[components] = originals_[components]; |
318 } | 323 } |
319 originals_ = null; | 324 originals_ = null; |
320 nativePorts = null; | 325 nativePorts = null; |
321 }; | 326 }; |
322 | 327 |
323 })(); | 328 })(); |
OLD | NEW |