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

Side by Side Diff: chrome/browser/media_gallery/media_device_notifications_linux_unittest.cc

Issue 10389161: Cleanup: Misc fixes to MediaDeviceNotifications. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/media_gallery/media_device_notifications_window_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 OverwriteMtabAndRunLoop(test_data1, arraysize(test_data1)); 335 OverwriteMtabAndRunLoop(test_data1, arraysize(test_data1));
336 336
337 // Detach all devices. 337 // Detach all devices.
338 EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _)).Times(0); 338 EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _)).Times(0);
339 EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(2); 339 EXPECT_CALL(observer(), OnMediaDeviceDetached(_)).Times(2);
340 WriteEmptyMtabAndRunLoop(); 340 WriteEmptyMtabAndRunLoop();
341 } 341 }
342 342
343 // More complicated test case with multiple devices on one mount point. 343 // More complicated test case with multiple devices on one mount point.
344 TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesOneMountPoint) { 344 TEST_F(MediaDeviceNotificationsLinuxTest, MultiDevicesOneMountPoint) {
345 testing::Sequence mock_sequence;
346 FilePath test_path_a = CreateMountPointWithDCIMDir(kMountPointA); 345 FilePath test_path_a = CreateMountPointWithDCIMDir(kMountPointA);
347 FilePath test_path_b = CreateMountPointWithDCIMDir(kMountPointB); 346 FilePath test_path_b = CreateMountPointWithDCIMDir(kMountPointB);
348 ASSERT_FALSE(test_path_a.empty()); 347 ASSERT_FALSE(test_path_a.empty());
349 ASSERT_FALSE(test_path_b.empty()); 348 ASSERT_FALSE(test_path_b.empty());
350 349
351 // |kDevice1| is most recently mounted at |kMountPointB|. 350 // |kDevice1| is most recently mounted at |kMountPointB|.
352 // kDevice1 -> kMountPointA 351 // kDevice1 -> kMountPointA
353 // kDevice2 -> kMountPointB 352 // kDevice2 -> kMountPointB
354 // kDevice1 -> kMountPointB 353 // kDevice1 -> kMountPointB
355 MtabTestData test_data1[] = { 354 MtabTestData test_data1[] = {
(...skipping 24 matching lines...) Expand all
380 379
381 // Detach all devices. 380 // Detach all devices.
382 EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _)).Times(0); 381 EXPECT_CALL(observer(), OnMediaDeviceAttached(_, _, _)).Times(0);
383 EXPECT_CALL(observer(), OnMediaDeviceDetached(1)).Times(1); 382 EXPECT_CALL(observer(), OnMediaDeviceDetached(1)).Times(1);
384 WriteEmptyMtabAndRunLoop(); 383 WriteEmptyMtabAndRunLoop();
385 } 384 }
386 385
387 } // namespace 386 } // namespace
388 387
389 } // namespace chrome 388 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_gallery/media_device_notifications_window_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698