1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/browsing_data/browsing_data_remover.h"
11 #include "content/public/test/test_utils.h"
13 class BrowsingDataRemoverCompletionObserver
14 : public BrowsingDataRemover::Observer
{
16 explicit BrowsingDataRemoverCompletionObserver(BrowsingDataRemover
* remover
);
17 ~BrowsingDataRemoverCompletionObserver() override
;
19 void BlockUntilCompletion();
22 // BrowsingDataRemover::Observer:
23 void OnBrowsingDataRemoverDone() override
;
26 scoped_refptr
<content::MessageLoopRunner
> message_loop_runner_
;
28 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionObserver
);
31 class BrowsingDataRemoverCompletionInhibitor
32 : public BrowsingDataRemover::CompletionInhibitor
{
34 BrowsingDataRemoverCompletionInhibitor();
35 ~BrowsingDataRemoverCompletionInhibitor() override
;
37 void BlockUntilNearCompletion();
38 void ContinueToCompletion();
41 // BrowsingDataRemover::CompletionInhibitor:
42 void OnBrowsingDataRemoverWouldComplete(
43 BrowsingDataRemover
* remover
,
44 const base::Closure
& continue_to_completion
) override
;
47 scoped_refptr
<content::MessageLoopRunner
> message_loop_runner_
;
48 base::Closure continue_to_completion_callback_
;
50 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionInhibitor
);
53 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_TEST_UTIL_H_