| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "content/browser/appcache/appcache_database.h" | 9 #include "content/browser/appcache/appcache_database.h" |
| 10 #include "content/browser/appcache/appcache_entry.h" | 10 #include "content/browser/appcache/appcache_entry.h" |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 kOnlineWhiteListsTable, | 860 kOnlineWhiteListsTable, |
| 861 "(cache_id)", | 861 "(cache_id)", |
| 862 false }, | 862 false }, |
| 863 | 863 |
| 864 { "DeletableResponsesIdIndex", | 864 { "DeletableResponsesIdIndex", |
| 865 kDeletableResponseIdsTable, | 865 kDeletableResponseIdsTable, |
| 866 "(response_id)", | 866 "(response_id)", |
| 867 true }, | 867 true }, |
| 868 }; | 868 }; |
| 869 | 869 |
| 870 const int kTableCount3 = ARRAYSIZE_UNSAFE(kTables3); | 870 const int kTableCount3 = arraysize(kTables3); |
| 871 const int kIndexCount3 = ARRAYSIZE_UNSAFE(kIndexes3); | 871 const int kIndexCount3 = arraysize(kIndexes3); |
| 872 | 872 |
| 873 sql::Connection connection; | 873 sql::Connection connection; |
| 874 EXPECT_TRUE(connection.Open(kDbFile)); | 874 EXPECT_TRUE(connection.Open(kDbFile)); |
| 875 | 875 |
| 876 sql::Transaction transaction(&connection); | 876 sql::Transaction transaction(&connection); |
| 877 EXPECT_TRUE(transaction.Begin()); | 877 EXPECT_TRUE(transaction.Begin()); |
| 878 | 878 |
| 879 sql::MetaTable meta_table; | 879 sql::MetaTable meta_table; |
| 880 EXPECT_TRUE(meta_table.Init(&connection, kVersion3, kVersion3)); | 880 EXPECT_TRUE(meta_table.Init(&connection, kVersion3, kVersion3)); |
| 881 | 881 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 kOnlineWhiteListsTable, | 1090 kOnlineWhiteListsTable, |
| 1091 "(cache_id)", | 1091 "(cache_id)", |
| 1092 false }, | 1092 false }, |
| 1093 | 1093 |
| 1094 { "DeletableResponsesIdIndex", | 1094 { "DeletableResponsesIdIndex", |
| 1095 kDeletableResponseIdsTable, | 1095 kDeletableResponseIdsTable, |
| 1096 "(response_id)", | 1096 "(response_id)", |
| 1097 true }, | 1097 true }, |
| 1098 }; | 1098 }; |
| 1099 | 1099 |
| 1100 const int kTableCount4 = ARRAYSIZE_UNSAFE(kTables4); | 1100 const int kTableCount4 = arraysize(kTables4); |
| 1101 const int kIndexCount4 = ARRAYSIZE_UNSAFE(kIndexes4); | 1101 const int kIndexCount4 = arraysize(kIndexes4); |
| 1102 | 1102 |
| 1103 sql::Connection connection; | 1103 sql::Connection connection; |
| 1104 EXPECT_TRUE(connection.Open(kDbFile)); | 1104 EXPECT_TRUE(connection.Open(kDbFile)); |
| 1105 | 1105 |
| 1106 sql::Transaction transaction(&connection); | 1106 sql::Transaction transaction(&connection); |
| 1107 EXPECT_TRUE(transaction.Begin()); | 1107 EXPECT_TRUE(transaction.Begin()); |
| 1108 | 1108 |
| 1109 sql::MetaTable meta_table; | 1109 sql::MetaTable meta_table; |
| 1110 EXPECT_TRUE(meta_table.Init(&connection, kVersion4, kVersion4)); | 1110 EXPECT_TRUE(meta_table.Init(&connection, kVersion4, kVersion4)); |
| 1111 | 1111 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 EXPECT_EQ(expected_namespace_url, fallbacks[i].namespace_.namespace_url); | 1201 EXPECT_EQ(expected_namespace_url, fallbacks[i].namespace_.namespace_url); |
| 1202 EXPECT_EQ(expected_target_url, fallbacks[i].namespace_.target_url); | 1202 EXPECT_EQ(expected_target_url, fallbacks[i].namespace_.target_url); |
| 1203 EXPECT_FALSE(fallbacks[i].namespace_.is_pattern); | 1203 EXPECT_FALSE(fallbacks[i].namespace_.is_pattern); |
| 1204 EXPECT_EQ(expected_whitelist_url, whitelists[i].namespace_url); | 1204 EXPECT_EQ(expected_whitelist_url, whitelists[i].namespace_url); |
| 1205 EXPECT_FALSE(whitelists[i].is_pattern); | 1205 EXPECT_FALSE(whitelists[i].is_pattern); |
| 1206 } | 1206 } |
| 1207 } | 1207 } |
| 1208 #endif // !APPCACHE_USE_SIMPLE_CACHE | 1208 #endif // !APPCACHE_USE_SIMPLE_CACHE |
| 1209 | 1209 |
| 1210 } // namespace content | 1210 } // namespace content |
| OLD | NEW |