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 #include "content/browser/fileapi/mock_file_change_observer.h"
7 #include "base/thread_task_runner_handle.h"
11 MockFileChangeObserver::MockFileChangeObserver()
12 : create_file_count_(0),
13 create_file_from_count_(0),
14 remove_file_count_(0),
15 modify_file_count_(0),
16 create_directory_count_(0),
17 remove_directory_count_(0) {}
19 MockFileChangeObserver::~MockFileChangeObserver() {}
22 ChangeObserverList
MockFileChangeObserver::CreateList(
23 MockFileChangeObserver
* observer
) {
24 ChangeObserverList list
;
25 return list
.AddObserver(observer
, base::ThreadTaskRunnerHandle::Get().get());
28 void MockFileChangeObserver::OnCreateFile(const FileSystemURL
& url
) {
32 void MockFileChangeObserver::OnCreateFileFrom(const FileSystemURL
& url
,
33 const FileSystemURL
& src
) {
34 create_file_from_count_
++;
37 void MockFileChangeObserver::OnRemoveFile(const FileSystemURL
& url
) {
41 void MockFileChangeObserver::OnModifyFile(const FileSystemURL
& url
) {
45 void MockFileChangeObserver::OnCreateDirectory(const FileSystemURL
& url
) {
46 create_directory_count_
++;
49 void MockFileChangeObserver::OnRemoveDirectory(const FileSystemURL
& url
) {
50 remove_directory_count_
++;
53 } // namespace storage