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 'use strict'; | 4 'use strict'; |
5 | 5 |
6 /** | 6 /** |
7 * Test target. | 7 * Test target. |
8 * @type {DeviceHandler} | 8 * @type {DeviceHandler} |
9 */ | 9 */ |
10 var handler; | 10 var handler; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 create: function(id, params, callback) { | 59 create: function(id, params, callback) { |
60 this.items[id] = params; | 60 this.items[id] = params; |
61 callback(); | 61 callback(); |
62 }, | 62 }, |
63 clear: function(id, callback) { delete this.items[id]; callback(); }, | 63 clear: function(id, callback) { delete this.items[id]; callback(); }, |
64 items: {}, | 64 items: {}, |
65 onButtonClicked: { | 65 onButtonClicked: { |
66 addListener: function(listener) { | 66 addListener: function(listener) { |
67 this.dispatch = listener; | 67 this.dispatch = listener; |
68 } | 68 } |
| 69 }, |
| 70 getAll: function(callback) { |
| 71 callback([]); |
69 } | 72 } |
70 }, | 73 }, |
71 runtime: { | 74 runtime: { |
72 getURL: function(path) { return path; }, | 75 getURL: function(path) { return path; }, |
73 onStartup: { | 76 onStartup: { |
74 addListener: function() {} | 77 addListener: function() {} |
75 } | 78 } |
76 } | 79 } |
77 }; | 80 }; |
78 | 81 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 function testDeviceHardUnplugged() { | 416 function testDeviceHardUnplugged() { |
414 chrome.fileManagerPrivate.onDeviceChanged.dispatch({ | 417 chrome.fileManagerPrivate.onDeviceChanged.dispatch({ |
415 type: 'hard_unplugged', | 418 type: 'hard_unplugged', |
416 devicePath: '/device/path' | 419 devicePath: '/device/path' |
417 }); | 420 }); |
418 assertEquals(1, Object.keys(chrome.notifications.items).length); | 421 assertEquals(1, Object.keys(chrome.notifications.items).length); |
419 assertEquals('DEVICE_HARD_UNPLUGGED_MESSAGE', | 422 assertEquals('DEVICE_HARD_UNPLUGGED_MESSAGE', |
420 chrome.notifications.items[ | 423 chrome.notifications.items[ |
421 'hardUnplugged:/device/path'].message); | 424 'hardUnplugged:/device/path'].message); |
422 } | 425 } |
OLD | NEW |