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" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 token_to_set_ = token_to_set; | 69 token_to_set_ = token_to_set; |
70 | 70 |
71 BrowserThread::PostTask( | 71 BrowserThread::PostTask( |
72 kExpectedClientThreadId, FROM_HERE, | 72 kExpectedClientThreadId, FROM_HERE, |
73 base::Bind( | 73 base::Bind( |
74 &StartTestStepFromClientThread, | 74 &StartTestStepFromClientThread, |
75 &token_store_, | 75 &token_store_, |
76 base::Bind( | 76 base::Bind( |
77 &GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded, | 77 &GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded, |
78 base::Unretained(this)))); | 78 base::Unretained(this)))); |
79 ui_test_utils::RunMessageLoop(); | 79 content::RunMessageLoop(); |
80 } | 80 } |
81 | 81 |
82 void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( | 82 void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( |
83 AccessTokenStore::AccessTokenSet access_token_set, | 83 AccessTokenStore::AccessTokenSet access_token_set, |
84 net::URLRequestContextGetter* context_getter) { | 84 net::URLRequestContextGetter* context_getter) { |
85 ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)) | 85 ASSERT_TRUE(BrowserThread::CurrentlyOn(kExpectedClientThreadId)) |
86 << "Callback from token factory should be from the same thread as the " | 86 << "Callback from token factory should be from the same thread as the " |
87 "LoadAccessTokenStores request was made on"; | 87 "LoadAccessTokenStores request was made on"; |
88 DCHECK(context_getter); | 88 DCHECK(context_getter); |
89 AccessTokenStore::AccessTokenSet::const_iterator item = | 89 AccessTokenStore::AccessTokenSet::const_iterator item = |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Set a token for the old default network provider url. | 128 // Set a token for the old default network provider url. |
129 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, | 129 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, |
130 NULL, &ref_token1); | 130 NULL, &ref_token1); |
131 // Check that the token related to the old default network provider url | 131 // Check that the token related to the old default network provider url |
132 // was deleted. | 132 // was deleted. |
133 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, | 133 DoTestStepAndWaitForResults(kOldDefaultNetworkProviderUrl, |
134 NULL, NULL); | 134 NULL, NULL); |
135 } | 135 } |
136 | 136 |
137 } // namespace | 137 } // namespace |
OLD | NEW |