| 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 "chrome/browser/sync/glue/android_invalidator_bridge_proxy.h" | 5 #include "chrome/browser/sync/glue/android_invalidator_bridge_proxy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return invalidator_.get(); | 51 return invalidator_.get(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 void DestroyInvalidator() { | 55 void DestroyInvalidator() { |
| 56 invalidator_.reset(); | 56 invalidator_.reset(); |
| 57 bridge_.StopForShutdown(); | 57 bridge_.StopForShutdown(); |
| 58 ui_loop_.RunUntilIdle(); | 58 ui_loop_.RunUntilIdle(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 MessageLoop ui_loop_; | 61 base::MessageLoop ui_loop_; |
| 62 content::TestBrowserThread ui_thread_; | 62 content::TestBrowserThread ui_thread_; |
| 63 ::testing::NiceMock<ProfileMock> mock_profile_; | 63 ::testing::NiceMock<ProfileMock> mock_profile_; |
| 64 AndroidInvalidatorBridge bridge_; | 64 AndroidInvalidatorBridge bridge_; |
| 65 scoped_ptr<AndroidInvalidatorBridgeProxy> invalidator_; | 65 scoped_ptr<AndroidInvalidatorBridgeProxy> invalidator_; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 TEST_F(AndroidInvalidatorBridgeProxyTest, HandlerMethods) { | 68 TEST_F(AndroidInvalidatorBridgeProxyTest, HandlerMethods) { |
| 69 syncer::ObjectIdSet ids; | 69 syncer::ObjectIdSet ids; |
| 70 ids.insert(invalidation::ObjectId(1, "id1")); | 70 ids.insert(invalidation::ObjectId(1, "id1")); |
| 71 | 71 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 85 // The AndroidInvalidatorBridge never enters an error state. | 85 // The AndroidInvalidatorBridge never enters an error state. |
| 86 EXPECT_EQ(syncer::INVALIDATIONS_ENABLED, | 86 EXPECT_EQ(syncer::INVALIDATIONS_ENABLED, |
| 87 GetInvalidator()->GetInvalidatorState()); | 87 GetInvalidator()->GetInvalidatorState()); |
| 88 EXPECT_EQ(syncer::INVALIDATIONS_ENABLED, | 88 EXPECT_EQ(syncer::INVALIDATIONS_ENABLED, |
| 89 GetBridge()->GetInvalidatorState()); | 89 GetBridge()->GetInvalidatorState()); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 } // namespace browser_sync | 93 } // namespace browser_sync |
| 94 | 94 |
| OLD | NEW |