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

Unified Diff: chrome/browser/devtools/device/webrtc/devtools_bridge_client_browsertest.cc

Issue 964563002: Replace SetAuthenticatedUsername with SetAuthenticatedAccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@priv
Patch Set: rebased Created 5 years, 8 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
Index: chrome/browser/devtools/device/webrtc/devtools_bridge_client_browsertest.cc
diff --git a/chrome/browser/devtools/device/webrtc/devtools_bridge_client_browsertest.cc b/chrome/browser/devtools/device/webrtc/devtools_bridge_client_browsertest.cc
index f0cbfd2b8a68ac7167a10bf3997c58e1de286d6f..9791ecd54a963438dd96393ce9f8f0e88e740a12 100644
--- a/chrome/browser/devtools/device/webrtc/devtools_bridge_client_browsertest.cc
+++ b/chrome/browser/devtools/device/webrtc/devtools_bridge_client_browsertest.cc
@@ -6,11 +6,20 @@
#include "chrome/browser/devtools/device/webrtc/devtools_bridge_client.h"
#include "chrome/browser/local_discovery/gcd_api_flow.h"
+#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
#include "chrome/browser/signin/fake_signin_manager.h"
#include "chrome/browser/ui/browser.h"
+#include "components/signin/core/browser/account_tracker_service.h"
#include "content/public/browser/web_ui_message_handler.h"
+namespace {
+
+const char kGaiaId[] = "stub-user@example.com";
+const char kUsername[] = "stub-user@example.com";
+
+} // namespace
+
class DevToolsBridgeClientBrowserTest::GCDApiFlowMock
: public local_discovery::GCDApiFlow {
public:
@@ -79,10 +88,14 @@ class DevToolsBridgeClientBrowserTest::DevToolsBridgeClientMock
void GoogleSigninSucceeded() {
// This username is checked on Chrome OS.
- const std::string username = "stub-user@example.com";
- test_->fake_signin_manager_->SetAuthenticatedUsername(username);
- identity_provider().GoogleSigninSucceeded("test_account", username,
- "testing");
+ const std::string account_id =
+ AccountTrackerServiceFactory::GetForProfile(
+ test_->browser()->profile())
+ ->PickAccountIdForAccount(kGaiaId, kUsername);
+ test_->fake_signin_manager_->SetAuthenticatedAccountInfo(kGaiaId,
+ kUsername);
+ identity_provider().GoogleSigninSucceeded(account_id, kUsername,
+ "password");
}
private:
@@ -109,8 +122,11 @@ class DevToolsBridgeClientBrowserTest::MessageHandler
void SignIn(const base::ListValue*) {
if (test_->client_mock_.get())
test_->client_mock_->GoogleSigninSucceeded();
- test_->fake_token_service_->UpdateCredentials("test_user@gmail.com",
- "token");
+ const std::string account_id =
+ AccountTrackerServiceFactory::GetForProfile(
+ test_->browser()->profile())->PickAccountIdForAccount(kGaiaId,
+ kUsername);
+ test_->fake_token_service_->UpdateCredentials(account_id, "token");
}
void GCDApiResponse(const base::ListValue* params) {

Powered by Google App Engine
This is Rietveld 408576698