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/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/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" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 void GeolocationAccessTokenStoreTest::DoTestStepAndWaitForResults( | 49 void GeolocationAccessTokenStoreTest::DoTestStepAndWaitForResults( |
50 const char* ref_url, const base::string16* token_to_expect, | 50 const char* ref_url, const base::string16* token_to_expect, |
51 const base::string16* token_to_set) { | 51 const base::string16* token_to_set) { |
52 ref_url_ = GURL(ref_url); | 52 ref_url_ = GURL(ref_url); |
53 token_to_expect_ = token_to_expect; | 53 token_to_expect_ = token_to_expect; |
54 token_to_set_ = token_to_set; | 54 token_to_set_ = token_to_set; |
55 | 55 |
56 BrowserThread::PostTask( | 56 BrowserThread::PostTask( |
57 kExpectedClientThreadId, FROM_HERE, | 57 kExpectedClientThreadId, FROM_HERE, |
58 base::Bind( | 58 base::BindOnce( |
59 &AccessTokenStore::LoadAccessTokens, | 59 &AccessTokenStore::LoadAccessTokens, token_store_, |
60 token_store_, | |
61 base::Bind( | 60 base::Bind( |
62 &GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded, | 61 &GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded, |
63 base::Unretained(this)))); | 62 base::Unretained(this)))); |
64 content::RunMessageLoop(); | 63 content::RunMessageLoop(); |
65 } | 64 } |
66 | 65 |
67 void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( | 66 void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( |
68 AccessTokenStore::AccessTokenMap access_token_map, | 67 AccessTokenStore::AccessTokenMap access_token_map, |
69 const scoped_refptr<net::URLRequestContextGetter>& context_getter) { | 68 const scoped_refptr<net::URLRequestContextGetter>& context_getter) { |
70 ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)) | 69 ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Set a token for the old default network provider url. | 113 // Set a token for the old default network provider url. |
115 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, | 114 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, |
116 nullptr, &ref_token1); | 115 nullptr, &ref_token1); |
117 // Check that the token related to the old default network provider url | 116 // Check that the token related to the old default network provider url |
118 // was deleted. | 117 // was deleted. |
119 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, | 118 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, |
120 nullptr, nullptr); | 119 nullptr, nullptr); |
121 } | 120 } |
122 | 121 |
123 } // namespace | 122 } // namespace |
OLD | NEW |