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 // MediaDeviceNotificationsLinux unit tests. | 5 // MediaDeviceNotificationsLinux unit tests. |
6 | 6 |
7 #include "chrome/browser/media_gallery/media_device_notifications_linux.h" | 7 #include "chrome/browser/media_gallery/media_device_notifications_linux.h" |
8 | 8 |
9 #include <mntent.h> | 9 #include <mntent.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 const char kDeviceLabel1[] = "TEST_USB_MODEL_1"; | 45 const char kDeviceLabel1[] = "TEST_USB_MODEL_1"; |
46 const char kDeviceLabel2[] = "TEST_USB_MODEL_2"; | 46 const char kDeviceLabel2[] = "TEST_USB_MODEL_2"; |
47 const char kDeviceLabel3[] = "TEST_USB_MODEL_3"; | 47 const char kDeviceLabel3[] = "TEST_USB_MODEL_3"; |
48 | 48 |
49 const char kMountPointA[] = "mnt_a"; | 49 const char kMountPointA[] = "mnt_a"; |
50 const char kMountPointB[] = "mnt_b"; | 50 const char kMountPointB[] = "mnt_b"; |
51 | 51 |
52 std::string GetDCIMDeviceId(std::string unique_id) { | 52 std::string GetDCIMDeviceId(std::string unique_id) { |
53 return chrome::MediaStorageUtil::MakeDeviceId( | 53 return chrome::MediaStorageUtil::MakeDeviceId( |
54 chrome::MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM, unique_id); | 54 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM, unique_id); |
55 } | 55 } |
56 | 56 |
57 bool GetDeviceInfo(const std::string& dev_path, std::string* id, | 57 bool GetDeviceInfo(const std::string& dev_path, std::string* id, |
58 string16* name) { | 58 string16* name) { |
59 std::string device_name; | 59 std::string device_name; |
60 if (dev_path == kDevice1) { | 60 if (dev_path == kDevice1) { |
61 *id = GetDCIMDeviceId(kDeviceId1); | 61 *id = GetDCIMDeviceId(kDeviceId1); |
62 device_name = kDeviceLabel1; | 62 device_name = kDeviceLabel1; |
63 } else if (dev_path == kDevice2) { | 63 } else if (dev_path == kDevice2) { |
64 *id = GetDCIMDeviceId(kDeviceId2); | 64 *id = GetDCIMDeviceId(kDeviceId2); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(0); | 470 EXPECT_CALL(observer(), OnRemovableStorageAttached(_, _, _)).Times(0); |
471 EXPECT_CALL(observer(), | 471 EXPECT_CALL(observer(), |
472 OnRemovableStorageDetached(GetDCIMDeviceId(kDeviceId3))) | 472 OnRemovableStorageDetached(GetDCIMDeviceId(kDeviceId3))) |
473 .Times(1); | 473 .Times(1); |
474 WriteEmptyMtabAndRunLoop(); | 474 WriteEmptyMtabAndRunLoop(); |
475 } | 475 } |
476 | 476 |
477 } // namespace | 477 } // namespace |
478 | 478 |
479 } // namespace chrome | 479 } // namespace chrome |
OLD | NEW |