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.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TEST_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TEST_UTIL_H_
10 #include "base/files/file.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/scoped_vector.h"
14 namespace extensions
{
16 } // namespace extensions
19 namespace file_system_provider
{
20 namespace operations
{
23 // Fake event dispatcher implementation with extra logging capability. Acts as
24 // a providing extension end-point.
25 class LoggingDispatchEventImpl
{
27 explicit LoggingDispatchEventImpl(bool dispatch_reply
);
28 virtual ~LoggingDispatchEventImpl();
30 // Handles sending an event to a providing extension.
31 bool OnDispatchEventImpl(scoped_ptr
<extensions::Event
> event
);
33 // Returns events sent to providing extensions.
34 ScopedVector
<extensions::Event
>& events() { return events_
; }
37 ScopedVector
<extensions::Event
> events_
;
40 DISALLOW_COPY_AND_ASSIGN(LoggingDispatchEventImpl
);
43 // Container for remembering operations' callback invocations.
44 typedef std::vector
<base::File::Error
> StatusCallbackLog
;
46 // Pushes a result of the StatusCallback invocation to a log vector.
47 void LogStatusCallback(StatusCallbackLog
* log
, base::File::Error result
);
50 } // namespace operations
51 } // namespace file_system_provider
52 } // namespace chromeos
54 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OPERATIONS_TEST_UTIL_H_