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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 }, | 50 }, |
51 onMountCompleted: { | 51 onMountCompleted: { |
52 addListener: function(listener) { | 52 addListener: function(listener) { |
53 this.dispatch = listener; | 53 this.dispatch = listener; |
54 } | 54 } |
55 } | 55 } |
56 }, | 56 }, |
57 notifications: { | 57 notifications: { |
58 create: function(id, params, callback) { | 58 create: function(id, params, callback) { |
59 assertFalse(!!this.items[id]); | |
60 this.items[id] = params; | 59 this.items[id] = params; |
61 callback(); | 60 callback(); |
62 }, | 61 }, |
63 clear: function(id, callback) { delete this.items[id]; callback(); }, | 62 clear: function(id, callback) { delete this.items[id]; callback(); }, |
64 items: {}, | 63 items: {}, |
65 onButtonClicked: { | 64 onButtonClicked: { |
66 addListener: function(listener) { | 65 addListener: function(listener) { |
67 this.dispatch = listener; | 66 this.dispatch = listener; |
68 } | 67 } |
69 } | 68 } |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 function testDeviceHardUnplugged() { | 417 function testDeviceHardUnplugged() { |
419 chrome.fileBrowserPrivate.onDeviceChanged.dispatch({ | 418 chrome.fileBrowserPrivate.onDeviceChanged.dispatch({ |
420 type: 'hard_unplugged', | 419 type: 'hard_unplugged', |
421 devicePath: '/device/path' | 420 devicePath: '/device/path' |
422 }); | 421 }); |
423 assertEquals(1, Object.keys(chrome.notifications.items).length); | 422 assertEquals(1, Object.keys(chrome.notifications.items).length); |
424 assertEquals('DEVICE_HARD_UNPLUGGED_MESSAGE', | 423 assertEquals('DEVICE_HARD_UNPLUGGED_MESSAGE', |
425 chrome.notifications.items[ | 424 chrome.notifications.items[ |
426 'hardUnplugged:/device/path'].message); | 425 'hardUnplugged:/device/path'].message); |
427 } | 426 } |
OLD | NEW |