| 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 attached_device_id = '42'; | 5 var attachedDeviceId = '42'; |
| 6 | 6 |
| 7 chrome.mediaGalleriesPrivate.onDeviceAttached.addListener(function(details) { | 7 chrome.mediaGalleriesPrivate.onDeviceAttached.addListener(function(details) { |
| 8 // Save the device id for the detach test. | 8 // Save the device id for the detach test. |
| 9 attached_device_id = 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. |
| 11 chrome.test.sendMessage('attach_test_ok,' + details.deviceName); | 11 chrome.test.sendMessage('attach_test_ok,' + details.deviceName); |
| 12 }); | 12 }); |
| 13 | 13 |
| 14 chrome.mediaGalleriesPrivate.onDeviceDetached.addListener(function(details) { | 14 chrome.mediaGalleriesPrivate.onDeviceDetached.addListener(function(details) { |
| 15 // The C++ test does not know the device id, so check here. | 15 // The C++ test does not know the device id, so check here. |
| 16 if (details.deviceId != attached_device_id) { | 16 if (details.deviceId != attachedDeviceId) { |
| 17 chrome.test.fail('Bad device id in onDeviceDetached test.'); | 17 chrome.test.fail('Bad device id in onDeviceDetached test.'); |
| 18 return; | 18 return; |
| 19 } | 19 } |
| 20 chrome.test.sendMessage('detach_test_ok'); | 20 chrome.test.sendMessage('detach_test_ok'); |
| 21 }); | 21 }); |
| OLD | NEW |