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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "content/browser/geolocation/geolocation_provider_impl.h" | 12 #include "content/browser/geolocation/geolocation_provider_impl.h" |
13 #include "content/browser/geolocation/mock_location_arbitrator.h" | 13 #include "content/browser/geolocation/mock_location_arbitrator.h" |
14 #include "content/public/browser/access_token_store.h" | 14 #include "content/public/browser/access_token_store.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/test/test_browser_thread.h" | 16 #include "content/public/test/test_browser_thread.h" |
17 #include "googleurl/src/gurl.h" | |
18 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
20 | 19 |
21 using testing::MakeMatcher; | 20 using testing::MakeMatcher; |
22 using testing::Matcher; | 21 using testing::Matcher; |
23 using testing::MatcherInterface; | 22 using testing::MatcherInterface; |
24 using testing::MatchResultListener; | 23 using testing::MatchResultListener; |
25 | 24 |
26 namespace content { | 25 namespace content { |
27 | 26 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 actual.speed == expected_.speed && | 89 actual.speed == expected_.speed && |
91 actual.timestamp == expected_.timestamp && | 90 actual.timestamp == expected_.timestamp && |
92 actual.error_code == expected_.error_code && | 91 actual.error_code == expected_.error_code && |
93 actual.error_message == expected_.error_message; | 92 actual.error_message == expected_.error_message; |
94 } | 93 } |
95 | 94 |
96 virtual void DescribeTo(::std::ostream* os) const OVERRIDE { | 95 virtual void DescribeTo(::std::ostream* os) const OVERRIDE { |
97 *os << "which matches the expected position"; | 96 *os << "which matches the expected position"; |
98 } | 97 } |
99 | 98 |
100 virtual void DescribeNegationTo(::std::ostream* os) const OVERRIDE{ | 99 virtual void DescribeNegationTo(::std::ostream* os) const OVERRIDE { |
101 *os << "which does not match the expected position"; | 100 *os << "which does not match the expected position"; |
102 } | 101 } |
103 | 102 |
104 private: | 103 private: |
105 Geoposition expected_; | 104 Geoposition expected_; |
106 | 105 |
107 DISALLOW_COPY_AND_ASSIGN(GeopositionEqMatcher); | 106 DISALLOW_COPY_AND_ASSIGN(GeopositionEqMatcher); |
108 }; | 107 }; |
109 | 108 |
110 Matcher<const Geoposition&> GeopositionEq(const Geoposition& expected) { | 109 Matcher<const Geoposition&> GeopositionEq(const Geoposition& expected) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 GeolocationProviderImpl::LocationUpdateCallback callback = base::Bind( | 240 GeolocationProviderImpl::LocationUpdateCallback callback = base::Bind( |
242 &MockGeolocationObserver::OnLocationUpdate, | 241 &MockGeolocationObserver::OnLocationUpdate, |
243 base::Unretained(&mock_observer)); | 242 base::Unretained(&mock_observer)); |
244 provider()->AddLocationUpdateCallback(callback, false); | 243 provider()->AddLocationUpdateCallback(callback, false); |
245 provider()->RemoveLocationUpdateCallback(callback); | 244 provider()->RemoveLocationUpdateCallback(callback); |
246 // Wait for the providers to be stopped now that all clients are gone. | 245 // Wait for the providers to be stopped now that all clients are gone. |
247 EXPECT_FALSE(ProvidersStarted()); | 246 EXPECT_FALSE(ProvidersStarted()); |
248 } | 247 } |
249 | 248 |
250 } // namespace content | 249 } // namespace content |
OLD | NEW |