| 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/owned_register.h" | 5 #include "blimp/helium/owned_register.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "blimp/helium/coded_value_serializer.h" | 12 #include "blimp/helium/coded_value_serializer.h" |
| 13 #include "blimp/helium/helium_test.h" |
| 13 #include "blimp/helium/syncable_common.h" | 14 #include "blimp/helium/syncable_common.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite
.h" | 17 #include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite
.h" |
| 17 | 18 |
| 18 namespace blimp { | 19 namespace blimp { |
| 19 namespace helium { | 20 namespace helium { |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 class OwnedRegisterTest : public testing::Test { | 23 class OwnedRegisterTest : public HeliumTest { |
| 23 public: | 24 public: |
| 24 OwnedRegisterTest() {} | 25 OwnedRegisterTest() {} |
| 25 | 26 |
| 26 MOCK_METHOD0(OnEngineCallbackCalled, void()); | 27 MOCK_METHOD0(OnEngineCallbackCalled, void()); |
| 27 MOCK_METHOD0(OnClientCallbackCalled, void()); | 28 MOCK_METHOD0(OnClientCallbackCalled, void()); |
| 28 | 29 |
| 29 protected: | 30 protected: |
| 30 void InitRegisters(Peer owner) { | 31 void InitRegisters(Peer owner) { |
| 31 client_reg_ = base::MakeUnique<OwnedRegister<int>>(Peer::CLIENT, owner); | 32 client_reg_ = base::MakeUnique<OwnedRegister<int>>(Peer::CLIENT, owner); |
| 32 engine_reg_ = base::MakeUnique<OwnedRegister<int>>(Peer::ENGINE, owner); | 33 engine_reg_ = base::MakeUnique<OwnedRegister<int>>(Peer::ENGINE, owner); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 173 |
| 173 int value = 123; | 174 int value = 123; |
| 174 Revision revision = 1; | 175 Revision revision = 1; |
| 175 EXPECT_EQ(Result::ERR_PROTOCOL_ERROR, | 176 EXPECT_EQ(Result::ERR_PROTOCOL_ERROR, |
| 176 ApplyMockData(engine_reg_.get(), revision, value)); | 177 ApplyMockData(engine_reg_.get(), revision, value)); |
| 177 } | 178 } |
| 178 | 179 |
| 179 } // namespace | 180 } // namespace |
| 180 } // namespace helium | 181 } // namespace helium |
| 181 } // namespace blimp | 182 } // namespace blimp |
| OLD | NEW |