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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 9 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "content/test/test_browser_thread.h" | 12 #include "content/test/test_browser_thread.h" |
13 | 13 |
| 14 using content::BrowserThread; |
| 15 |
14 namespace { | 16 namespace { |
15 | 17 |
16 // The token store factory implementation expects to be used from any well-known | 18 // The token store factory implementation expects to be used from any well-known |
17 // chrome thread other than UI. We could use any arbitrary thread; IO is | 19 // chrome thread other than UI. We could use any arbitrary thread; IO is |
18 // a good choice as this is the expected usage. | 20 // a good choice as this is the expected usage. |
19 const BrowserThread::ID kExpectedClientThreadId = BrowserThread::IO; | 21 const BrowserThread::ID kExpectedClientThreadId = BrowserThread::IO; |
20 const char* kRefServerUrl1 = "https://test.domain.example/foo?id=bar.bar"; | 22 const char* kRefServerUrl1 = "https://test.domain.example/foo?id=bar.bar"; |
21 const char* kRefServerUrl2 = "http://another.domain.example/foo?id=bar.bar#2"; | 23 const char* kRefServerUrl2 = "http://another.domain.example/foo?id=bar.bar#2"; |
22 const char* kOldDefaultNetworkProviderUrl = "https://www.google.com/loc/json"; | 24 const char* kOldDefaultNetworkProviderUrl = "https://www.google.com/loc/json"; |
23 | 25 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 NULL, NULL); | 169 NULL, NULL); |
168 } | 170 } |
169 | 171 |
170 IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, CancelRequest) { | 172 IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, CancelRequest) { |
171 BrowserThread::PostTask(kExpectedClientThreadId, FROM_HERE, | 173 BrowserThread::PostTask(kExpectedClientThreadId, FROM_HERE, |
172 base::Bind(&RunCancelTestInClientTread)); | 174 base::Bind(&RunCancelTestInClientTread)); |
173 ui_test_utils::RunMessageLoop(); | 175 ui_test_utils::RunMessageLoop(); |
174 } | 176 } |
175 | 177 |
176 } // namespace | 178 } // namespace |
OLD | NEW |