OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "chrome/browser/chromeos/cros/cros_library.h" | 7 #include "chrome/browser/chromeos/cros/cros_library.h" |
8 #include "chrome/browser/chromeos/cros/mock_mount_library.h" | 8 #include "chrome/browser/chromeos/cros/mock_mount_library.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 provider->AddMountPoint(test_mount_point_); | 42 provider->AddMountPoint(test_mount_point_); |
43 } | 43 } |
44 | 44 |
45 private: | 45 private: |
46 void CreateVolumeMap() { | 46 void CreateVolumeMap() { |
47 // These have to be sync'd with values in filebrowser_mount extension. | 47 // These have to be sync'd with values in filebrowser_mount extension. |
48 volumes_.insert( | 48 volumes_.insert( |
49 std::pair<std::string, chromeos::MountLibrary::Disk*>( | 49 std::pair<std::string, chromeos::MountLibrary::Disk*>( |
50 "device_path1", | 50 "device_path1", |
51 new chromeos::MountLibrary::Disk("device_path1", | 51 new chromeos::MountLibrary::Disk("device_path1", |
52 "mount_path1", | 52 "/media/removable/mount_path1", |
53 "system_path1", | 53 "system_path1", |
54 "file_path1", | 54 "file_path1", |
55 "device_label1", | 55 "device_label1", |
56 "drive_label1", | 56 "drive_label1", |
57 "parent_path1", | 57 "parent_path1", |
58 chromeos::FLASH, | 58 chromeos::FLASH, |
59 1073741824, | 59 1073741824, |
60 false, | 60 false, |
61 false, | 61 false, |
62 false, | 62 false, |
63 false))); | 63 false))); |
64 volumes_.insert( | 64 volumes_.insert( |
65 std::pair<std::string, chromeos::MountLibrary::Disk*>( | 65 std::pair<std::string, chromeos::MountLibrary::Disk*>( |
66 "device_path2", | 66 "device_path2", |
67 new chromeos::MountLibrary::Disk("device_path2", | 67 new chromeos::MountLibrary::Disk("device_path2", |
68 "mount_path2", | 68 "/media/removable/mount_path2", |
69 "system_path2", | 69 "system_path2", |
70 "file_path2", | 70 "file_path2", |
71 "device_label2", | 71 "device_label2", |
72 "drive_label2", | 72 "drive_label2", |
73 "parent_path2", | 73 "parent_path2", |
74 chromeos::HDD, | 74 chromeos::HDD, |
75 47723, | 75 47723, |
76 true, | 76 true, |
77 true, | 77 true, |
78 true, | 78 true, |
79 true))); | 79 true))); |
80 volumes_.insert( | 80 volumes_.insert( |
81 std::pair<std::string, chromeos::MountLibrary::Disk*>( | 81 std::pair<std::string, chromeos::MountLibrary::Disk*>( |
82 "device_path3", | 82 "device_path3", |
83 new chromeos::MountLibrary::Disk("device_path3", | 83 new chromeos::MountLibrary::Disk("device_path3", |
84 "mount_path3", | 84 "/media/removable/mount_path3", |
85 "system_path3", | 85 "system_path3", |
86 "file_path3", | 86 "file_path3", |
87 "device_label3", | 87 "device_label3", |
88 "drive_label3", | 88 "drive_label3", |
89 "parent_path3", | 89 "parent_path3", |
90 chromeos::OPTICAL, | 90 chromeos::OPTICAL, |
91 0, | 91 0, |
92 true, | 92 true, |
93 false, | 93 false, |
94 false, | 94 false, |
(...skipping 25 matching lines...) Expand all Loading... |
120 .Times(0); | 120 .Times(0); |
121 EXPECT_CALL(mount_library_mock_, UnmountPath(StrEq("/tmp/test_file.zip"))) | 121 EXPECT_CALL(mount_library_mock_, UnmountPath(StrEq("/tmp/test_file.zip"))) |
122 .Times(1); | 122 .Times(1); |
123 | 123 |
124 EXPECT_CALL(mount_library_mock_, disks()) | 124 EXPECT_CALL(mount_library_mock_, disks()) |
125 .WillRepeatedly(ReturnRef(volumes_)); | 125 .WillRepeatedly(ReturnRef(volumes_)); |
126 | 126 |
127 ASSERT_TRUE(RunComponentExtensionTest("filebrowser_mount")) << message_; | 127 ASSERT_TRUE(RunComponentExtensionTest("filebrowser_mount")) << message_; |
128 } | 128 } |
129 | 129 |
OLD | NEW |