| OLD | NEW |
| 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 "chrome/browser/chromeos/file_system_provider/mount_path_util.h" | 5 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 extensions::ExtensionRegistry::Get(context)); | 62 extensions::ExtensionRegistry::Get(context)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace | 65 } // namespace |
| 66 | 66 |
| 67 class FileSystemProviderMountPathUtilTest : public testing::Test { | 67 class FileSystemProviderMountPathUtilTest : public testing::Test { |
| 68 protected: | 68 protected: |
| 69 FileSystemProviderMountPathUtilTest() {} | 69 FileSystemProviderMountPathUtilTest() {} |
| 70 virtual ~FileSystemProviderMountPathUtilTest() {} | 70 virtual ~FileSystemProviderMountPathUtilTest() {} |
| 71 | 71 |
| 72 virtual void SetUp() OVERRIDE { | 72 virtual void SetUp() override { |
| 73 profile_manager_.reset( | 73 profile_manager_.reset( |
| 74 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 74 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
| 75 ASSERT_TRUE(profile_manager_->SetUp()); | 75 ASSERT_TRUE(profile_manager_->SetUp()); |
| 76 profile_ = profile_manager_->CreateTestingProfile("testing-profile"); | 76 profile_ = profile_manager_->CreateTestingProfile("testing-profile"); |
| 77 user_manager_ = new FakeUserManager(); | 77 user_manager_ = new FakeUserManager(); |
| 78 user_manager_enabler_.reset(new ScopedUserManagerEnabler(user_manager_)); | 78 user_manager_enabler_.reset(new ScopedUserManagerEnabler(user_manager_)); |
| 79 user_manager_->AddUser(profile_->GetProfileName()); | 79 user_manager_->AddUser(profile_->GetProfileName()); |
| 80 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService); | 80 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService); |
| 81 file_system_provider_service_ = Service::Get(profile_); | 81 file_system_provider_service_ = Service::Get(profile_); |
| 82 file_system_provider_service_->SetFileSystemFactoryForTesting( | 82 file_system_provider_service_->SetFileSystemFactoryForTesting( |
| 83 base::Bind(&FakeProvidedFileSystem::Create)); | 83 base::Bind(&FakeProvidedFileSystem::Create)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void TearDown() OVERRIDE { | 86 virtual void TearDown() override { |
| 87 // Setting the testing factory to NULL will destroy the created service | 87 // Setting the testing factory to NULL will destroy the created service |
| 88 // associated with the testing profile. | 88 // associated with the testing profile. |
| 89 ServiceFactory::GetInstance()->SetTestingFactory(profile_, NULL); | 89 ServiceFactory::GetInstance()->SetTestingFactory(profile_, NULL); |
| 90 } | 90 } |
| 91 | 91 |
| 92 content::TestBrowserThreadBundle thread_bundle_; | 92 content::TestBrowserThreadBundle thread_bundle_; |
| 93 scoped_ptr<TestingProfileManager> profile_manager_; | 93 scoped_ptr<TestingProfileManager> profile_manager_; |
| 94 TestingProfile* profile_; // Owned by TestingProfileManager. | 94 TestingProfile* profile_; // Owned by TestingProfileManager. |
| 95 scoped_ptr<ScopedUserManagerEnabler> user_manager_enabler_; | 95 scoped_ptr<ScopedUserManagerEnabler> user_manager_enabler_; |
| 96 FakeUserManager* user_manager_; | 96 FakeUserManager* user_manager_; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 const base::FilePath kFilePath = | 301 const base::FilePath kFilePath = |
| 302 base::FilePath::FromUTF8Unsafe("provided/hello/world"); | 302 base::FilePath::FromUTF8Unsafe("provided/hello/world"); |
| 303 LocalPathParser parser(profile_, kFilePath); | 303 LocalPathParser parser(profile_, kFilePath); |
| 304 EXPECT_FALSE(parser.Parse()); | 304 EXPECT_FALSE(parser.Parse()); |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace util | 308 } // namespace util |
| 309 } // namespace file_system_provider | 309 } // namespace file_system_provider |
| 310 } // namespace chromeos | 310 } // namespace chromeos |
| OLD | NEW |