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

Unified Diff: webkit/appcache/appcache_database_unittest.cc

Issue 11111021: Remove ref counting on sql::ErrorDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested Created 8 years, 2 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 | « sql/statement_unittest.cc ('k') | webkit/database/databases_table_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_database_unittest.cc
diff --git a/webkit/appcache/appcache_database_unittest.cc b/webkit/appcache/appcache_database_unittest.cc
index 5ac85d50af09fc69456bec3d5631f29b9b90a179..3a9a5ad11b28e9b40a83960269422720d059d409 100644
--- a/webkit/appcache/appcache_database_unittest.cc
+++ b/webkit/appcache/appcache_database_unittest.cc
@@ -20,6 +20,9 @@ const base::Time kZeroTime;
class TestErrorDelegate : public sql::ErrorDelegate {
public:
+ TestErrorDelegate() {}
+ virtual ~TestErrorDelegate() {}
+
virtual int OnError(int error,
sql::Connection* connection,
sql::Statement* stmt) OVERRIDE {
@@ -27,7 +30,7 @@ class TestErrorDelegate : public sql::ErrorDelegate {
}
private:
- virtual ~TestErrorDelegate() {}
+ DISALLOW_COPY_AND_ASSIGN(TestErrorDelegate);
};
} // namespace
@@ -89,8 +92,7 @@ TEST(AppCacheDatabaseTest, EntryRecords) {
EXPECT_TRUE(db.LazyOpen(true));
// Set an error delegate that will make all operations return false on error.
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
AppCacheDatabase::EntryRecord entry;
@@ -163,8 +165,7 @@ TEST(AppCacheDatabaseTest, CacheRecords) {
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
const AppCacheDatabase::CacheRecord kZeroRecord;
AppCacheDatabase::CacheRecord record;
@@ -206,8 +207,7 @@ TEST(AppCacheDatabaseTest, GroupRecords) {
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
const GURL kManifestUrl("http://blah/manifest");
const GURL kOrigin(kManifestUrl.GetOrigin());
@@ -334,8 +334,7 @@ TEST(AppCacheDatabaseTest, NamespaceRecords) {
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
const GURL kFooNameSpace1("http://foo/namespace1");
const GURL kFooNameSpace2("http://foo/namespace2");
@@ -435,8 +434,7 @@ TEST(AppCacheDatabaseTest, OnlineWhiteListRecords) {
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
const GURL kFooNameSpace1("http://foo/namespace1");
const GURL kFooNameSpace2("http://foo/namespace2");
@@ -482,8 +480,7 @@ TEST(AppCacheDatabaseTest, DeletableResponseIds) {
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
std::vector<int64> ids;
@@ -559,8 +556,7 @@ TEST(AppCacheDatabaseTest, OriginUsage) {
AppCacheDatabase db(kEmptyPath);
EXPECT_TRUE(db.LazyOpen(true));
- scoped_refptr<TestErrorDelegate> error_delegate(new TestErrorDelegate);
- db.db_->set_error_delegate(error_delegate);
+ db.db_->set_error_delegate(new TestErrorDelegate());
std::vector<AppCacheDatabase::CacheRecord> cache_records;
EXPECT_EQ(0, db.GetOriginUsage(kOrigin));
« no previous file with comments | « sql/statement_unittest.cc ('k') | webkit/database/databases_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698