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

Unified Diff: components/history/core/test/history_service_test_util.h

Issue 1646893003: Moves shared history test helpers into util classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@history
Patch Set: ASAN. Created 4 years, 11 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 | « components/history/core/test/BUILD.gn ('k') | components/history/core/test/history_service_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/test/history_service_test_util.h
diff --git a/components/history/core/test/history_service_test_util.h b/components/history/core/test/history_service_test_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0a4a282b9a2c74e7287941cb56b96611233b664
--- /dev/null
+++ b/components/history/core/test/history_service_test_util.h
@@ -0,0 +1,38 @@
+// Copyright 2016 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 COMPONENTS_HISTORY_CORE_TEST_HISTORY_SERVICE_TEST_UTIL_H_
+#define COMPONENTS_HISTORY_CORE_TEST_HISTORY_SERVICE_TEST_UTIL_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace history {
+class HistoryService;
+
+// Creates a new HistoryService that stores its data in |history_dir|. If
+// |create_db| is false, the HistoryService will fail to initialize its
+// database; this is useful for testing error conditions. This method spins the
+// runloop before returning to ensure that any initialization-related tasks are
+// run.
+scoped_ptr<HistoryService> CreateHistoryService(
+ const base::FilePath& history_dir,
+ const std::string& accept_languages,
+ bool create_db);
+
+// Schedules a task on the history backend and runs a nested loop until the task
+// is processed. This blocks the caller until the history service processes all
+// pending requests.
+void BlockUntilHistoryProcessesPendingRequests(
+ HistoryService* history_service);
+
+} // namespace history
+
+#endif // COMPONENTS_HISTORY_CORE_TEST_HISTORY_SERVICE_TEST_UTIL_H_
« no previous file with comments | « components/history/core/test/BUILD.gn ('k') | components/history/core/test/history_service_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698