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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover_test_util.h

Issue 2827523003: Move BrowsingDataRemover to content/ (Closed)
Patch Set: Rebase over codereview.chromium.org/2815913005 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
Index: chrome/browser/browsing_data/browsing_data_remover_test_util.h
diff --git a/chrome/browser/browsing_data/browsing_data_remover_test_util.h b/chrome/browser/browsing_data/browsing_data_remover_test_util.h
deleted file mode 100644
index bb0847c3670a86a84d24ba2e0762233092514a12..0000000000000000000000000000000000000000
--- a/chrome/browser/browsing_data/browsing_data_remover_test_util.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
-#define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/scoped_observer.h"
-#include "chrome/browser/browsing_data/browsing_data_remover.h"
-#include "content/public/test/test_utils.h"
-
-// This class can be used to wait for a BrowsingDataRemover to complete
-// operation. It is not suitable for repeated use.
-class BrowsingDataRemoverCompletionObserver
- : public BrowsingDataRemover::Observer {
- public:
- explicit BrowsingDataRemoverCompletionObserver(BrowsingDataRemover* remover);
- ~BrowsingDataRemoverCompletionObserver() override;
-
- void BlockUntilCompletion();
-
- protected:
- // BrowsingDataRemover::Observer:
- void OnBrowsingDataRemoverDone() override;
-
- private:
- scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
- ScopedObserver<BrowsingDataRemover, BrowsingDataRemover::Observer> observer_;
-
- DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionObserver);
-};
-
-// The completion inhibitor can artificially delay completion of the browsing
-// data removal process. It is used during testing to simulate scenarios in
-// which the deletion stalls or takes a very long time.
-//
-// This class will detach itself from |remover| upon its destruction.
-// If |remover| is destroyed during a test (e.g. in profile shutdown tests),
-// users must call Reset() to detach it in advance.
-class BrowsingDataRemoverCompletionInhibitor {
- public:
- explicit BrowsingDataRemoverCompletionInhibitor(BrowsingDataRemover* remover);
- virtual ~BrowsingDataRemoverCompletionInhibitor();
-
- void Reset();
-
- void BlockUntilNearCompletion();
- void ContinueToCompletion();
-
- protected:
- virtual void OnBrowsingDataRemoverWouldComplete(
- const base::Closure& continue_to_completion);
-
- private:
- // Not owned by this class. If the pointer becomes invalid, the owner of
- // this class is responsible for calling Reset().
- BrowsingDataRemover* remover_;
-
- scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
- base::Closure continue_to_completion_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionInhibitor);
-};
-
-#endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698