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 var attachedDeviceId = '42'; | 5 var attachedDeviceId = '42'; |
6 | 6 |
7 var testAttach = function(details) { | 7 var testAttach = function(details) { |
8 // Save the device id for the detach test. | 8 // Save the device id for the detach test. |
9 attachedDeviceId = details.deviceId; | 9 attachedDeviceId = details.deviceId; |
10 // The C++ test code will check if this is ok. | 10 // The C++ test code will check if this is ok. |
(...skipping 30 matching lines...) Expand all Loading... |
41 chrome.mediaGalleriesPrivate.onDeviceDetached.addListener(testDummyDetach); | 41 chrome.mediaGalleriesPrivate.onDeviceDetached.addListener(testDummyDetach); |
42 chrome.test.sendMessage('add_dummy_detach_ok'); | 42 chrome.test.sendMessage('add_dummy_detach_ok'); |
43 } | 43 } |
44 | 44 |
45 function removeAttachListener() { | 45 function removeAttachListener() { |
46 chrome.mediaGalleriesPrivate.onDeviceAttached.removeListener(testAttach); | 46 chrome.mediaGalleriesPrivate.onDeviceAttached.removeListener(testAttach); |
47 chrome.test.sendMessage('remove_attach_ok'); | 47 chrome.test.sendMessage('remove_attach_ok'); |
48 } | 48 } |
49 | 49 |
50 function removeDummyDetachListener() { | 50 function removeDummyDetachListener() { |
51 chrome.mediaGalleriesPrivate.onDeviceAttached.removeListener(testDummyDetach); | 51 chrome.mediaGalleriesPrivate.onDeviceDetached.removeListener(testDummyDetach); |
52 chrome.test.sendMessage('remove_dummy_detach_ok'); | 52 chrome.test.sendMessage('remove_dummy_detach_ok'); |
53 } | 53 } |
OLD | NEW |