| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "google/cacheinvalidation/include/invalidation-client.h" | 8 #include "google/cacheinvalidation/include/invalidation-client.h" |
| 9 #include "google/cacheinvalidation/include/types.h" | 9 #include "google/cacheinvalidation/include/types.h" |
| 10 #include "google/cacheinvalidation/v2/types.pb.h" | 10 #include "google/cacheinvalidation/v2/types.pb.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 MOCK_METHOD1(OnInvalidate, void(const syncable::ModelTypePayloadMap&)); | 45 MOCK_METHOD1(OnInvalidate, void(const syncable::ModelTypePayloadMap&)); |
| 46 MOCK_METHOD1(OnSessionStatusChanged, void(bool)); | 46 MOCK_METHOD1(OnSessionStatusChanged, void(bool)); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class MockInvalidationStateTracker | 49 class MockInvalidationStateTracker |
| 50 : public InvalidationStateTracker, | 50 : public InvalidationStateTracker, |
| 51 public base::SupportsWeakPtr<MockInvalidationStateTracker> { | 51 public base::SupportsWeakPtr<MockInvalidationStateTracker> { |
| 52 public: | 52 public: |
| 53 MOCK_CONST_METHOD0(GetAllMaxVersions, InvalidationVersionMap()); | 53 MOCK_CONST_METHOD0(GetAllMaxVersions, InvalidationVersionMap()); |
| 54 MOCK_METHOD2(SetMaxVersion, void(syncable::ModelType, int64)); | 54 MOCK_METHOD2(SetMaxVersion, void(syncable::ModelType, int64)); |
| 55 MOCK_CONST_METHOD0(GetInvalidationState, std::string()); |
| 56 MOCK_METHOD1(SetInvalidationState, void(const std::string&)); |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 class MockStateWriter : public StateWriter { | 59 class MockStateWriter : public StateWriter { |
| 58 public: | 60 public: |
| 59 MOCK_METHOD1(WriteState, void(const std::string&)); | 61 MOCK_METHOD1(WriteState, void(const std::string&)); |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 } // namespace | 64 } // namespace |
| 63 | 65 |
| 64 class ChromeInvalidationClientTest : public testing::Test { | 66 class ChromeInvalidationClientTest : public testing::Test { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // Registered types should be preserved across Stop/Start. | 268 // Registered types should be preserved across Stop/Start. |
| 267 TearDown(); | 269 TearDown(); |
| 268 SetUp(); | 270 SetUp(); |
| 269 EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, ""))); | 271 EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, ""))); |
| 270 FireInvalidateAll(); | 272 FireInvalidateAll(); |
| 271 } | 273 } |
| 272 | 274 |
| 273 // TODO(akalin): Flesh out unit tests. | 275 // TODO(akalin): Flesh out unit tests. |
| 274 | 276 |
| 275 } // namespace sync_notifier | 277 } // namespace sync_notifier |
| OLD | NEW |