| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 function MockEventSource() { | 5 function MockEventSource() { |
| 6 this.listeners_ = []; | 6 this.listeners_ = []; |
| 7 } | 7 } |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Add a listener. | 10 * Add a listener. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 function cloneShallow(object) { | 41 function cloneShallow(object) { |
| 42 var clone = {}; | 42 var clone = {}; |
| 43 for (var key in object) | 43 for (var key in object) |
| 44 if (object.hasOwnProperty(key)) | 44 if (object.hasOwnProperty(key)) |
| 45 clone[key] = object[key]; | 45 clone[key] = object[key]; |
| 46 return clone; | 46 return clone; |
| 47 } | 47 } |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * Mock for |chrome| namespace. | |
| 51 */ | |
| 52 var chrome = {}; | |
| 53 | |
| 54 /** | |
| 55 * Mock out the chrome.fileBrowserPrivate API for use in the harness. | 50 * Mock out the chrome.fileBrowserPrivate API for use in the harness. |
| 56 */ | 51 */ |
| 57 chrome.fileBrowserPrivate = { | 52 chrome.fileBrowserPrivate = { |
| 58 /** | 53 /** |
| 59 * Used to distinguish the mock object from the real one. | 54 * Used to distinguish the mock object from the real one. |
| 60 */ | 55 */ |
| 61 mocked: true, | 56 mocked: true, |
| 62 | 57 |
| 63 /** | 58 /** |
| 64 * window.PERSISTENT is a little nicer but not yet supported by packaged apps. | 59 * window.PERSISTENT is a little nicer but not yet supported by packaged apps. |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 playAudio: function(urls, position) { | 890 playAudio: function(urls, position) { |
| 896 this.audioPlaylist_ = { items: urls, position: position }; | 891 this.audioPlaylist_ = { items: urls, position: position }; |
| 897 this.onPlaylistChanged.notify(); | 892 this.onPlaylistChanged.notify(); |
| 898 }, | 893 }, |
| 899 | 894 |
| 900 playVideo: function(url) { | 895 playVideo: function(url) { |
| 901 this.videoUrl_ = url; | 896 this.videoUrl_ = url; |
| 902 this.onVideoLaunched.notify(); | 897 this.onVideoLaunched.notify(); |
| 903 } | 898 } |
| 904 }; | 899 }; |
| 905 | |
| 906 /** | |
| 907 * Mock for |v8Intl| namespace. | |
| 908 */ | |
| 909 var v8Intl = {}; | |
| 910 | |
| 911 /** | |
| 912 * Mock constructor of |v8Intl.Collator|. | |
| 913 * @constructor | |
| 914 * @param {Array<*>} locales //TODO(JSDOC). | |
| 915 * @param {Object.<*, *>} options //TODO(JSDOC). | |
| 916 */ | |
| 917 v8Intl.Collator = function(locales, options) {}; | |
| 918 | |
| 919 /** | |
| 920 * Mock constructor of |v8Intl.DateTimeFormat|. | |
| 921 * @constructor | |
| 922 * @param {Array<*>} locales //TODO(JSDOC). | |
| 923 * @param {Object.<*, *>} options //TODO(JSDOC). | |
| 924 */ | |
| 925 v8Intl.DateTimeFormat = function(locales, options) {}; | |
| OLD | NEW |