// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_TEST_BROWSING_DATA_REMOVER_TEST_UTIL_H_ #define CONTENT_PUBLIC_TEST_BROWSING_DATA_REMOVER_TEST_UTIL_H_ #include <memory> #include "base/memory/raw_ptr.h" #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/task/sequenced_task_runner.h" #include "content/public/browser/browsing_data_remover.h" namespace content { // 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 { … }; // 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 { … }; } // namespace content #endif // CONTENT_PUBLIC_TEST_BROWSING_DATA_REMOVER_TEST_UTIL_H_