Commit 1e1fca23 authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

Fix flaky PromoServiceTests

Move the GoogleURLTracker shutdown from the test destructor
to TearDown(). This ensures it gets shutdown before
the checks in ~TestBrowserThreadBundle() run.

Bug: 937041
Change-Id: I6f43cc369f2e482de02771173d1bf2ae7237f70d
Reviewed-on: https://chromium-review.googlesource.com/c/1497220Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636969}
parent 5acb26ce
...@@ -57,10 +57,6 @@ class PromoServiceTest : public testing::Test { ...@@ -57,10 +57,6 @@ class PromoServiceTest : public testing::Test {
GoogleURLTracker::ALWAYS_DOT_COM_MODE, GoogleURLTracker::ALWAYS_DOT_COM_MODE,
network::TestNetworkConnectionTracker::GetInstance()) {} network::TestNetworkConnectionTracker::GetInstance()) {}
~PromoServiceTest() override {
static_cast<KeyedService&>(google_url_tracker_).Shutdown();
}
void SetUp() override { void SetUp() override {
testing::Test::SetUp(); testing::Test::SetUp();
...@@ -68,6 +64,10 @@ class PromoServiceTest : public testing::Test { ...@@ -68,6 +64,10 @@ class PromoServiceTest : public testing::Test {
&google_url_tracker_); &google_url_tracker_);
} }
void TearDown() override {
static_cast<KeyedService&>(google_url_tracker_).Shutdown();
}
void SetUpResponseWithData(const GURL& load_url, void SetUpResponseWithData(const GURL& load_url,
const std::string& response) { const std::string& response) {
test_url_loader_factory_.SetInterceptor(base::BindLambdaForTesting( test_url_loader_factory_.SetInterceptor(base::BindLambdaForTesting(
...@@ -100,8 +100,7 @@ class PromoServiceTest : public testing::Test { ...@@ -100,8 +100,7 @@ class PromoServiceTest : public testing::Test {
std::unique_ptr<PromoService> service_; std::unique_ptr<PromoService> service_;
}; };
// Flaky on linux-chromeos-rel and win. See https://crbug.com/937041. TEST_F(PromoServiceTest, PromoDataNetworkError) {
TEST_F(PromoServiceTest, DISABLED_PromoDataNetworkError) {
SetUpResponseWithNetworkError(service()->GetLoadURLForTesting()); SetUpResponseWithNetworkError(service()->GetLoadURLForTesting());
ASSERT_EQ(service()->promo_data(), base::nullopt); ASSERT_EQ(service()->promo_data(), base::nullopt);
......
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