Commit b92b009d authored by Jarryd's avatar Jarryd Committed by Commit Bot

AllSites: Fix flaky test.

Applies the fix suggested by dbertoni@ on the bug:

Adds a TearDown method which calls
StoragePartition::WaitForDeletionTasksForTesting() to wait for all
deletion tasks to finish and make sure QuotaDatabase does not
run into out of disk space errors.

Bug: 930481
Change-Id: I1d2203d0b6d817ef84ccbda206ab216e54f4fd80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2307644Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Commit-Queue: Jarryd Goodman <jarrydg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791486}
parent 86ee59bf
......@@ -54,6 +54,7 @@
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_web_ui.h"
......@@ -209,6 +210,15 @@ class SiteSettingsHandlerTest : public testing::Test {
web_ui()->ClearTrackedCalls();
}
void TearDown() override {
if (profile_) {
auto* partition =
content::BrowserContext::GetDefaultStoragePartition(profile_.get());
if (partition)
partition->WaitForDeletionTasksForTesting();
}
}
TestingProfile* profile() { return profile_.get(); }
TestingProfile* incognito_profile() { return incognito_profile_; }
web_app::TestAppRegistrar& app_registrar() { return app_registrar_; }
......@@ -548,12 +558,7 @@ TEST_F(SiteSettingsHandlerTest, GetAndSetDefault) {
}
// Flaky on CrOS and Linux. https://crbug.com/930481
#if defined(OS_CHROMEOS) || defined(OS_LINUX)
#define MAYBE_GetAllSites DISABLED_GetAllSites
#else
#define MAYBE_GetAllSites GetAllSites
#endif
TEST_F(SiteSettingsHandlerTest, MAYBE_GetAllSites) {
TEST_F(SiteSettingsHandlerTest, GetAllSites) {
base::ListValue get_all_sites_args;
get_all_sites_args.AppendString(kCallbackId);
base::Value category_list(base::Value::Type::LIST);
......
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