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

Unified Diff: components/history/core/test/database_test_utils.cc

Issue 870063002: Componentize TopSites, TopSitesBackend, TopSitesDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@815983002
Patch Set: Fix typo Created 5 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/database_test_utils.h ('k') | components/history/core/test/thumbnail-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/test/database_test_utils.cc
diff --git a/components/history/core/test/database_test_utils.cc b/components/history/core/test/database_test_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cdb4556070be341825a55bb4fedbe5142d13a333
--- /dev/null
+++ b/components/history/core/test/database_test_utils.cc
@@ -0,0 +1,35 @@
+// Copyright 2015 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.
+
+#include "components/history/core/test/database_test_utils.h"
+
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "sql/test/test_helpers.h"
+
+namespace history {
+
+namespace {
+
+WARN_UNUSED_RESULT bool GetTestDataHistoryDir(base::FilePath* dir) {
+ if (!PathService::Get(base::DIR_SOURCE_ROOT, dir))
+ return false;
+ *dir = dir->AppendASCII("components");
+ *dir = dir->AppendASCII("test");
+ *dir = dir->AppendASCII("data");
+ *dir = dir->AppendASCII("history");
+ return true;
+}
+
+} // namespace
+
+WARN_UNUSED_RESULT bool CreateDatabaseFromSQL(const base::FilePath& db_path,
+ const char* ascii_path) {
+ base::FilePath dir;
+ if (!GetTestDataHistoryDir(&dir))
+ return false;
+ return sql::test::CreateDatabaseFromSQL(db_path, dir.AppendASCII(ascii_path));
+}
+
+} // namespace history
« no previous file with comments | « components/history/core/test/database_test_utils.h ('k') | components/history/core/test/thumbnail-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698