Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: components/storage_monitor/storage_monitor_win_unittest.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <windows.h> 5 #include <windows.h>
6 #include <dbt.h> 6 #include <dbt.h>
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 StorageInfo info2; 288 StorageInfo info2;
289 EXPECT_TRUE(monitor_->GetStorageInfoForPath( 289 EXPECT_TRUE(monitor_->GetStorageInfoForPath(
290 base::FilePath(ASCIIToUTF16("F:\\subdir\\sub")), &info2)); 290 base::FilePath(ASCIIToUTF16("F:\\subdir\\sub")), &info2));
291 EXPECT_EQ(ASCIIToUTF16("F:\\ Drive"), info.storage_label()); 291 EXPECT_EQ(ASCIIToUTF16("F:\\ Drive"), info.storage_label());
292 EXPECT_EQ(ASCIIToUTF16("F:\\ Drive"), info1.storage_label()); 292 EXPECT_EQ(ASCIIToUTF16("F:\\ Drive"), info1.storage_label());
293 EXPECT_EQ(ASCIIToUTF16("F:\\ Drive"), info2.storage_label()); 293 EXPECT_EQ(ASCIIToUTF16("F:\\ Drive"), info2.storage_label());
294 } 294 }
295 295
296 TEST_F(StorageMonitorWinTest, PathMountDevices) { 296 TEST_F(StorageMonitorWinTest, PathMountDevices) {
297 PreAttachDevices(); 297 PreAttachDevices();
298 int init_storages = monitor_->GetAllAvailableStorages().size(); 298 size_t init_storages = monitor_->GetAllAvailableStorages().size();
299 299
300 volume_mount_watcher_->AddDeviceForTesting( 300 volume_mount_watcher_->AddDeviceForTesting(
301 base::FilePath(FILE_PATH_LITERAL("F:\\mount1")), 301 base::FilePath(FILE_PATH_LITERAL("F:\\mount1")),
302 "dcim:mount1", L"mount1", 100); 302 "dcim:mount1", L"mount1", 100);
303 volume_mount_watcher_->AddDeviceForTesting( 303 volume_mount_watcher_->AddDeviceForTesting(
304 base::FilePath(FILE_PATH_LITERAL("F:\\mount1\\subdir")), 304 base::FilePath(FILE_PATH_LITERAL("F:\\mount1\\subdir")),
305 "dcim:mount1subdir", L"mount1subdir", 100); 305 "dcim:mount1subdir", L"mount1subdir", 100);
306 volume_mount_watcher_->AddDeviceForTesting( 306 volume_mount_watcher_->AddDeviceForTesting(
307 base::FilePath(FILE_PATH_LITERAL("F:\\mount2")), 307 base::FilePath(FILE_PATH_LITERAL("F:\\mount2")),
308 "dcim:mount2", L"mount2", 100); 308 "dcim:mount2", L"mount2", 100);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // A connected removable device. 468 // A connected removable device.
469 base::FilePath removable_device(L"F:\\"); 469 base::FilePath removable_device(L"F:\\");
470 EXPECT_TRUE(monitor_->GetStorageInfoForPath(removable_device, &device_info)); 470 EXPECT_TRUE(monitor_->GetStorageInfoForPath(removable_device, &device_info));
471 471
472 StorageInfo info; 472 StorageInfo info;
473 ASSERT_TRUE(volume_mount_watcher_->GetDeviceInfo(removable_device, &info)); 473 ASSERT_TRUE(volume_mount_watcher_->GetDeviceInfo(removable_device, &info));
474 EXPECT_TRUE(StorageInfo::IsRemovableDevice(info.device_id())); 474 EXPECT_TRUE(StorageInfo::IsRemovableDevice(info.device_id()));
475 EXPECT_EQ(info.device_id(), device_info.device_id()); 475 EXPECT_EQ(info.device_id(), device_info.device_id());
476 EXPECT_EQ(info.GetDisplayName(false), device_info.GetDisplayName(false)); 476 EXPECT_EQ(info.GetDisplayName(false), device_info.GetDisplayName(false));
477 EXPECT_EQ(info.location(), device_info.location()); 477 EXPECT_EQ(info.location(), device_info.location());
478 EXPECT_EQ(1000000, info.total_size_in_bytes()); 478 EXPECT_EQ(1000000u, info.total_size_in_bytes());
479 479
480 // A fixed device. 480 // A fixed device.
481 base::FilePath fixed_device(L"N:\\"); 481 base::FilePath fixed_device(L"N:\\");
482 EXPECT_TRUE(monitor_->GetStorageInfoForPath(fixed_device, &device_info)); 482 EXPECT_TRUE(monitor_->GetStorageInfoForPath(fixed_device, &device_info));
483 483
484 ASSERT_TRUE(volume_mount_watcher_->GetDeviceInfo( 484 ASSERT_TRUE(volume_mount_watcher_->GetDeviceInfo(
485 fixed_device, &info)); 485 fixed_device, &info));
486 EXPECT_FALSE(StorageInfo::IsRemovableDevice(info.device_id())); 486 EXPECT_FALSE(StorageInfo::IsRemovableDevice(info.device_id()));
487 EXPECT_EQ(info.device_id(), device_info.device_id()); 487 EXPECT_EQ(info.device_id(), device_info.device_id());
488 EXPECT_EQ(info.GetDisplayName(false), device_info.GetDisplayName(false)); 488 EXPECT_EQ(info.GetDisplayName(false), device_info.GetDisplayName(false));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo); 539 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo);
540 EXPECT_EQ(expected, pnp_device_id); 540 EXPECT_EQ(expected, pnp_device_id);
541 EXPECT_EQ(it->object_persistent_id, 541 EXPECT_EQ(it->object_persistent_id,
542 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( 542 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId(
543 pnp_device_id, storage_object_id)); 543 pnp_device_id, storage_object_id));
544 } 544 }
545 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); 545 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false);
546 } 546 }
547 547
548 } // namespace storage_monitor 548 } // namespace storage_monitor
OLDNEW
« no previous file with comments | « components/policy/core/common/registry_dict_win_unittest.cc ('k') | device/bluetooth/bluetooth_adapter_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698