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 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi
n.h" | 5 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi
n.h" |
6 | 6 |
7 #include <dbt.h> | 7 #include <dbt.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 TEST_F(RemovableDeviceNotificationsWindowWinTest, DevicesAttachedAdjacentBits) { | 284 TEST_F(RemovableDeviceNotificationsWindowWinTest, DevicesAttachedAdjacentBits) { |
285 std::vector<int> device_indices; | 285 std::vector<int> device_indices; |
286 device_indices.push_back(0); | 286 device_indices.push_back(0); |
287 device_indices.push_back(1); | 287 device_indices.push_back(1); |
288 device_indices.push_back(2); | 288 device_indices.push_back(2); |
289 device_indices.push_back(3); | 289 device_indices.push_back(3); |
290 | 290 |
291 DoDevicesAttachedTest(device_indices); | 291 DoDevicesAttachedTest(device_indices); |
292 } | 292 } |
293 | 293 |
294 TEST_F(RemovableDeviceNotificationsWindowWinTest, DevicesDetached) { | 294 // Disabled until http://crbug.com/155910 is resolved. |
| 295 TEST_F(RemovableDeviceNotificationsWindowWinTest, DISABLED_DevicesDetached) { |
295 PreAttachDevices(); | 296 PreAttachDevices(); |
296 | 297 |
297 std::vector<int> device_indices; | 298 std::vector<int> device_indices; |
298 device_indices.push_back(1); | 299 device_indices.push_back(1); |
299 device_indices.push_back(5); | 300 device_indices.push_back(5); |
300 device_indices.push_back(7); | 301 device_indices.push_back(7); |
301 device_indices.push_back(13); | 302 device_indices.push_back(13); |
302 | 303 |
303 DoDevicesDetachedTest(device_indices); | 304 DoDevicesDetachedTest(device_indices); |
304 } | 305 } |
305 | 306 |
306 TEST_F(RemovableDeviceNotificationsWindowWinTest, DevicesDetachedHighBoundary) { | 307 // Disabled until http://crbug.com/155910 is resolved. |
| 308 TEST_F(RemovableDeviceNotificationsWindowWinTest, |
| 309 DISABLED_DevicesDetachedHighBoundary) { |
307 PreAttachDevices(); | 310 PreAttachDevices(); |
308 | 311 |
309 std::vector<int> device_indices; | 312 std::vector<int> device_indices; |
310 device_indices.push_back(25); | 313 device_indices.push_back(25); |
311 | 314 |
312 DoDevicesDetachedTest(device_indices); | 315 DoDevicesDetachedTest(device_indices); |
313 } | 316 } |
314 | 317 |
315 TEST_F(RemovableDeviceNotificationsWindowWinTest, DevicesDetachedLowBoundary) { | 318 // Disabled until http://crbug.com/155910 is resolved. |
| 319 TEST_F(RemovableDeviceNotificationsWindowWinTest, |
| 320 DISABLED_DevicesDetachedLowBoundary) { |
316 PreAttachDevices(); | 321 PreAttachDevices(); |
317 | 322 |
318 std::vector<int> device_indices; | 323 std::vector<int> device_indices; |
319 device_indices.push_back(0); | 324 device_indices.push_back(0); |
320 | 325 |
321 DoDevicesDetachedTest(device_indices); | 326 DoDevicesDetachedTest(device_indices); |
322 } | 327 } |
323 | 328 |
324 TEST_F(RemovableDeviceNotificationsWindowWinTest, DevicesDetachedAdjacentBits) { | 329 // Disabled until http://crbug.com/155910 is resolved. |
| 330 TEST_F(RemovableDeviceNotificationsWindowWinTest, |
| 331 DISABLED_DevicesDetachedAdjacentBits) { |
325 PreAttachDevices(); | 332 PreAttachDevices(); |
326 | 333 |
327 std::vector<int> device_indices; | 334 std::vector<int> device_indices; |
328 device_indices.push_back(0); | 335 device_indices.push_back(0); |
329 device_indices.push_back(1); | 336 device_indices.push_back(1); |
330 device_indices.push_back(2); | 337 device_indices.push_back(2); |
331 device_indices.push_back(3); | 338 device_indices.push_back(3); |
332 | 339 |
333 DoDevicesDetachedTest(device_indices); | 340 DoDevicesDetachedTest(device_indices); |
334 } | 341 } |
335 | 342 |
336 TEST_F(RemovableDeviceNotificationsWindowWinTest, DeviceInfoFoPath) { | 343 // Disabled until http://crbug.com/155910 is resolved. |
| 344 TEST_F(RemovableDeviceNotificationsWindowWinTest, DISABLED_DeviceInfoForPath) { |
337 PreAttachDevices(); | 345 PreAttachDevices(); |
338 | 346 |
339 // An invalid path. | 347 // An invalid path. |
340 EXPECT_FALSE(window_->GetDeviceInfoForPath(FilePath(L"COM1:\\"), NULL)); | 348 EXPECT_FALSE(window_->GetDeviceInfoForPath(FilePath(L"COM1:\\"), NULL)); |
341 | 349 |
342 // An unconnected removable device. | 350 // An unconnected removable device. |
343 EXPECT_FALSE(window_->GetDeviceInfoForPath(FilePath(L"E:\\"), NULL)); | 351 EXPECT_FALSE(window_->GetDeviceInfoForPath(FilePath(L"E:\\"), NULL)); |
344 | 352 |
345 // A connected removable device. | 353 // A connected removable device. |
346 FilePath removable_device(L"F:\\"); | 354 FilePath removable_device(L"F:\\"); |
(...skipping 20 matching lines...) Expand all Loading... |
367 &removable)); | 375 &removable)); |
368 EXPECT_FALSE(removable); | 376 EXPECT_FALSE(removable); |
369 device_id = MediaStorageUtil::MakeDeviceId( | 377 device_id = MediaStorageUtil::MakeDeviceId( |
370 MediaStorageUtil::FIXED_MASS_STORAGE, unique_id); | 378 MediaStorageUtil::FIXED_MASS_STORAGE, unique_id); |
371 EXPECT_EQ(device_id, device_info.device_id); | 379 EXPECT_EQ(device_id, device_info.device_id); |
372 EXPECT_EQ(device_name, device_info.name); | 380 EXPECT_EQ(device_name, device_info.name); |
373 EXPECT_EQ(fixed_device.value(), device_info.location); | 381 EXPECT_EQ(fixed_device.value(), device_info.location); |
374 } | 382 } |
375 | 383 |
376 } // namespace chrome | 384 } // namespace chrome |
OLD | NEW |