| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "sync/internal_api/protocol_event_buffer.h" | 8 #include "sync/internal_api/protocol_event_buffer.h" |
| 9 #include "sync/internal_api/public/events/poll_get_updates_request_event.h" | 9 #include "sync/internal_api/public/events/poll_get_updates_request_event.h" |
| 10 #include "sync/internal_api/public/events/protocol_event.h" | 10 #include "sync/internal_api/public/events/protocol_event.h" |
| 11 #include "sync/protocol/sync.pb.h" | 11 #include "sync/protocol/sync.pb.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace syncer { | 14 namespace syncer { |
| 15 | 15 |
| 16 class ProtocolEventBufferTest : public ::testing::Test { | 16 class ProtocolEventBufferTest : public ::testing::Test { |
| 17 public: | 17 public: |
| 18 ProtocolEventBufferTest(); | 18 ProtocolEventBufferTest(); |
| 19 virtual ~ProtocolEventBufferTest(); | 19 ~ProtocolEventBufferTest() override; |
| 20 | 20 |
| 21 static scoped_ptr<ProtocolEvent> MakeTestEvent(int64 id); | 21 static scoped_ptr<ProtocolEvent> MakeTestEvent(int64 id); |
| 22 static bool HasId(const ProtocolEvent& event, int64 id); | 22 static bool HasId(const ProtocolEvent& event, int64 id); |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 ProtocolEventBuffer buffer_; | 25 ProtocolEventBuffer buffer_; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 ProtocolEventBufferTest::ProtocolEventBufferTest() {} | 28 ProtocolEventBufferTest::ProtocolEventBufferTest() {} |
| 29 | 29 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 for (size_t i = 1; i < ProtocolEventBuffer::kBufferSize+1; ++i) { | 69 for (size_t i = 1; i < ProtocolEventBuffer::kBufferSize+1; ++i) { |
| 70 EXPECT_TRUE( | 70 EXPECT_TRUE( |
| 71 HasId(*(buffered_events[i-1]), static_cast<int64>(i))); | 71 HasId(*(buffered_events[i-1]), static_cast<int64>(i))); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 } // namespace syncer | 77 } // namespace syncer |
| OLD | NEW |