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"
9 MockFileChangeObserver::MockFileChangeObserver()
10 : create_file_count_(0),
11 create_file_from_count_(0),
12 remove_file_count_(0),
13 modify_file_count_(0),
14 create_directory_count_(0),
15 remove_directory_count_(0) {}
17 MockFileChangeObserver::~MockFileChangeObserver() {}
20 ChangeObserverList
MockFileChangeObserver::CreateList(
21 MockFileChangeObserver
* observer
) {
22 ChangeObserverList list
;
23 return list
.AddObserver(observer
, base::MessageLoopProxy::current().get());
26 void MockFileChangeObserver::OnCreateFile(const FileSystemURL
& url
) {
30 void MockFileChangeObserver::OnCreateFileFrom(const FileSystemURL
& url
,
31 const FileSystemURL
& src
) {
32 create_file_from_count_
++;
35 void MockFileChangeObserver::OnRemoveFile(const FileSystemURL
& url
) {
39 void MockFileChangeObserver::OnModifyFile(const FileSystemURL
& url
) {
43 void MockFileChangeObserver::OnCreateDirectory(const FileSystemURL
& url
) {
44 create_directory_count_
++;
47 void MockFileChangeObserver::OnRemoveDirectory(const FileSystemURL
& url
) {
48 remove_directory_count_
++;
51 } // namespace storage