Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: chrome/browser/ui/webui/profile_helper_browsertest.cc

Issue 2802013002: Move BrowsingDataRemoverImpl:: CompletionInhibitor to the public interface (Closed)
Patch Set: Finishing after shutdown is still OK. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/clear_browser_data_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/profile_helper_browsertest.cc
diff --git a/chrome/browser/ui/webui/profile_helper_browsertest.cc b/chrome/browser/ui/webui/profile_helper_browsertest.cc
index 5b0900659641d520aeb234892f9e50bca3f46e14..ae889fcfe9382ad85bccee2d9255a447851a6871 100644
--- a/chrome/browser/ui/webui/profile_helper_browsertest.cc
+++ b/chrome/browser/ui/webui/profile_helper_browsertest.cc
@@ -6,7 +6,9 @@
#include "base/run_loop.h"
#include "base/scoped_observer.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/browsing_data/browsing_data_remover_impl.h"
+#include "chrome/browser/browsing_data/browsing_data_remover.h"
+#include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
+#include "chrome/browser/browsing_data/browsing_data_remover_test_util.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -66,29 +68,6 @@ class ExpectBrowserActivationForProfile : public chrome::BrowserListObserver {
ScopedObserver<BrowserList, chrome::BrowserListObserver> scoped_observer_;
};
-// TODO(bug 704601): remove it when bug is fixed.
-class BrowsingDataRemoverObserver
- : public BrowsingDataRemoverImpl::CompletionInhibitor {
- public:
- explicit BrowsingDataRemoverObserver(const base::Closure& callback)
- : callback_(callback) {
- BrowsingDataRemoverImpl::set_completion_inhibitor_for_testing(this);
- }
- ~BrowsingDataRemoverObserver() override {
- BrowsingDataRemoverImpl::set_completion_inhibitor_for_testing(nullptr);
- }
-
- private:
- void OnBrowsingDataRemoverWouldComplete(
- BrowsingDataRemoverImpl* remover,
- const base::Closure& continue_to_completion) override {
- continue_to_completion.Run();
- callback_.Run();
- }
-
- const base::Closure callback_;
-};
-
} // namespace
using ProfileHelperTest = InProcessBrowserTest;
@@ -205,11 +184,12 @@ IN_PROC_BROWSER_TEST_F(ProfileHelperTest, DeleteInactiveProfile) {
Profile* additional_profile = CreateProfile();
EXPECT_EQ(2u, storage.GetNumberOfProfiles());
- base::RunLoop loop;
- BrowsingDataRemoverObserver observer(loop.QuitClosure());
+ BrowsingDataRemoverCompletionInhibitor inhibitor(
+ BrowsingDataRemoverFactory::GetForBrowserContext(additional_profile));
webui::DeleteProfileAtPath(additional_profile->GetPath(), &web_ui,
ProfileMetrics::DELETE_PROFILE_SETTINGS);
- loop.Run();
+ inhibitor.BlockUntilNearCompletion();
+ inhibitor.ContinueToCompletion();
EXPECT_EQ(1u, browser_list->size());
EXPECT_TRUE(base::ContainsValue(*browser_list, original_browser));
« no previous file with comments | « chrome/browser/ui/webui/options/clear_browser_data_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698