| 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_STORE_UNITTEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_STORE_UNITTEST_HELPER_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_STORE_UNITTEST_HELPER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_STORE_UNITTEST_HELPER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/safe_browsing/safe_browsing_store.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_store.h" |
| 9 | 9 |
| 10 #include "crypto/sha2.h" | 10 #include "crypto/sha2.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void SafeBrowsingStoreTestStorePrefix(SafeBrowsingStore* store); | 34 void SafeBrowsingStoreTestStorePrefix(SafeBrowsingStore* store); |
| 35 | 35 |
| 36 // Test that subs knockout adds. | 36 // Test that subs knockout adds. |
| 37 void SafeBrowsingStoreTestSubKnockout(SafeBrowsingStore* store); | 37 void SafeBrowsingStoreTestSubKnockout(SafeBrowsingStore* store); |
| 38 | 38 |
| 39 // Test that deletes delete the chunk's data. | 39 // Test that deletes delete the chunk's data. |
| 40 void SafeBrowsingStoreTestDeleteChunks(SafeBrowsingStore* store); | 40 void SafeBrowsingStoreTestDeleteChunks(SafeBrowsingStore* store); |
| 41 | 41 |
| 42 // Test that deleting the store deletes the store. | 42 // Test that deleting the store deletes the store. |
| 43 void SafeBrowsingStoreTestDelete(SafeBrowsingStore* store, | 43 void SafeBrowsingStoreTestDelete(SafeBrowsingStore* store, |
| 44 const FilePath& filename); | 44 const base::FilePath& filename); |
| 45 | 45 |
| 46 // Wrap all the tests up for implementation subclasses. | 46 // Wrap all the tests up for implementation subclasses. |
| 47 // |test_fixture| is the class that would be passed to TEST_F(), | 47 // |test_fixture| is the class that would be passed to TEST_F(), |
| 48 // |instance_name| is the name of the SafeBrowsingStore instance | 48 // |instance_name| is the name of the SafeBrowsingStore instance |
| 49 // within the class, as a pointer, and |filename| is that store's | 49 // within the class, as a pointer, and |filename| is that store's |
| 50 // filename, for the Delete() test. | 50 // filename, for the Delete() test. |
| 51 #define TEST_STORE(test_fixture, instance_name, filename) \ | 51 #define TEST_STORE(test_fixture, instance_name, filename) \ |
| 52 TEST_F(test_fixture, Empty) { \ | 52 TEST_F(test_fixture, Empty) { \ |
| 53 SafeBrowsingStoreTestEmpty(instance_name); \ | 53 SafeBrowsingStoreTestEmpty(instance_name); \ |
| 54 } \ | 54 } \ |
| 55 TEST_F(test_fixture, StorePrefix) { \ | 55 TEST_F(test_fixture, StorePrefix) { \ |
| 56 SafeBrowsingStoreTestStorePrefix(instance_name); \ | 56 SafeBrowsingStoreTestStorePrefix(instance_name); \ |
| 57 } \ | 57 } \ |
| 58 TEST_F(test_fixture, SubKnockout) { \ | 58 TEST_F(test_fixture, SubKnockout) { \ |
| 59 SafeBrowsingStoreTestSubKnockout(instance_name); \ | 59 SafeBrowsingStoreTestSubKnockout(instance_name); \ |
| 60 } \ | 60 } \ |
| 61 TEST_F(test_fixture, DeleteChunks) { \ | 61 TEST_F(test_fixture, DeleteChunks) { \ |
| 62 SafeBrowsingStoreTestDeleteChunks(instance_name); \ | 62 SafeBrowsingStoreTestDeleteChunks(instance_name); \ |
| 63 } \ | 63 } \ |
| 64 TEST_F(test_fixture, Delete) { \ | 64 TEST_F(test_fixture, Delete) { \ |
| 65 SafeBrowsingStoreTestDelete(instance_name, filename); \ | 65 SafeBrowsingStoreTestDelete(instance_name, filename); \ |
| 66 } | 66 } |
| 67 | 67 |
| 68 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_STORE_UNITTEST_HELPER_H_ | 68 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_STORE_UNITTEST_HELPER_H_ |
| OLD | NEW |