EME test page application.
[chromium-blink-merge.git] / chrome / browser / browsing_data / browsing_data_remover_test_util.h
blob476b21aa95bb49b8684d83569701c9b5f35ae536
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 {
15 public:
16 explicit BrowsingDataRemoverCompletionObserver(BrowsingDataRemover* remover);
17 virtual ~BrowsingDataRemoverCompletionObserver();
19 void BlockUntilCompletion();
21 protected:
22 // BrowsingDataRemover::Observer:
23 virtual void OnBrowsingDataRemoverDone() OVERRIDE;
25 private:
26 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
28 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverCompletionObserver);
31 class BrowsingDataRemoverCompletionInhibitor
32 : public BrowsingDataRemover::CompletionInhibitor {
33 public:
34 BrowsingDataRemoverCompletionInhibitor();
35 virtual ~BrowsingDataRemoverCompletionInhibitor();
37 void BlockUntilNearCompletion();
38 void ContinueToCompletion();
40 protected:
41 // BrowsingDataRemover::CompletionInhibitor:
42 virtual void OnBrowsingDataRemoverWouldComplete(
43 BrowsingDataRemover* remover,
44 const base::Closure& continue_to_completion) OVERRIDE;
46 private:
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_