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 #include "content/browser/fileapi/mock_file_change_observer.h" 6 7 namespace storage { 8 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) {} 16 17 MockFileChangeObserver::~MockFileChangeObserver() {} 18 19 // static 20 ChangeObserverList MockFileChangeObserver::CreateList( 21 MockFileChangeObserver* observer) { 22 ChangeObserverList list; 23 return list.AddObserver(observer, base::MessageLoopProxy::current().get()); 24 } 25 26 void MockFileChangeObserver::OnCreateFile(const FileSystemURL& url) { 27 create_file_count_++; 28 } 29 30 void MockFileChangeObserver::OnCreateFileFrom(const FileSystemURL& url, 31 const FileSystemURL& src) { 32 create_file_from_count_++; 33 } 34 35 void MockFileChangeObserver::OnRemoveFile(const FileSystemURL& url) { 36 remove_file_count_++; 37 } 38 39 void MockFileChangeObserver::OnModifyFile(const FileSystemURL& url) { 40 modify_file_count_++; 41 } 42 43 void MockFileChangeObserver::OnCreateDirectory(const FileSystemURL& url) { 44 create_directory_count_++; 45 } 46 47 void MockFileChangeObserver::OnRemoveDirectory(const FileSystemURL& url) { 48 remove_directory_count_++; 49 } 50 51 } // namespace storage 52