Commit 0909308a authored by Yue Li's avatar Yue Li Committed by Commit Bot

Replace 'sanity check' keyword in Assistant files

See go/inclusive-codebase.

Bug: b/161801556
Test: Local compile
Change-Id: I6f489e910c4050dab71b2d2bc30fdfb6679fb6bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316450
Auto-Submit: Yue Li <updowndota@chromium.org>
Reviewed-by: default avatarJeroen Dhollander <jeroendh@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791469}
parent 718f54dd
...@@ -174,7 +174,7 @@ class AssistantPageViewTest : public AssistantAshTestBase { ...@@ -174,7 +174,7 @@ class AssistantPageViewTest : public AssistantAshTestBase {
gfx::Point GetPointInAppListOutsideAssistantUi() { gfx::Point GetPointInAppListOutsideAssistantUi() {
gfx::Point result = GetPointOutside(page_view()); gfx::Point result = GetPointOutside(page_view());
// Sanity check // Validity check
EXPECT_TRUE(app_list_view()->bounds().Contains(result)); EXPECT_TRUE(app_list_view()->bounds().Contains(result));
EXPECT_FALSE(page_view()->bounds().Contains(result)); EXPECT_FALSE(page_view()->bounds().Contains(result));
...@@ -372,7 +372,7 @@ TEST_F(AssistantPageViewTest, FocusShouldRemainInAssistantViewWhenPressingTab) { ...@@ -372,7 +372,7 @@ TEST_F(AssistantPageViewTest, FocusShouldRemainInAssistantViewWhenPressingTab) {
<< "Focus advanced to view '" << focused_view->GetClassName() << "Focus advanced to view '" << focused_view->GetClassName()
<< "' which is not a part of the Assistant UI"; << "' which is not a part of the Assistant UI";
// Sanity check to ensure we do not loop forever // Validity check to ensure we do not loop forever
num_views++; num_views++;
ASSERT_LT(num_views, kMaxIterations); ASSERT_LT(num_views, kMaxIterations);
} while (focused_view != initial_focused_view); } while (focused_view != initial_focused_view);
...@@ -402,7 +402,7 @@ TEST_F(AssistantPageViewTest, ...@@ -402,7 +402,7 @@ TEST_F(AssistantPageViewTest,
int num_iterations = 0; int num_iterations = 0;
while (GetFocusedView() != onboarding_suggestions.at(0)) { while (GetFocusedView() != onboarding_suggestions.at(0)) {
PressKeyAndWait(ui::VKEY_TAB); PressKeyAndWait(ui::VKEY_TAB);
ASSERT_LE(++num_iterations, kMaxIterations); // Sanity check. ASSERT_LE(++num_iterations, kMaxIterations); // Validity check.
} }
// Verify we can cycle through them. // Verify we can cycle through them.
...@@ -415,7 +415,7 @@ TEST_F(AssistantPageViewTest, ...@@ -415,7 +415,7 @@ TEST_F(AssistantPageViewTest,
num_iterations = 0; num_iterations = 0;
while (GetFocusedView() != first_focused_view) { while (GetFocusedView() != first_focused_view) {
PressKeyAndWait(ui::VKEY_TAB); PressKeyAndWait(ui::VKEY_TAB);
ASSERT_LE(++num_iterations, kMaxIterations); // Sanity check. ASSERT_LE(++num_iterations, kMaxIterations); // Validity check.
} }
} }
......
...@@ -78,7 +78,7 @@ class ScopedLogIn { ...@@ -78,7 +78,7 @@ class ScopedLogIn {
identity_test_env_(identity_test_env), identity_test_env_(identity_test_env),
account_id_(account_id) { account_id_(account_id) {
PreventAccessToDBus(); PreventAccessToDBus();
RunSanityChecks(user_type); RunValidityChecks(user_type);
AddUser(user_type); AddUser(user_type);
fake_user_manager_->LoginUser(account_id_); fake_user_manager_->LoginUser(account_id_);
...@@ -109,9 +109,10 @@ class ScopedLogIn { ...@@ -109,9 +109,10 @@ class ScopedLogIn {
} }
} }
// Run sanity checks ensuring the account id is valid for the given user type. // Run validity checks ensuring the account id is valid for the given user
// If these checks go off your test is testing something that can not happen. // type. If these checks go off your test is testing something that can not
void RunSanityChecks(user_manager::UserType user_type) const { // happen.
void RunValidityChecks(user_manager::UserType user_type) const {
switch (user_type) { switch (user_type) {
case user_manager::USER_TYPE_REGULAR: case user_manager::USER_TYPE_REGULAR:
case user_manager::USER_TYPE_CHILD: case user_manager::USER_TYPE_CHILD:
......
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