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

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

Issue 625463002: [fsp] Add support for observing entries and notifying about changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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 = service->MountFileSystem(kExtensionId, 99 const bool result =
100 kFileSystemId, 100 service->MountFileSystem(kExtensionId,
101 "Testing File System", 101 kFileSystemId,
102 false /* writable */); 102 "Testing File System",
103 false /* writable */,
104 false /* supports_notify_tag */);
103 ASSERT_TRUE(result); 105 ASSERT_TRUE(result);
104 FakeProvidedFileSystem* provided_file_system = 106 FakeProvidedFileSystem* provided_file_system =
105 static_cast<FakeProvidedFileSystem*>( 107 static_cast<FakeProvidedFileSystem*>(
106 service->GetProvidedFileSystem(kExtensionId, kFileSystemId)); 108 service->GetProvidedFileSystem(kExtensionId, kFileSystemId));
107 ASSERT_TRUE(provided_file_system); 109 ASSERT_TRUE(provided_file_system);
108 fake_file_ = provided_file_system->GetEntry( 110 fake_file_ = provided_file_system->GetEntry(
109 base::FilePath::FromUTF8Unsafe(kFakeFilePath)); 111 base::FilePath::FromUTF8Unsafe(kFakeFilePath));
110 ASSERT_TRUE(fake_file_); 112 ASSERT_TRUE(fake_file_);
111 const ProvidedFileSystemInfo& file_system_info = 113 const ProvidedFileSystemInfo& file_system_info =
112 service->GetProvidedFileSystem(kExtensionId, kFileSystemId) 114 service->GetProvidedFileSystem(kExtensionId, kFileSystemId)
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 EXPECT_EQ(net::ERR_IO_PENDING, result); 366 EXPECT_EQ(net::ERR_IO_PENDING, result);
365 base::RunLoop().RunUntilIdle(); 367 base::RunLoop().RunUntilIdle();
366 368
367 ASSERT_EQ(1u, logger.results().size()); 369 ASSERT_EQ(1u, logger.results().size());
368 EXPECT_LT(0, logger.results()[0]); 370 EXPECT_LT(0, logger.results()[0]);
369 EXPECT_EQ(fake_file_->metadata->size, logger.results()[0]); 371 EXPECT_EQ(fake_file_->metadata->size, logger.results()[0]);
370 } 372 }
371 373
372 } // namespace file_system_provider 374 } // namespace file_system_provider
373 } // namespace chromeos 375 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698