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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc

Issue 624903002: [fsp] Group arguments for mounting into a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a bug. Created 6 years, 2 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
OLDNEW
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/fileapi/file_stream_reade r.h" 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reade r.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 profile_manager_.reset( 89 profile_manager_.reset(
90 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); 90 new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
91 ASSERT_TRUE(profile_manager_->SetUp()); 91 ASSERT_TRUE(profile_manager_->SetUp());
92 profile_ = profile_manager_->CreateTestingProfile("testing-profile"); 92 profile_ = profile_manager_->CreateTestingProfile("testing-profile");
93 93
94 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService); 94 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService);
95 Service* service = Service::Get(profile_); // Owned by its factory. 95 Service* service = Service::Get(profile_); // Owned by its factory.
96 service->SetFileSystemFactoryForTesting( 96 service->SetFileSystemFactoryForTesting(
97 base::Bind(&FakeProvidedFileSystem::Create)); 97 base::Bind(&FakeProvidedFileSystem::Create));
98 98
99 const bool result = 99 const bool result = service->MountFileSystem(
100 service->MountFileSystem(kExtensionId, 100 kExtensionId, MountOptions(kFileSystemId, "Testing File System"));
101 kFileSystemId,
102 "Testing File System",
103 false /* writable */,
104 false /* supports_notify_tag */);
105 ASSERT_TRUE(result); 101 ASSERT_TRUE(result);
106 FakeProvidedFileSystem* provided_file_system = 102 FakeProvidedFileSystem* provided_file_system =
107 static_cast<FakeProvidedFileSystem*>( 103 static_cast<FakeProvidedFileSystem*>(
108 service->GetProvidedFileSystem(kExtensionId, kFileSystemId)); 104 service->GetProvidedFileSystem(kExtensionId, kFileSystemId));
109 ASSERT_TRUE(provided_file_system); 105 ASSERT_TRUE(provided_file_system);
110 fake_file_ = provided_file_system->GetEntry( 106 fake_file_ = provided_file_system->GetEntry(
111 base::FilePath::FromUTF8Unsafe(kFakeFilePath)); 107 base::FilePath::FromUTF8Unsafe(kFakeFilePath));
112 ASSERT_TRUE(fake_file_); 108 ASSERT_TRUE(fake_file_);
113 const ProvidedFileSystemInfo& file_system_info = 109 const ProvidedFileSystemInfo& file_system_info =
114 service->GetProvidedFileSystem(kExtensionId, kFileSystemId) 110 service->GetProvidedFileSystem(kExtensionId, kFileSystemId)
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 EXPECT_EQ(net::ERR_IO_PENDING, result); 362 EXPECT_EQ(net::ERR_IO_PENDING, result);
367 base::RunLoop().RunUntilIdle(); 363 base::RunLoop().RunUntilIdle();
368 364
369 ASSERT_EQ(1u, logger.results().size()); 365 ASSERT_EQ(1u, logger.results().size());
370 EXPECT_LT(0, logger.results()[0]); 366 EXPECT_LT(0, logger.results()[0]);
371 EXPECT_EQ(fake_file_->metadata->size, logger.results()[0]); 367 EXPECT_EQ(fake_file_->metadata->size, logger.results()[0]);
372 } 368 }
373 369
374 } // namespace file_system_provider 370 } // namespace file_system_provider
375 } // namespace chromeos 371 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698