Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc

Issue 106433007: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/settings/device_oauth2_token_service.h" 5 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/prefs/testing_pref_service.h" 8 #include "base/prefs/testing_pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/chromeos/settings/token_encryptor.h" 10 #include "chrome/browser/chromeos/settings/token_encryptor.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 SystemSaltGetter::Shutdown(); 111 SystemSaltGetter::Shutdown();
112 DBusThreadManager::Shutdown(); 112 DBusThreadManager::Shutdown();
113 base::RunLoop().RunUntilIdle(); 113 base::RunLoop().RunUntilIdle();
114 } 114 }
115 115
116 // Utility method to set a value in Local State for the device refresh token 116 // Utility method to set a value in Local State for the device refresh token
117 // (it must have a non-empty value or it won't be used). 117 // (it must have a non-empty value or it won't be used).
118 void SetDeviceRefreshTokenInLocalState(const std::string& refresh_token) { 118 void SetDeviceRefreshTokenInLocalState(const std::string& refresh_token) {
119 scoped_testing_local_state_.Get()->SetManagedPref( 119 scoped_testing_local_state_.Get()->SetManagedPref(
120 prefs::kDeviceRobotAnyApiRefreshToken, 120 prefs::kDeviceRobotAnyApiRefreshToken,
121 Value::CreateStringValue(refresh_token)); 121 base::Value::CreateStringValue(refresh_token));
122 } 122 }
123 123
124 std::string GetValidTokenInfoResponse(const std::string email) { 124 std::string GetValidTokenInfoResponse(const std::string email) {
125 return "{ \"email\": \"" + email + "\"," 125 return "{ \"email\": \"" + email + "\","
126 " \"user_id\": \"1234567890\" }"; 126 " \"user_id\": \"1234567890\" }";
127 } 127 }
128 128
129 // A utility method to return fake URL results, for testing the refresh token 129 // A utility method to return fake URL results, for testing the refresh token
130 // validation logic. For a successful validation attempt, this method will be 130 // validation logic. For a successful validation attempt, this method will be
131 // called three times for the steps listed below (steps 1 and 2 happen in 131 // called three times for the steps listed below (steps 1 and 2 happen in
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 kValidatorUrlFetcherId, 385 kValidatorUrlFetcherId,
386 net::HTTP_OK, 386 net::HTTP_OK,
387 GetValidTokenInfoResponse("service_acct@g.com")); 387 GetValidTokenInfoResponse("service_acct@g.com"));
388 388
389 // All fetches were successful, but consumer still given error since 389 // All fetches were successful, but consumer still given error since
390 // the token owner doesn't match the policy value. 390 // the token owner doesn't match the policy value.
391 AssertConsumerTokensAndErrors(0, 1); 391 AssertConsumerTokensAndErrors(0, 1);
392 } 392 }
393 393
394 } // namespace chromeos 394 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698