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

Side by Side Diff: chrome/browser/sync_file_system/sync_task_manager_unittest.cc

Issue 87463002: Only re-enable remote service if the task used the network. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync_file_system/sync_task_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/sync_file_system/sync_task_manager.h" 9 #include "chrome/browser/sync_file_system/sync_task_manager.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 task_manager_->Initialize(SYNC_STATUS_OK); 50 task_manager_->Initialize(SYNC_STATUS_OK);
51 maybe_schedule_next_task_count_ = 0; 51 maybe_schedule_next_task_count_ = 0;
52 } 52 }
53 virtual ~TaskManagerClient() {} 53 virtual ~TaskManagerClient() {}
54 54
55 // DriveFileSyncManager::Client overrides. 55 // DriveFileSyncManager::Client overrides.
56 virtual void MaybeScheduleNextTask() OVERRIDE { 56 virtual void MaybeScheduleNextTask() OVERRIDE {
57 ++maybe_schedule_next_task_count_; 57 ++maybe_schedule_next_task_count_;
58 } 58 }
59 virtual void NotifyLastOperationStatus( 59 virtual void NotifyLastOperationStatus(
60 SyncStatusCode last_operation_status) OVERRIDE { 60 SyncStatusCode last_operation_status,
61 bool last_operation_used_network) OVERRIDE {
61 last_operation_status_ = last_operation_status; 62 last_operation_status_ = last_operation_status;
62 } 63 }
63 64
64 void ScheduleTask(SyncStatusCode status_to_return, 65 void ScheduleTask(SyncStatusCode status_to_return,
65 const SyncStatusCallback& callback) { 66 const SyncStatusCallback& callback) {
66 task_manager_->ScheduleTask( 67 task_manager_->ScheduleTask(
67 base::Bind(&TaskManagerClient::DoTask, AsWeakPtr(), 68 base::Bind(&TaskManagerClient::DoTask, AsWeakPtr(),
68 status_to_return, false /* idle */), 69 status_to_return, false /* idle */),
69 callback); 70 callback);
70 } 71 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 330
330 EXPECT_EQ(kStatus1, callback_status1); 331 EXPECT_EQ(kStatus1, callback_status1);
331 EXPECT_EQ(kStatus2, callback_status2); 332 EXPECT_EQ(kStatus2, callback_status2);
332 EXPECT_EQ(kStatus3, callback_status3); 333 EXPECT_EQ(kStatus3, callback_status3);
333 EXPECT_EQ(kStatus4, callback_status4); 334 EXPECT_EQ(kStatus4, callback_status4);
334 EXPECT_EQ(kStatus5, callback_status5); 335 EXPECT_EQ(kStatus5, callback_status5);
335 EXPECT_EQ(5, callback_count); 336 EXPECT_EQ(5, callback_count);
336 } 337 }
337 338
338 } // namespace sync_file_system 339 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/sync_task_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698