Commit 2f142308 authored by Anastasiia Nikolaienko's avatar Anastasiia Nikolaienko Committed by Commit Bot

Fix OSSettingsPeoplePageAccountManagerTest

Fix flakiness of OSSettingsPeoplePageAccountManagerTest.AllJsTests. In
some tests we override isChild property in JS from false to true, but
in C++ we set accountManagerPrimaryAccountChildManagedTooltip string
only if is it was initially true. Fix this by adding string to
loadTimeData for all users (is user is not child - it's going to be
empty).

Fixed: 1087207
Change-Id: I20ae9f89bfe6646e74073632f8eafa02950f514d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2224262
Commit-Queue: Anastasiia N <anastasiian@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775085}
parent afd463b9
...@@ -587,6 +587,7 @@ void AddParentalControlStrings(content::WebUIDataSource* html_source, ...@@ -587,6 +587,7 @@ void AddParentalControlStrings(content::WebUIDataSource* html_source,
bool is_child = user_manager::UserManager::Get()->IsLoggedInAsChildUser(); bool is_child = user_manager::UserManager::Get()->IsLoggedInAsChildUser();
html_source->AddBoolean("isChild", is_child); html_source->AddBoolean("isChild", is_child);
base::string16 tooltip;
if (is_child) { if (is_child) {
std::string custodian = supervised_user_service->GetCustodianName(); std::string custodian = supervised_user_service->GetCustodianName();
std::string second_custodian = std::string second_custodian =
...@@ -602,9 +603,10 @@ void AddParentalControlStrings(content::WebUIDataSource* html_source, ...@@ -602,9 +603,10 @@ void AddParentalControlStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_ACCOUNT_MANAGER_CHILD_MANAGED_BY_TWO_PARENTS_TOOLTIP, IDS_SETTINGS_ACCOUNT_MANAGER_CHILD_MANAGED_BY_TWO_PARENTS_TOOLTIP,
base::UTF8ToUTF16(custodian), base::UTF8ToUTF16(second_custodian)); base::UTF8ToUTF16(custodian), base::UTF8ToUTF16(second_custodian));
} }
html_source->AddString("accountManagerPrimaryAccountChildManagedTooltip", tooltip = child_managed_tooltip;
child_managed_tooltip);
} }
html_source->AddString("accountManagerPrimaryAccountChildManagedTooltip",
tooltip);
} }
} // namespace } // namespace
......
...@@ -954,7 +954,7 @@ var OSSettingsPeoplePageAccountManagerTest = ...@@ -954,7 +954,7 @@ var OSSettingsPeoplePageAccountManagerTest =
} }
}; };
TEST_F('OSSettingsPeoplePageAccountManagerTest', 'DISABLED_AllJsTests', () => { TEST_F('OSSettingsPeoplePageAccountManagerTest', 'AllJsTests', () => {
mocha.run(); mocha.run();
}); });
......
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