| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/sync/notifier/chrome_invalidation_client.h" | 8 #include "chrome/browser/sync/notifier/chrome_invalidation_client.h" |
| 9 #include "chrome/browser/sync/notifier/state_writer.h" | 9 #include "chrome/browser/sync/notifier/state_writer.h" |
| 10 #include "jingle/notifier/base/fake_base_task.h" | 10 #include "jingle/notifier/base/fake_base_task.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace sync_notifier { | 14 namespace sync_notifier { |
| 15 | 15 |
| 16 using ::testing::_; | 16 using ::testing::_; |
| 17 using ::testing::Return; | 17 using ::testing::Return; |
| 18 | 18 |
| 19 class MockListener : public ChromeInvalidationClient::Listener { | 19 class MockListener : public ChromeInvalidationClient::Listener { |
| 20 public: | 20 public: |
| 21 MOCK_METHOD1(OnInvalidate, void(syncable::ModelType)); | 21 MOCK_METHOD2(OnInvalidate, void(syncable::ModelType, |
| 22 const std::string& payload)); |
| 22 MOCK_METHOD0(OnInvalidateAll, void()); | 23 MOCK_METHOD0(OnInvalidateAll, void()); |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 class MockStateWriter : public StateWriter { | 26 class MockStateWriter : public StateWriter { |
| 26 public: | 27 public: |
| 27 MOCK_METHOD1(WriteState, void(const std::string&)); | 28 MOCK_METHOD1(WriteState, void(const std::string&)); |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 class MockInvalidationClient : public invalidation::InvalidationClient { | 31 class MockInvalidationClient : public invalidation::InvalidationClient { |
| 31 public: | 32 public: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 notifier::FakeBaseTask fake_base_task2; | 88 notifier::FakeBaseTask fake_base_task2; |
| 88 client_.ChangeBaseTask(fake_base_task2.AsWeakPtr()); | 89 client_.ChangeBaseTask(fake_base_task2.AsWeakPtr()); |
| 89 } | 90 } |
| 90 | 91 |
| 91 SimulateInformOutboundListener(); | 92 SimulateInformOutboundListener(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 // TODO(akalin): Flesh out unit tests. | 95 // TODO(akalin): Flesh out unit tests. |
| 95 | 96 |
| 96 } // namespace sync_notifier | 97 } // namespace sync_notifier |
| OLD | NEW |