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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/throttled_file_system_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/throttled_file_system.h" 5 #include "chrome/browser/chromeos/file_system_provider/throttled_file_system.h"
6 6
7 #include <vector> 7 #include <vector>
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void SetUp() override {} 48 void SetUp() override {}
49 49
50 // Initializes the throttled file system with |limit| number of opened files 50 // Initializes the throttled file system with |limit| number of opened files
51 // at once. If 0, then no limit. 51 // at once. If 0, then no limit.
52 void SetUpFileSystem(size_t limit) { 52 void SetUpFileSystem(size_t limit) {
53 MountOptions options(kFileSystemId, kDisplayName); 53 MountOptions options(kFileSystemId, kDisplayName);
54 options.opened_files_limit = limit; 54 options.opened_files_limit = limit;
55 55
56 ProvidedFileSystemInfo file_system_info( 56 ProvidedFileSystemInfo file_system_info(
57 kExtensionId, options, base::FilePath() /* mount_path */, 57 kExtensionId, options, base::FilePath() /* mount_path */,
58 false /* configurable */, extensions::SOURCE_FILE); 58 false /* configurable */, true /* watchable */,
59 extensions::SOURCE_FILE);
59 60
60 file_system_.reset(new ThrottledFileSystem( 61 file_system_.reset(new ThrottledFileSystem(
61 make_scoped_ptr(new FakeProvidedFileSystem(file_system_info)))); 62 make_scoped_ptr(new FakeProvidedFileSystem(file_system_info))));
62 } 63 }
63 64
64 content::TestBrowserThreadBundle thread_bundle_; 65 content::TestBrowserThreadBundle thread_bundle_;
65 scoped_ptr<ThrottledFileSystem> file_system_; 66 scoped_ptr<ThrottledFileSystem> file_system_;
66 }; 67 };
67 68
68 TEST_F(FileSystemProviderThrottledFileSystemTest, OpenFile_LimitedToOneAtOnce) { 69 TEST_F(FileSystemProviderThrottledFileSystemTest, OpenFile_LimitedToOneAtOnce) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 151
151 base::RunLoop().RunUntilIdle(); 152 base::RunLoop().RunUntilIdle();
152 153
153 ASSERT_EQ(1u, first_open_log.size()); 154 ASSERT_EQ(1u, first_open_log.size());
154 EXPECT_EQ(base::File::FILE_OK, first_open_log[0].second); 155 EXPECT_EQ(base::File::FILE_OK, first_open_log[0].second);
155 EXPECT_EQ(0u, second_open_log.size()); 156 EXPECT_EQ(0u, second_open_log.size());
156 } 157 }
157 158
158 } // namespace file_system_provider 159 } // namespace file_system_provider
159 } // namespace chromeos 160 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698