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 "base/memory/singleton.h" | 5 #include "base/memory/singleton.h" |
6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
7 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h
" | 7 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h
" |
8 #include "content/browser/geolocation/fake_access_token_store.h" | 8 #include "content/browser/geolocation/fake_access_token_store.h" |
9 #include "content/browser/geolocation/geolocation_provider.h" | 9 #include "content/browser/geolocation/geolocation_provider.h" |
10 #include "content/browser/geolocation/location_arbitrator.h" | 10 #include "content/browser/geolocation/location_arbitrator.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 virtual ~StartStopMockLocationProvider() { | 79 virtual ~StartStopMockLocationProvider() { |
80 Die(); | 80 Die(); |
81 } | 81 } |
82 | 82 |
83 MOCK_METHOD0(Die, void()); | 83 MOCK_METHOD0(Die, void()); |
84 | 84 |
85 virtual bool StartProvider(bool high_accuracy) { | 85 virtual bool StartProvider(bool high_accuracy) { |
86 bool result = MockLocationProvider::StartProvider(high_accuracy); | 86 bool result = MockLocationProvider::StartProvider(high_accuracy); |
87 test_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 87 test_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
88 return result; | 88 return result; |
89 } | 89 } |
90 | 90 |
91 virtual void StopProvider() { | 91 virtual void StopProvider() { |
92 MockLocationProvider::StopProvider(); | 92 MockLocationProvider::StopProvider(); |
93 test_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 93 test_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
94 } | 94 } |
95 | 95 |
96 private: | 96 private: |
97 MessageLoop* test_loop_; | 97 MessageLoop* test_loop_; |
98 }; | 98 }; |
99 | 99 |
100 class MockDependencyFactory : public GeolocationArbitratorDependencyFactory { | 100 class MockDependencyFactory : public GeolocationArbitratorDependencyFactory { |
101 public: | 101 public: |
102 MockDependencyFactory(MessageLoop* test_loop_, | 102 MockDependencyFactory(MessageLoop* test_loop_, |
103 AccessTokenStore* access_token_store) | 103 AccessTokenStore* access_token_store) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 provider_->RemoveObserver(&null_observer); | 171 provider_->RemoveObserver(&null_observer); |
172 // Wait for the providers to be stopped. | 172 // Wait for the providers to be stopped. |
173 event.Wait(); | 173 event.Wait(); |
174 event.Reset(); | 174 event.Reset(); |
175 EXPECT_TRUE(provider_->IsRunning()); | 175 EXPECT_TRUE(provider_->IsRunning()); |
176 | 176 |
177 GeolocationArbitrator::SetDependencyFactoryForTest(NULL); | 177 GeolocationArbitrator::SetDependencyFactoryForTest(NULL); |
178 } | 178 } |
179 | 179 |
180 } // namespace | 180 } // namespace |
OLD | NEW |