Commit 5e2845f1 authored by Anastasiia N's avatar Anastasiia N Committed by Commit Bot

Use async HasDummyGaiaToken in account_manager_handler_browsertest

Bug: 1135980
Change-Id: I1bfe954ba61dfc6608210bcea7a293c32b58075d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2453290
Commit-Queue: Anastasiia N <anastasiian@chromium.org>
Reviewed-by: default avatarKush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817008}
parent 4627bc81
...@@ -212,6 +212,22 @@ class AccountManagerUIHandlerTest ...@@ -212,6 +212,22 @@ class AccountManagerUIHandlerTest
return accounts; return accounts;
} }
bool HasDummyGaiaToken(const AccountManager::AccountKey& account_key) {
bool has_dummy_token_result;
base::RunLoop run_loop;
account_manager_->HasDummyGaiaToken(
account_key,
base::BindLambdaForTesting(
[&has_dummy_token_result, &run_loop](bool has_dummy_token) {
has_dummy_token_result = has_dummy_token;
run_loop.Quit();
}));
run_loop.Run();
return has_dummy_token_result;
}
DeviceAccountInfo GetDeviceAccountInfo() const { return GetParam(); } DeviceAccountInfo GetDeviceAccountInfo() const { return GetParam(); }
content::TestWebUI* web_ui() { return &web_ui_; } content::TestWebUI* web_ui() { return &web_ui_; }
...@@ -336,7 +352,7 @@ IN_PROC_BROWSER_TEST_P(AccountManagerUIHandlerTest, ...@@ -336,7 +352,7 @@ IN_PROC_BROWSER_TEST_P(AccountManagerUIHandlerTest,
user_manager::UserType::USER_TYPE_CHILD) { user_manager::UserType::USER_TYPE_CHILD) {
EXPECT_FALSE(account.FindBoolKey("unmigrated").value()); EXPECT_FALSE(account.FindBoolKey("unmigrated").value());
} else { } else {
EXPECT_EQ(account_manager()->HasDummyGaiaTokenSync(expected_account.key), EXPECT_EQ(HasDummyGaiaToken(expected_account.key),
account.FindBoolKey("unmigrated").value()); account.FindBoolKey("unmigrated").value());
} }
EXPECT_EQ(expected_account.key.account_type, EXPECT_EQ(expected_account.key.account_type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment