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

Unified Diff: google_apis/gaia/fake_gaia.h

Issue 1141163002: Browser tests for the new way of handling device ID in Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device_id
Patch Set: Comments addressed. Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | google_apis/gaia/fake_gaia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/fake_gaia.h
diff --git a/google_apis/gaia/fake_gaia.h b/google_apis/gaia/fake_gaia.h
index e50b7cb37bbaceddbcd7521f794eeb5953da788b..1f1a3eff9c5c58353c8d56a7d61dafecbacf5a5d 100644
--- a/google_apis/gaia/fake_gaia.h
+++ b/google_apis/gaia/fake_gaia.h
@@ -31,7 +31,8 @@ class HttpResponse;
// be registered as an additional request handler.
class FakeGaia {
public:
- typedef std::set<std::string> ScopeSet;
+ using ScopeSet = std::set<std::string>;
+ using RefreshTokenToDeviceIdMap = std::map<std::string, std::string>;
// Access token details used for token minting and the token info endpoint.
struct AccessTokenInfo {
@@ -52,6 +53,9 @@ class FakeGaia {
MergeSessionParams();
~MergeSessionParams();
+ // Updates params with non-empty values from |params|.
+ void Update(const MergeSessionParams& params);
+
// Values of SID and LSID cookie that are set by /ServiceLoginAuth or its
// equivalent at the end of the SAML login flow.
std::string auth_sid_cookie;
@@ -86,6 +90,9 @@ class FakeGaia {
// Sets the initial value of tokens and cookies.
void SetMergeSessionParams(const MergeSessionParams& params);
+ // Updates various params with non-empty values from |params|.
+ void UpdateMergeSessionParams(const MergeSessionParams& params);
+
// Sets the specified |gaia_id| as corresponding to the given |email|
// address when setting GAIA response headers. If no mapping is given for
// an email address, a default GAIA Id is used.
@@ -122,6 +129,17 @@ class FakeGaia {
static bool GetQueryParameter(const std::string& query,
const std::string& key,
std::string* value);
+
+ // Returns a device ID associated with a given |refresh_token|.
+ std::string GetDeviceIdByRefreshToken(const std::string& refresh_token) const;
+
+ void SetRefreshTokenToDeviceIdMap(
+ const RefreshTokenToDeviceIdMap& refresh_token_to_device_id_map);
+
+ const RefreshTokenToDeviceIdMap& refresh_token_to_device_id_map() const {
+ return refresh_token_to_device_id_map_;
+ }
+
protected:
// HTTP handler for /MergeSession.
virtual void HandleMergeSession(
@@ -210,6 +228,7 @@ class FakeGaia {
std::string embedded_setup_chromeos_response_;
SamlAccountIdpMap saml_account_idp_map_;
bool issue_oauth_code_cookie_;
+ RefreshTokenToDeviceIdMap refresh_token_to_device_id_map_;
DISALLOW_COPY_AND_ASSIGN(FakeGaia);
};
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | google_apis/gaia/fake_gaia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698