OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 "chrome/test/live_sync/live_sync_timing_helper.h" |
| 6 |
| 7 #include "base/time.h" |
| 8 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 LiveSyncTimingHelper::LiveSyncTimingHelper() {} |
| 12 |
| 13 LiveSyncTimingHelper::~LiveSyncTimingHelper() {} |
| 14 |
| 15 base::TimeDelta LiveSyncTimingHelper::TimeSyncCycle( |
| 16 ProfileSyncServiceHarness* client) { |
| 17 base::Time start = base::Time::Now(); |
| 18 EXPECT_TRUE(client->AwaitSyncCycleCompletion("Timing sync cycle.")); |
| 19 return base::Time::Now() - start; |
| 20 } |
| 21 |
| 22 base::TimeDelta LiveSyncTimingHelper::TimeMutualSyncCycle( |
| 23 ProfileSyncServiceHarness* client, ProfileSyncServiceHarness* partner) { |
| 24 base::Time start = base::Time::Now(); |
| 25 EXPECT_TRUE(client->AwaitMutualSyncCycleCompletion(partner)); |
| 26 return base::Time::Now() - start; |
| 27 } |
| 28 |
| 29 base::TimeDelta LiveSyncTimingHelper::TimeUntilQuiescence( |
| 30 std::vector<ProfileSyncServiceHarness*>& clients) { |
| 31 base::Time start = base::Time::Now(); |
| 32 EXPECT_TRUE(ProfileSyncServiceHarness::AwaitQuiescence(clients)); |
| 33 return base::Time::Now() - start; |
| 34 } |
OLD | NEW |