| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/core_impl/protocol_event_buffer.h" | 5 #include "components/sync/core_impl/protocol_event_buffer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | |
| 8 #include <stdint.h> | 7 #include <stdint.h> |
| 9 | 8 |
| 10 #include <memory> | |
| 11 | |
| 12 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 13 #include "components/sync/engine/events/poll_get_updates_request_event.h" | 10 #include "components/sync/engine/events/poll_get_updates_request_event.h" |
| 14 #include "components/sync/engine/events/protocol_event.h" | 11 #include "components/sync/engine/events/protocol_event.h" |
| 15 #include "components/sync/protocol/sync.pb.h" | 12 #include "components/sync/protocol/sync.pb.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 14 |
| 18 namespace syncer { | 15 namespace syncer { |
| 19 | 16 |
| 20 class ProtocolEventBufferTest : public ::testing::Test { | 17 class ProtocolEventBufferTest : public ::testing::Test { |
| 21 public: | 18 public: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 std::vector<std::unique_ptr<ProtocolEvent>> buffered_events( | 65 std::vector<std::unique_ptr<ProtocolEvent>> buffered_events( |
| 69 buffer_.GetBufferedProtocolEvents()); | 66 buffer_.GetBufferedProtocolEvents()); |
| 70 ASSERT_EQ(ProtocolEventBuffer::kBufferSize, buffered_events.size()); | 67 ASSERT_EQ(ProtocolEventBuffer::kBufferSize, buffered_events.size()); |
| 71 | 68 |
| 72 for (size_t i = 1; i < ProtocolEventBuffer::kBufferSize + 1; ++i) { | 69 for (size_t i = 1; i < ProtocolEventBuffer::kBufferSize + 1; ++i) { |
| 73 EXPECT_TRUE(HasId(*(buffered_events[i - 1]), static_cast<int64_t>(i))); | 70 EXPECT_TRUE(HasId(*(buffered_events[i - 1]), static_cast<int64_t>(i))); |
| 74 } | 71 } |
| 75 } | 72 } |
| 76 | 73 |
| 77 } // namespace syncer | 74 } // namespace syncer |
| OLD | NEW |