OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <iterator> | 6 #include <iterator> |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 #include "sql/connection.h" | 14 #include "sql/connection.h" |
15 #include "sql/meta_table.h" | 15 #include "sql/meta_table.h" |
16 #include "sql/statement.h" | 16 #include "sql/statement.h" |
17 #include "sql/transaction.h" | 17 #include "sql/transaction.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "webkit/quota/mock_special_storage_policy.h" | 19 #include "webkit/quota/mock_special_storage_policy.h" |
20 #include "webkit/quota/quota_database.h" | 20 #include "webkit/quota/quota_database.h" |
21 | 21 |
22 namespace quota { | 22 namespace quota { |
23 namespace { | 23 namespace { |
24 | 24 |
25 const base::Time kZeroTime; | 25 const base::Time kZeroTime; |
26 | 26 |
27 class TestErrorDelegate : public sql::ErrorDelegate { | 27 class TestErrorDelegate : public sql::ErrorDelegate { |
28 public: | 28 public: |
29 virtual ~TestErrorDelegate() { } | 29 virtual int OnError(int error, |
30 virtual int OnError( | 30 sql::Connection* connection, |
31 int error, sql::Connection* connection, sql::Statement* stmt) { | 31 sql::Statement* stmt) OVERRIDE { |
32 return error; | 32 return error; |
33 } | 33 } |
| 34 |
| 35 protected: |
| 36 virtual ~TestErrorDelegate() {} |
34 }; | 37 }; |
35 | 38 |
36 } // namespace | 39 } // namespace |
37 | 40 |
38 class QuotaDatabaseTest : public testing::Test { | 41 class QuotaDatabaseTest : public testing::Test { |
39 protected: | 42 protected: |
40 typedef QuotaDatabase::QuotaTableEntry QuotaTableEntry; | 43 typedef QuotaDatabase::QuotaTableEntry QuotaTableEntry; |
41 typedef QuotaDatabase::QuotaTableCallback QuotaTableCallback; | 44 typedef QuotaDatabase::QuotaTableCallback QuotaTableCallback; |
42 typedef QuotaDatabase::OriginInfoTableCallback | 45 typedef QuotaDatabase::OriginInfoTableCallback |
43 OriginInfoTableCallback; | 46 OriginInfoTableCallback; |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 } | 560 } |
558 | 561 |
559 TEST_F(QuotaDatabaseTest, DumpOriginInfoTable) { | 562 TEST_F(QuotaDatabaseTest, DumpOriginInfoTable) { |
560 ScopedTempDir data_dir; | 563 ScopedTempDir data_dir; |
561 ASSERT_TRUE(data_dir.CreateUniqueTempDir()); | 564 ASSERT_TRUE(data_dir.CreateUniqueTempDir()); |
562 const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db"); | 565 const FilePath kDbFile = data_dir.path().AppendASCII("quota_manager.db"); |
563 DumpOriginInfoTable(kDbFile); | 566 DumpOriginInfoTable(kDbFile); |
564 DumpOriginInfoTable(FilePath()); | 567 DumpOriginInfoTable(FilePath()); |
565 } | 568 } |
566 } // namespace quota | 569 } // namespace quota |
OLD | NEW |