Commit 894c9467 authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

[PM] Fix some flaky tests on Android

These tests seem to be failing because they're expecting some exact values for some timestamps, which doesn't work with the recent changes to the mock time fixtures.

Bug: 1014181
Change-Id: I47223003524314cd145fc6bfa477386c7e4fc84a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862716
Auto-Submit: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706071}
parent 2da5c725
......@@ -187,11 +187,9 @@ TEST_F(SiteDataCacheImplTest, ClearSiteDataForOrigins) {
data_cache_->ClearSiteDataForOrigins(origins_to_remove);
::testing::Mock::VerifyAndClear(mock_db_);
// The information for the first site should have been cleared. The last
// loaded time should be equal to the current time.
EXPECT_EQ(
data_->last_loaded_time_for_testing().InSeconds(),
(base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InSeconds());
// The information for the first site should have been cleared.
EXPECT_GE((base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InSeconds(),
data_->last_loaded_time_for_testing().InSeconds());
EXPECT_EQ(performance_manager::SiteFeatureUsage::kSiteFeatureUsageUnknown,
reader_->UpdatesTitleInBackground());
// The second site shouldn't have been cleared.
......@@ -213,14 +211,12 @@ TEST_F(SiteDataCacheImplTest, ClearAllSiteData) {
::testing::Mock::VerifyAndClear(mock_db_);
// The information for both sites should have been cleared.
EXPECT_EQ(
data_->last_loaded_time_for_testing().InSeconds(),
(base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InSeconds());
EXPECT_GE((base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InSeconds(),
data_->last_loaded_time_for_testing().InSeconds());
EXPECT_EQ(performance_manager::SiteFeatureUsage::kSiteFeatureUsageUnknown,
reader_->UpdatesTitleInBackground());
EXPECT_EQ(
data2_->last_loaded_time_for_testing().InSeconds(),
(base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InSeconds());
EXPECT_GE((base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InSeconds(),
data2_->last_loaded_time_for_testing().InSeconds());
EXPECT_EQ(performance_manager::SiteFeatureUsage::kSiteFeatureUsageUnknown,
reader2_->UpdatesFaviconInBackground());
......
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