| 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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "content/browser/geolocation/fake_access_token_store.h" | 12 #include "content/browser/geolocation/fake_access_token_store.h" |
| 13 #include "content/browser/geolocation/network_location_provider.h" | 13 #include "content/browser/geolocation/network_location_provider.h" |
| 14 #include "content/test/test_url_fetcher_factory.h" | 14 #include "content/test/test_url_fetcher_factory.h" |
| 15 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using content::FakeAccessTokenStore; |
| 19 |
| 18 namespace { | 20 namespace { |
| 19 | 21 |
| 20 // Constants used in multiple tests. | 22 // Constants used in multiple tests. |
| 21 const char kTestServerUrl[] = "https://www.geolocation.test/service"; | 23 const char kTestServerUrl[] = "https://www.geolocation.test/service"; |
| 22 const char kTestHost[] = "myclienthost.test"; | 24 const char kTestHost[] = "myclienthost.test"; |
| 23 const char kTestHostUrl[] = "http://myclienthost.test/some/path"; | 25 const char kTestHostUrl[] = "http://myclienthost.test/some/path"; |
| 24 const char kTestJson[] = "?browser=chromium&sensor=true"; | 26 const char kTestJson[] = "?browser=chromium&sensor=true"; |
| 25 const char kTestBrowser[] = "browser=chromium"; | 27 const char kTestBrowser[] = "browser=chromium"; |
| 26 const char kTestSensor[] = "sensor=true"; | 28 const char kTestSensor[] = "sensor=true"; |
| 27 // Using #define so we can easily paste this into various other strings. | 29 // Using #define so we can easily paste this into various other strings. |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(1))); | 549 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(1))); |
| 548 } else { | 550 } else { |
| 549 const int evicted = i - kCacheSize; | 551 const int evicted = i - kCacheSize; |
| 550 EXPECT_FALSE(cache.FindPosition(CreateReferenceWifiScanData(evicted))); | 552 EXPECT_FALSE(cache.FindPosition(CreateReferenceWifiScanData(evicted))); |
| 551 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(evicted + 1))); | 553 EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(evicted + 1))); |
| 552 } | 554 } |
| 553 } | 555 } |
| 554 } | 556 } |
| 555 | 557 |
| 556 } // namespace | 558 } // namespace |
| OLD | NEW |