OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/helium/lww_register.h" | 5 #include "blimp/helium/lww_register.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "blimp/helium/helium_test.h" |
10 #include "blimp/helium/revision_generator.h" | 11 #include "blimp/helium/revision_generator.h" |
11 #include "blimp/helium/version_vector.h" | 12 #include "blimp/helium/version_vector.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite
.h" | 14 #include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite
.h" |
14 | 15 |
15 namespace blimp { | 16 namespace blimp { |
16 namespace helium { | 17 namespace helium { |
17 namespace { | 18 namespace { |
18 | 19 |
19 class LwwRegisterTest : public testing::Test { | 20 class LwwRegisterTest : public HeliumTest { |
20 public: | 21 public: |
21 LwwRegisterTest() {} | 22 LwwRegisterTest() {} |
22 ~LwwRegisterTest() override = default; | 23 ~LwwRegisterTest() override = default; |
23 | 24 |
24 protected: | 25 protected: |
25 void Initialize(Peer bias) { | 26 void Initialize(Peer bias) { |
26 client_ = base::MakeUnique<LwwRegister<int>>(bias, Peer::CLIENT); | 27 client_ = base::MakeUnique<LwwRegister<int>>(bias, Peer::CLIENT); |
27 engine_ = base::MakeUnique<LwwRegister<int>>(bias, Peer::ENGINE); | 28 engine_ = base::MakeUnique<LwwRegister<int>>(bias, Peer::ENGINE); |
28 } | 29 } |
29 | 30 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 client_->Set(123); | 138 client_->Set(123); |
138 engine_->Set(456); | 139 engine_->Set(456); |
139 SyncFromClient(); | 140 SyncFromClient(); |
140 | 141 |
141 EXPECT_EQ(456, engine_->Get()); | 142 EXPECT_EQ(456, engine_->Get()); |
142 } | 143 } |
143 | 144 |
144 } // namespace | 145 } // namespace |
145 } // namespace helium | 146 } // namespace helium |
146 } // namespace blimp | 147 } // namespace blimp |
OLD | NEW |