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 // 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 Loading... |
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 Loading... |
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 |
OLD | NEW |