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

Side by Side Diff: sync/notifier/sync_system_resources_unittest.cc

Issue 14113050: sync: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « sync/notifier/sync_system_resources.cc ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/notifier/sync_system_resources.h" 5 #include "sync/notifier/sync_system_resources.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Owned by ScheduleWithDelay. 76 // Owned by ScheduleWithDelay.
77 MockClosure mock_closure; 77 MockClosure mock_closure;
78 base::Closure* should_not_run = mock_closure.CreateClosure(); 78 base::Closure* should_not_run = mock_closure.CreateClosure();
79 EXPECT_CALL(mock_closure, Run()).Times(0); 79 EXPECT_CALL(mock_closure, Run()).Times(0);
80 sync_system_resources_.internal_scheduler()->Schedule( 80 sync_system_resources_.internal_scheduler()->Schedule(
81 invalidation::TimeDelta::FromSeconds(0), should_not_run); 81 invalidation::TimeDelta::FromSeconds(0), should_not_run);
82 } 82 }
83 } 83 }
84 84
85 // Needed by |sync_system_resources_|. 85 // Needed by |sync_system_resources_|.
86 MessageLoop message_loop_; 86 base::MessageLoop message_loop_;
87 MockStateWriter mock_state_writer_; 87 MockStateWriter mock_state_writer_;
88 SyncSystemResources sync_system_resources_; 88 SyncSystemResources sync_system_resources_;
89 89
90 private: 90 private:
91 DISALLOW_COPY_AND_ASSIGN(SyncSystemResourcesTest); 91 DISALLOW_COPY_AND_ASSIGN(SyncSystemResourcesTest);
92 }; 92 };
93 93
94 // Make sure current_time() doesn't crash or leak. 94 // Make sure current_time() doesn't crash or leak.
95 TEST_F(SyncSystemResourcesTest, CurrentTime) { 95 TEST_F(SyncSystemResourcesTest, CurrentTime) {
96 invalidation::Time current_time = 96 invalidation::Time current_time =
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 .WillOnce(SaveArg<0>(&results)); 169 .WillOnce(SaveArg<0>(&results));
170 sync_system_resources_.storage()->WriteKey( 170 sync_system_resources_.storage()->WriteKey(
171 std::string(), "state", mock_storage_callback.CreateCallback()); 171 std::string(), "state", mock_storage_callback.CreateCallback());
172 message_loop_.RunUntilIdle(); 172 message_loop_.RunUntilIdle();
173 EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, std::string()), 173 EXPECT_EQ(invalidation::Status(invalidation::Status::SUCCESS, std::string()),
174 results); 174 results);
175 } 175 }
176 176
177 } // namespace 177 } // namespace
178 } // namespace syncer 178 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/sync_system_resources.cc ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698