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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 class MessageLoopQuitListener | 30 class MessageLoopQuitListener |
31 : public LocationProviderBase::ListenerInterface { | 31 : public LocationProviderBase::ListenerInterface { |
32 public: | 32 public: |
33 MessageLoopQuitListener() | 33 MessageLoopQuitListener() |
34 : client_message_loop_(MessageLoop::current()), | 34 : client_message_loop_(MessageLoop::current()), |
35 updated_provider_(NULL), | 35 updated_provider_(NULL), |
36 movement_provider_(NULL) { | 36 movement_provider_(NULL) { |
37 CHECK(client_message_loop_); | 37 CHECK(client_message_loop_); |
38 } | 38 } |
39 // ListenerInterface | 39 // ListenerInterface |
40 virtual void LocationUpdateAvailable(LocationProviderBase* provider) { | 40 virtual void LocationUpdateAvailable( |
| 41 LocationProviderBase* provider) OVERRIDE { |
41 EXPECT_EQ(client_message_loop_, MessageLoop::current()); | 42 EXPECT_EQ(client_message_loop_, MessageLoop::current()); |
42 updated_provider_ = provider; | 43 updated_provider_ = provider; |
43 client_message_loop_->Quit(); | 44 client_message_loop_->Quit(); |
44 } | 45 } |
45 MessageLoop* client_message_loop_; | 46 MessageLoop* client_message_loop_; |
46 LocationProviderBase* updated_provider_; | 47 LocationProviderBase* updated_provider_; |
47 LocationProviderBase* movement_provider_; | 48 LocationProviderBase* movement_provider_; |
48 }; | 49 }; |
49 | 50 |
50 // A mock implementation of DeviceDataProviderImplBase for testing. Adapted from | 51 // A mock implementation of DeviceDataProviderImplBase for testing. Adapted from |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(1))); | 576 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(1))); |
576 } else { | 577 } else { |
577 const int evicted = i - kCacheSize; | 578 const int evicted = i - kCacheSize; |
578 EXPECT_FALSE(cache.FindPosition(CreateReferenceWifiScanData(evicted))); | 579 EXPECT_FALSE(cache.FindPosition(CreateReferenceWifiScanData(evicted))); |
579 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(evicted + 1))); | 580 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(evicted + 1))); |
580 } | 581 } |
581 } | 582 } |
582 } | 583 } |
583 | 584 |
584 } // namespace content | 585 } // namespace content |
OLD | NEW |