OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 optimal_job_time = optimal_job_time + poll; | 989 optimal_job_time = optimal_job_time + poll; |
990 SCOPED_TRACE(testing::Message() << "SyncShare # (" << i << ")"); | 990 SCOPED_TRACE(testing::Message() << "SyncShare # (" << i << ")"); |
991 EXPECT_GE(r.times[i], optimal_job_time); | 991 EXPECT_GE(r.times[i], optimal_job_time); |
992 EXPECT_EQ(GetUpdatesCallerInfo::PERIODIC, | 992 EXPECT_EQ(GetUpdatesCallerInfo::PERIODIC, |
993 r.snapshots[i]->source.updates_source); | 993 r.snapshots[i]->source.updates_source); |
994 } | 994 } |
995 } | 995 } |
996 | 996 |
997 // Test that poll failures are ignored. They should have no effect on | 997 // Test that poll failures are ignored. They should have no effect on |
998 // subsequent poll attempts, nor should they trigger a backoff/retry. | 998 // subsequent poll attempts, nor should they trigger a backoff/retry. |
999 TEST_F(SyncSchedulerTest, TransientPollFailure) { | 999 // This test is flaky under memory tools, see http://crbug.com/118370. |
| 1000 TEST_F(SyncSchedulerTest, FLAKY_TransientPollFailure) { |
1000 SyncShareRecords r; | 1001 SyncShareRecords r; |
1001 const TimeDelta poll_interval(TimeDelta::FromMilliseconds(10)); | 1002 const TimeDelta poll_interval(TimeDelta::FromMilliseconds(10)); |
1002 scheduler()->OnReceivedLongPollIntervalUpdate(poll_interval); | 1003 scheduler()->OnReceivedLongPollIntervalUpdate(poll_interval); |
1003 UseMockDelayProvider(); // Will cause test failure if backoff is initiated. | 1004 UseMockDelayProvider(); // Will cause test failure if backoff is initiated. |
1004 | 1005 |
1005 EXPECT_CALL(*syncer(), SyncShare(_,_,_)) | 1006 EXPECT_CALL(*syncer(), SyncShare(_,_,_)) |
1006 .WillOnce(DoAll(Invoke(sessions::test_util::SimulateCommitFailed), | 1007 .WillOnce(DoAll(Invoke(sessions::test_util::SimulateCommitFailed), |
1007 RecordSyncShare(&r))) | 1008 RecordSyncShare(&r))) |
1008 .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), | 1009 .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), |
1009 RecordSyncShare(&r))); | 1010 RecordSyncShare(&r))); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 PumpLoop(); | 1159 PumpLoop(); |
1159 // Pump again to run job. | 1160 // Pump again to run job. |
1160 PumpLoop(); | 1161 PumpLoop(); |
1161 | 1162 |
1162 StopSyncScheduler(); | 1163 StopSyncScheduler(); |
1163 | 1164 |
1164 EXPECT_TRUE(expected == context()->previous_session_routing_info()); | 1165 EXPECT_TRUE(expected == context()->previous_session_routing_info()); |
1165 } | 1166 } |
1166 | 1167 |
1167 } // namespace browser_sync | 1168 } // namespace browser_sync |
OLD | NEW |