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

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

Issue 12212083: Media Galleries: Only try to initialize removable media galleries once per profile. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | « chrome/browser/media_gallery/media_file_system_registry.cc ('k') | no next file » | 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 // MediaFileSystemRegistry unit tests. 5 // MediaFileSystemRegistry unit tests.
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 dcim_dir_ = galleries_dir_.path().AppendASCII("with_dcim"); 796 dcim_dir_ = galleries_dir_.path().AppendASCII("with_dcim");
797 ASSERT_TRUE(file_util::CreateDirectory(dcim_dir_)); 797 ASSERT_TRUE(file_util::CreateDirectory(dcim_dir_));
798 ASSERT_TRUE(file_util::CreateDirectory(dcim_dir_.Append(kDCIMDirectoryName))); 798 ASSERT_TRUE(file_util::CreateDirectory(dcim_dir_.Append(kDCIMDirectoryName)));
799 } 799 }
800 800
801 void MediaFileSystemRegistryTest::TearDown() { 801 void MediaFileSystemRegistryTest::TearDown() {
802 profile_states_.clear(); 802 profile_states_.clear();
803 ChromeRenderViewHostTestHarness::TearDown(); 803 ChromeRenderViewHostTestHarness::TearDown();
804 MediaFileSystemRegistry* registry = 804 MediaFileSystemRegistry* registry =
805 g_browser_process->media_file_system_registry(); 805 g_browser_process->media_file_system_registry();
806 EXPECT_EQ(0U, registry->GetExtensionHostCountForTests()); 806 EXPECT_EQ(0U, registry->GetExtensionGalleriesHostCountForTests());
807 BrowserThread::GetBlockingPool()->FlushForTesting(); 807 BrowserThread::GetBlockingPool()->FlushForTesting();
808 MessageLoop::current()->RunUntilIdle(); 808 MessageLoop::current()->RunUntilIdle();
809 } 809 }
810 810
811 /////////// 811 ///////////
812 // Tests // 812 // Tests //
813 /////////// 813 ///////////
814 814
815 TEST_F(MediaFileSystemRegistryTest, Basic) { 815 TEST_F(MediaFileSystemRegistryTest, Basic) {
816 CreateProfileState(1); 816 CreateProfileState(1);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 pref_info_with_relpath.device_id = device_id; 1015 pref_info_with_relpath.device_id = device_id;
1016 EXPECT_EQ(dcim_dir().Append(pref_info_with_relpath.path).value(), 1016 EXPECT_EQ(dcim_dir().Append(pref_info_with_relpath.path).value(),
1017 pref_info_with_relpath.AbsolutePath().value()); 1017 pref_info_with_relpath.AbsolutePath().value());
1018 1018
1019 DetachDevice(device_id); 1019 DetachDevice(device_id);
1020 EXPECT_TRUE(pref_info.AbsolutePath().empty()); 1020 EXPECT_TRUE(pref_info.AbsolutePath().empty());
1021 EXPECT_TRUE(pref_info_with_relpath.AbsolutePath().empty()); 1021 EXPECT_TRUE(pref_info_with_relpath.AbsolutePath().empty());
1022 } 1022 }
1023 1023
1024 } // namespace chrome 1024 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/media_gallery/media_file_system_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698