Commit 75be556f authored by mukai's avatar mukai Committed by Commit bot

Fixes tray_session_length_limit_unittest timeout on valgrind.

According to test runs on my machine, the test looks like suspended
after the test body finished, which seems to be waiting for
remaining timer tests. ClearSessionLengthLimit() should be called
at the end.

This also has cosmetic changes like NULL -> nullptr

BUG=454601
R=stevenjb@chromium.org
TEST=build with build_for_tool=memcheck, run ash_unittests with
  valgrind, and confirmed the test finishes in realistic time

Review URL: https://codereview.chromium.org/895863002

Cr-Commit-Position: refs/heads/master@{#314386}
parent f29a4397
......@@ -30,7 +30,10 @@ class TraySessionLengthLimitTest : public AshTestBase {
system_tray->AddTrayItem(tray_session_length_limit_);
}
void TearDown() override { AshTestBase::TearDown(); }
void TearDown() override {
ClearSessionLengthLimit();
AshTestBase::TearDown();
}
protected:
void UpdateSessionLengthLimitInMin(int mins) {
......@@ -47,7 +50,7 @@ class TraySessionLengthLimitTest : public AshTestBase {
if ((*iter)->id() == TraySessionLengthLimit::kNotificationId)
return *iter;
}
return NULL;
return nullptr;
}
void ClearSessionLengthLimit() {
......@@ -120,8 +123,6 @@ TEST_F(TraySessionLengthLimitTest, Notification) {
}
TEST_F(TraySessionLengthLimitTest, RemoveNotification) {
message_center::Notification* notification;
// Limit is 15 min.
UpdateSessionLengthLimitInMin(15);
EXPECT_TRUE(GetNotification());
......@@ -137,7 +138,7 @@ TEST_F(TraySessionLengthLimitTest, RemoveNotification) {
// Limit is 3 min. The notification should re-appear and should be re-read
// because of state change.
UpdateSessionLengthLimitInMin(3);
notification = GetNotification();
message_center::Notification* notification = GetNotification();
EXPECT_TRUE(notification);
EXPECT_TRUE(notification->rich_notification_data().
should_make_spoken_feedback_for_popup_updates);
......
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