Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / google_apis / gaia / fake_gaia.h
index 4db3b84..e00a80a 100644 (file)
@@ -86,6 +86,11 @@ class FakeGaia {
   // Sets the initial value of tokens and cookies.
   void SetMergeSessionParams(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.
+  void MapEmailToGaiaId(const std::string& email, const std::string& gaia_id);
+
   // Initializes HTTP request handlers. Should be called after switches
   // for tweaking GaiaUrls are in place.
   void Initialize();
@@ -121,8 +126,15 @@ class FakeGaia {
 
  private:
   typedef std::multimap<std::string, AccessTokenInfo> AccessTokenInfoMap;
+  typedef std::map<std::string, std::string> EmailToGaiaIdMap;
   typedef std::map<std::string, GURL> SamlAccountIdpMap;
 
+  std::string GetGaiaIdOfEmail(const std::string& email) const;
+
+  void AddGoogleAccountsSigninHeader(
+      net::test_server::BasicHttpResponse* http_response,
+      const std::string& email) const;
+
   // Formats a JSON response with the data in |response_dict|.
   void FormatJSONResponse(const base::DictionaryValue& response_dict,
                           net::test_server::BasicHttpResponse* http_response);
@@ -169,6 +181,7 @@ class FakeGaia {
       const;
 
   MergeSessionParams merge_session_params_;
+  EmailToGaiaIdMap email_to_gaia_id_map_;
   AccessTokenInfoMap access_token_info_map_;
   RequestHandlerMap request_handlers_;
   std::string service_login_response_;