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

Side by Side Diff: content/browser/fileapi/mock_file_update_observer.cc

Issue 579153002: Add update observer to file_system_operation_impl_unittest for (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 #include "content/browser/fileapi/mock_file_update_observer.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace storage {
9
10 MockFileUpdateObserver::MockFileUpdateObserver() {}
tzik 2014/09/19 03:44:00 |is_ready_| needs to be initialized here.
iseki 2014/09/19 04:55:29 Done.
11
12 MockFileUpdateObserver::~MockFileUpdateObserver() {}
13
14 // static
15 UpdateObserverList MockFileUpdateObserver::CreateList(
16 MockFileUpdateObserver* observer) {
17 UpdateObserverList list;
18 return list.AddObserver(observer, base::MessageLoopProxy::current().get());
tzik 2014/09/19 03:44:00 Since MessageLoopProxy is moderately deprecated, c
iseki 2014/09/19 04:55:29 Done.
19 }
20
21 void MockFileUpdateObserver::OnStartUpdate(const FileSystemURL& url) {
22 if (is_ready_)
23 ++start_update_count_[url.path().value()];
24 }
25
26 void MockFileUpdateObserver::OnUpdate(const FileSystemURL& url, int64 delta) {
27 if (!is_ready_)
28 return;
29 int start = start_update_count_[url.path().value()];
30 int end = end_update_count_[url.path().value()];
31 EXPECT_LT(0, start - end);
32 }
33
34 void MockFileUpdateObserver::OnEndUpdate(const FileSystemURL& url) {
35 if (is_ready_)
36 ++end_update_count_[url.path().value()];
37 }
38
39 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698