| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "sql/connection.h" | 10 #include "sql/connection.h" |
| 11 #include "sql/meta_table.h" | 11 #include "sql/meta_table.h" |
| 12 #include "sql/statement.h" | 12 #include "sql/statement.h" |
| 13 #include "sql/transaction.h" | 13 #include "sql/transaction.h" |
| 14 #include "webkit/appcache/appcache_database.h" | 14 #include "webkit/appcache/appcache_database.h" |
| 15 #include "webkit/appcache/appcache_entry.h" | 15 #include "webkit/appcache/appcache_entry.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 const base::Time kZeroTime; | 19 const base::Time kZeroTime; |
| 20 | 20 |
| 21 class TestErrorDelegate : public sql::ErrorDelegate { | 21 class TestErrorDelegate : public sql::ErrorDelegate { |
| 22 public: | 22 public: |
| 23 virtual ~TestErrorDelegate() { } | 23 virtual int OnError(int error, |
| 24 virtual int OnError( | 24 sql::Connection* connection, |
| 25 int error, sql::Connection* connection, sql::Statement* stmt) { | 25 sql::Statement* stmt) OVERRIDE { |
| 26 return error; | 26 return error; |
| 27 } | 27 } |
| 28 |
| 29 private: |
| 30 virtual ~TestErrorDelegate() {} |
| 28 }; | 31 }; |
| 29 | 32 |
| 30 } // namespace | 33 } // namespace |
| 31 | 34 |
| 32 namespace appcache { | 35 namespace appcache { |
| 33 | 36 |
| 34 class AppCacheDatabaseTest {}; | 37 class AppCacheDatabaseTest {}; |
| 35 | 38 |
| 36 TEST(AppCacheDatabaseTest, LazyOpen) { | 39 TEST(AppCacheDatabaseTest, LazyOpen) { |
| 37 // Use an empty file path to use an in-memory sqlite database. | 40 // Use an empty file path to use an in-memory sqlite database. |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 | 831 |
| 829 EXPECT_EQ(i, fallbacks[i].cache_id); | 832 EXPECT_EQ(i, fallbacks[i].cache_id); |
| 830 EXPECT_EQ(FALLBACK_NAMESPACE, fallbacks[i].type); | 833 EXPECT_EQ(FALLBACK_NAMESPACE, fallbacks[i].type); |
| 831 EXPECT_EQ(kMockOrigin, fallbacks[i].origin); | 834 EXPECT_EQ(kMockOrigin, fallbacks[i].origin); |
| 832 EXPECT_EQ(expected_namespace_url, fallbacks[i].namespace_url); | 835 EXPECT_EQ(expected_namespace_url, fallbacks[i].namespace_url); |
| 833 EXPECT_EQ(expected_target_url, fallbacks[i].target_url); | 836 EXPECT_EQ(expected_target_url, fallbacks[i].target_url); |
| 834 } | 837 } |
| 835 } | 838 } |
| 836 | 839 |
| 837 } // namespace appcache | 840 } // namespace appcache |
| OLD | NEW |