| 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) {
|
|
|