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

Unified Diff: webkit/tools/test_shell/simple_database_system.h

Issue 203074: Refactor the DB code to make all DB layout tests pass on test_shell.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
Index: webkit/tools/test_shell/simple_database_system.h
===================================================================
--- webkit/tools/test_shell/simple_database_system.h (revision 0)
+++ webkit/tools/test_shell/simple_database_system.h (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2009 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 WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_
+#define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_
+
+#include "base/file_path.h"
+#include "base/platform_file.h"
+#include "base/scoped_temp_dir.h"
+
+class SimpleDatabaseSystem {
+ public:
+ static SimpleDatabaseSystem* GetInstance();
+ SimpleDatabaseSystem();
+ ~SimpleDatabaseSystem();
+
+ base::PlatformFile OpenFile(
+ const FilePath& file_name, int desired_flags,
+ base::PlatformFile* dir_handle);
+ int DeleteFile(const FilePath& file_name, bool sync_dir);
+ long GetFileAttributes(const FilePath& file_name);
+ long long GetFileSize(const FilePath& file_name);
+ void ClearAllDatabases();
+
+ private:
+ FilePath GetDBDir();
+ FilePath GetDBFileFullPath(const FilePath& file_name);
+
+ static SimpleDatabaseSystem* instance_;
+
+ ScopedTempDir temp_dir_;
+
+ // HACK: see OpenFile's implementation
+ base::PlatformFile hack_main_db_handle_;
+};
+
+#endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_
« no previous file with comments | « webkit/tools/test_shell/layout_test_controller.cc ('k') | webkit/tools/test_shell/simple_database_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698