| 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 "components/sync/sessions_impl/nudge_tracker.h" | 5 #include "components/sync/engine_impl/cycle/nudge_tracker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 28 return testing::AssertionSuccess(); | 28 return testing::AssertionSuccess(); |
| 29 } else { | 29 } else { |
| 30 return testing::AssertionFailure() | 30 return testing::AssertionFailure() |
| 31 << "Left side " << ModelTypeSetToString(a) | 31 << "Left side " << ModelTypeSetToString(a) |
| 32 << ", does not match rigth side: " << ModelTypeSetToString(b); | 32 << ", does not match rigth side: " << ModelTypeSetToString(b); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 namespace sessions { | |
| 39 | |
| 40 class NudgeTrackerTest : public ::testing::Test { | 38 class NudgeTrackerTest : public ::testing::Test { |
| 41 public: | 39 public: |
| 42 NudgeTrackerTest() { SetInvalidationsInSync(); } | 40 NudgeTrackerTest() { SetInvalidationsInSync(); } |
| 43 | 41 |
| 44 static size_t GetHintBufferSize() { | 42 static size_t GetHintBufferSize() { |
| 45 // Assumes that no test has adjusted this size. | 43 // Assumes that no test has adjusted this size. |
| 46 return NudgeTracker::kDefaultMaxPayloadsPerType; | 44 return NudgeTracker::kDefaultMaxPayloadsPerType; |
| 47 } | 45 } |
| 48 | 46 |
| 49 bool InvalidationsOutOfSync() const { | 47 bool InvalidationsOutOfSync() const { |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 RecordSuccessfulSyncCycle(); | 957 RecordSuccessfulSyncCycle(); |
| 960 EXPECT_TRUE(IsInvalidationAcknowledged(inv1_id)); | 958 EXPECT_TRUE(IsInvalidationAcknowledged(inv1_id)); |
| 961 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id)); | 959 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id)); |
| 962 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id)); | 960 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id)); |
| 963 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id)); | 961 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id)); |
| 964 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id)); | 962 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id)); |
| 965 | 963 |
| 966 EXPECT_TRUE(AllInvalidationsAccountedFor()); | 964 EXPECT_TRUE(AllInvalidationsAccountedFor()); |
| 967 } | 965 } |
| 968 | 966 |
| 969 } // namespace sessions | |
| 970 } // namespace syncer | 967 } // namespace syncer |
| OLD | NEW |