| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/syncable/model_type.h" | 10 #include "chrome/browser/sync/syncable/model_type.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace | 71 } // namespace |
| 72 | 72 |
| 73 class ChromeInvalidationClientTest : public testing::Test { | 73 class ChromeInvalidationClientTest : public testing::Test { |
| 74 protected: | 74 protected: |
| 75 virtual void SetUp() { | 75 virtual void SetUp() { |
| 76 client_.Start(kClientId, kClientInfo, kState, | 76 client_.Start(kClientId, kClientInfo, kState, |
| 77 InvalidationVersionMap(), | 77 InvalidationVersionMap(), |
| 78 browser_sync::WeakHandle<InvalidationVersionTracker>( | 78 browser_sync::MakeWeakHandle( |
| 79 mock_invalidation_version_tracker_.AsWeakPtr()), | 79 mock_invalidation_version_tracker_.AsWeakPtr()), |
| 80 &mock_listener_, &mock_state_writer_, | 80 &mock_listener_, &mock_state_writer_, |
| 81 fake_base_task_.AsWeakPtr()); | 81 fake_base_task_.AsWeakPtr()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 virtual void TearDown() { | 84 virtual void TearDown() { |
| 85 client_.Stop(); | 85 client_.Stop(); |
| 86 message_loop_.RunAllPending(); | 86 message_loop_.RunAllPending(); |
| 87 } | 87 } |
| 88 | 88 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // Registered types should be preserved across Stop/Start. | 283 // Registered types should be preserved across Stop/Start. |
| 284 TearDown(); | 284 TearDown(); |
| 285 SetUp(); | 285 SetUp(); |
| 286 EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, ""))); | 286 EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, ""))); |
| 287 FireInvalidateAll(); | 287 FireInvalidateAll(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 // TODO(akalin): Flesh out unit tests. | 290 // TODO(akalin): Flesh out unit tests. |
| 291 | 291 |
| 292 } // namespace sync_notifier | 292 } // namespace sync_notifier |
| OLD | NEW |