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 // StorageInfoProviderLinux unit tests. | 5 // StorageInfoProviderLinux unit tests. |
6 | 6 |
7 #include "chrome/browser/extensions/api/system_info_storage/storage_info_provide
r_linux.h" | 7 #include "chrome/browser/extensions/api/system_info_storage/storage_info_provide
r_linux.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 "/dev/sdb /home ext4 rw 0 0"; | 32 "/dev/sdb /home ext4 rw 0 0"; |
33 | 33 |
34 struct TestMountEntry { | 34 struct TestMountEntry { |
35 std::string mnt_path; | 35 std::string mnt_path; |
36 std::string type; | 36 std::string type; |
37 double capacity; | 37 double capacity; |
38 double available_capacity; | 38 double available_capacity; |
39 }; | 39 }; |
40 | 40 |
41 const TestMountEntry mount_entries[] = { | 41 const TestMountEntry mount_entries[] = { |
42 { "/boot", "harddisk", 100, 50 }, | 42 { "/boot", systeminfo::kStorageTypeFixed, 100, 50 }, |
43 { "/", "harddisk", 200, 100 }, | 43 { "/", systeminfo::kStorageTypeFixed, 200, 100 }, |
44 { "/home", "removable", 300, 100 } | 44 { "/home", systeminfo::kStorageTypeRemovable, 300, 100 } |
45 }; | 45 }; |
46 | 46 |
47 typedef std::map<std::string, struct TestMountEntry> TestMountEntryMap; | 47 typedef std::map<std::string, struct TestMountEntry> TestMountEntryMap; |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 class StorageInfoProviderLinuxWrapper : public StorageInfoProviderLinux { | 51 class StorageInfoProviderLinuxWrapper : public StorageInfoProviderLinux { |
52 public: | 52 public: |
53 explicit StorageInfoProviderLinuxWrapper(const base::FilePath& mtab_path) | 53 explicit StorageInfoProviderLinuxWrapper(const base::FilePath& mtab_path) |
54 : StorageInfoProviderLinux(mtab_path) { | 54 : StorageInfoProviderLinux(mtab_path) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 TEST_F(StorageInfoProviderLinuxTest, QueryInfoFailed) { | 140 TEST_F(StorageInfoProviderLinuxTest, QueryInfoFailed) { |
141 storage_info_provider_ = | 141 storage_info_provider_ = |
142 new StorageInfoProviderLinuxWrapper(base::FilePath("/invalid/file/path")); | 142 new StorageInfoProviderLinuxWrapper(base::FilePath("/invalid/file/path")); |
143 StorageInfo info; | 143 StorageInfo info; |
144 ASSERT_FALSE(QueryInfo(&info)); | 144 ASSERT_FALSE(QueryInfo(&info)); |
145 EXPECT_EQ(0u, info.size()); | 145 EXPECT_EQ(0u, info.size()); |
146 } | 146 } |
147 | 147 |
148 } // namespace extensions | 148 } // namespace extensions |
149 | 149 |
OLD | NEW |