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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer_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_write r.h" 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_write 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 77
78 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService); 78 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService);
79 Service* service = Service::Get(profile_); // Owned by its factory. 79 Service* service = Service::Get(profile_); // Owned by its factory.
80 service->SetFileSystemFactoryForTesting( 80 service->SetFileSystemFactoryForTesting(
81 base::Bind(&FakeProvidedFileSystem::Create)); 81 base::Bind(&FakeProvidedFileSystem::Create));
82 82
83 const bool result = service->MountFileSystem(kExtensionId, 83 const bool result =
84 kFileSystemId, 84 service->MountFileSystem(kExtensionId,
85 "Testing File System", 85 kFileSystemId,
86 false /* writable */); 86 "Testing File System",
87 false /* writable */,
88 false /* supports_notify_tag */);
87 ASSERT_TRUE(result); 89 ASSERT_TRUE(result);
88 provided_file_system_ = static_cast<FakeProvidedFileSystem*>( 90 provided_file_system_ = static_cast<FakeProvidedFileSystem*>(
89 service->GetProvidedFileSystem(kExtensionId, kFileSystemId)); 91 service->GetProvidedFileSystem(kExtensionId, kFileSystemId));
90 ASSERT_TRUE(provided_file_system_); 92 ASSERT_TRUE(provided_file_system_);
91 const ProvidedFileSystemInfo& file_system_info = 93 const ProvidedFileSystemInfo& file_system_info =
92 provided_file_system_->GetFileSystemInfo(); 94 provided_file_system_->GetFileSystemInfo();
93 const std::string mount_point_name = 95 const std::string mount_point_name =
94 file_system_info.mount_path().BaseName().AsUTF8Unsafe(); 96 file_system_info.mount_path().BaseName().AsUTF8Unsafe();
95 97
96 file_url_ = CreateFileSystemURL( 98 file_url_ = CreateFileSystemURL(
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 230
229 ASSERT_EQ(1u, write_log.size()); 231 ASSERT_EQ(1u, write_log.size());
230 EXPECT_EQ(sizeof(kTextToWrite) - 1, static_cast<size_t>(write_log[0])); 232 EXPECT_EQ(sizeof(kTextToWrite) - 1, static_cast<size_t>(write_log[0]));
231 233
232 const std::string expected_contents = original_contents + kTextToWrite; 234 const std::string expected_contents = original_contents + kTextToWrite;
233 EXPECT_EQ(expected_contents, entry->contents); 235 EXPECT_EQ(expected_contents, entry->contents);
234 } 236 }
235 237
236 } // namespace file_system_provider 238 } // namespace file_system_provider
237 } // namespace chromeos 239 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698