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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h

Issue 210803003: [fsp] Decouple file_service_provider::Service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H _
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTEM_H _
7
8 #include <string>
9
10 #include "base/files/file_path.h"
11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
13
14 class Profile;
15
16 namespace chromeos {
17 namespace file_system_provider {
18
19 class RequestManager;
20
21 // Fake provided file system implementation. Does not communicate with target
22 // extensions. Used for unit tests.
23 class FakeProvidedFileSystem : public ProvidedFileSystemInterface {
24 public:
25 FakeProvidedFileSystem();
26 explicit FakeProvidedFileSystem(
27 const ProvidedFileSystemInfo& file_system_info);
28 virtual ~FakeProvidedFileSystem();
29
30 // ProvidedFileSystemInterface overrides.
31 virtual bool RequestUnmount(
32 const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE;
33 virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE;
34
35 private:
36 ProvidedFileSystemInfo file_system_info_;
37 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystem);
38 };
39
40 // Factory creating fake provided file system instances.
41 class FakeProvidedFileSystemFactory
42 : public ProvidedFileSystemFactoryInterface {
hashimoto 2014/04/11 06:01:50 Do we need an interface for this? Can't this be re
mtomasz 2014/04/11 07:11:56 I just made it for consistency with other factorie
hashimoto 2014/04/14 10:43:42 How common do you think this pattern is? There are
mtomasz 2014/04/15 02:46:40 I just took a look, and there is a lot of single-m
hashimoto 2014/04/15 07:22:45 I know, as I said, what I wanted to know is the ra
mtomasz 2014/04/15 09:42:12 I changed my mind. Let's go with SetFactoryForTest
43 public:
44 FakeProvidedFileSystemFactory();
45 virtual ~FakeProvidedFileSystemFactory();
46
47 // ProvidedFileSystemFactoryInterface overrides.
48 virtual ProvidedFileSystemInterface* Create(
49 Profile* profile,
50 RequestManager* request_manager,
51 const ProvidedFileSystemInfo& file_system_info) OVERRIDE;
52
53 private:
54 DISALLOW_COPY_AND_ASSIGN(FakeProvidedFileSystemFactory);
55 };
56
57 } // namespace file_system_provider
58 } // namespace chromeos
59
60 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FAKE_PROVIDED_FILE_SYSTE M_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698