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_METHOD2(OnInvalidate, void(syncable::ModelType, | 21 MOCK_METHOD1(OnInvalidate, void(syncable::ModelType)); |
22 const std::string& payload)); | |
23 MOCK_METHOD0(OnInvalidateAll, void()); | 22 MOCK_METHOD0(OnInvalidateAll, void()); |
24 }; | 23 }; |
25 | 24 |
26 class MockStateWriter : public StateWriter { | 25 class MockStateWriter : public StateWriter { |
27 public: | 26 public: |
28 MOCK_METHOD1(WriteState, void(const std::string&)); | 27 MOCK_METHOD1(WriteState, void(const std::string&)); |
29 }; | 28 }; |
30 | 29 |
31 class MockInvalidationClient : public invalidation::InvalidationClient { | 30 class MockInvalidationClient : public invalidation::InvalidationClient { |
32 public: | 31 public: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 notifier::FakeBaseTask fake_base_task2; | 89 notifier::FakeBaseTask fake_base_task2; |
91 client_.ChangeBaseTask(fake_base_task2.AsWeakPtr()); | 90 client_.ChangeBaseTask(fake_base_task2.AsWeakPtr()); |
92 } | 91 } |
93 | 92 |
94 SimulateInformOutboundListener(); | 93 SimulateInformOutboundListener(); |
95 } | 94 } |
96 | 95 |
97 // TODO(akalin): Flesh out unit tests. | 96 // TODO(akalin): Flesh out unit tests. |
98 | 97 |
99 } // namespace sync_notifier | 98 } // namespace sync_notifier |
OLD | NEW |