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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc

Issue 1221093002: Add support for refreshing contents of providers which don't support watchers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 5 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/operations/read_file.h" 5 #include "chrome/browser/chromeos/file_system_provider/operations/read_file.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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } // namespace 72 } // namespace
73 73
74 class FileSystemProviderOperationsReadFileTest : public testing::Test { 74 class FileSystemProviderOperationsReadFileTest : public testing::Test {
75 protected: 75 protected:
76 FileSystemProviderOperationsReadFileTest() {} 76 FileSystemProviderOperationsReadFileTest() {}
77 ~FileSystemProviderOperationsReadFileTest() override {} 77 ~FileSystemProviderOperationsReadFileTest() override {}
78 78
79 void SetUp() override { 79 void SetUp() override {
80 file_system_info_ = ProvidedFileSystemInfo( 80 file_system_info_ = ProvidedFileSystemInfo(
81 kExtensionId, MountOptions(kFileSystemId, "" /* display_name */), 81 kExtensionId, MountOptions(kFileSystemId, "" /* display_name */),
82 base::FilePath(), false /* configurable */, extensions::SOURCE_FILE); 82 base::FilePath(), false /* configurable */, true /* watchable */,
83 extensions::SOURCE_FILE);
83 io_buffer_ = make_scoped_refptr(new net::IOBuffer(kOffset + kLength)); 84 io_buffer_ = make_scoped_refptr(new net::IOBuffer(kOffset + kLength));
84 } 85 }
85 86
86 ProvidedFileSystemInfo file_system_info_; 87 ProvidedFileSystemInfo file_system_info_;
87 scoped_refptr<net::IOBuffer> io_buffer_; 88 scoped_refptr<net::IOBuffer> io_buffer_;
88 }; 89 };
89 90
90 TEST_F(FileSystemProviderOperationsReadFileTest, Execute) { 91 TEST_F(FileSystemProviderOperationsReadFileTest, Execute) {
91 using extensions::api::file_system_provider::ReadFileRequestedOptions; 92 using extensions::api::file_system_provider::ReadFileRequestedOptions;
92 93
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 base::File::FILE_ERROR_TOO_MANY_OPENED); 219 base::File::FILE_ERROR_TOO_MANY_OPENED);
219 220
220 ASSERT_EQ(1u, callback_logger.events().size()); 221 ASSERT_EQ(1u, callback_logger.events().size());
221 CallbackLogger::Event* event = callback_logger.events()[0]; 222 CallbackLogger::Event* event = callback_logger.events()[0];
222 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, event->result()); 223 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, event->result());
223 } 224 }
224 225
225 } // namespace operations 226 } // namespace operations
226 } // namespace file_system_provider 227 } // namespace file_system_provider
227 } // namespace chromeos 228 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698