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 // Unit tests for the SafeBrowsing storage system. | 5 // Unit tests for the SafeBrowsing storage system. |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "chrome/browser/safe_browsing/safe_browsing_database.h" | 12 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
13 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" | 13 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" |
14 #include "chrome/browser/safe_browsing/safe_browsing_store_unittest_helper.h" | 14 #include "chrome/browser/safe_browsing/safe_browsing_store_unittest_helper.h" |
15 #include "content/test/test_browser_thread.h" | 15 #include "content/public/test/test_browser_thread.h" |
16 #include "crypto/sha2.h" | 16 #include "crypto/sha2.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "sql/connection.h" | 18 #include "sql/connection.h" |
19 #include "sql/statement.h" | 19 #include "sql/statement.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "testing/platform_test.h" | 21 #include "testing/platform_test.h" |
22 | 22 |
23 using base::Time; | 23 using base::Time; |
24 using content::BrowserThread; | 24 using content::BrowserThread; |
25 | 25 |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 | 1578 |
1579 // Simply calling |UpdateStarted()| then |UpdateFinished()| does not | 1579 // Simply calling |UpdateStarted()| then |UpdateFinished()| does not |
1580 // update the database file. | 1580 // update the database file. |
1581 ASSERT_TRUE(file_util::SetLastModifiedTime(filename, old_last_modified)); | 1581 ASSERT_TRUE(file_util::SetLastModifiedTime(filename, old_last_modified)); |
1582 ASSERT_TRUE(file_util::GetFileInfo(filename, &before_info)); | 1582 ASSERT_TRUE(file_util::GetFileInfo(filename, &before_info)); |
1583 EXPECT_TRUE(database_->UpdateStarted(&lists)); | 1583 EXPECT_TRUE(database_->UpdateStarted(&lists)); |
1584 database_->UpdateFinished(true); | 1584 database_->UpdateFinished(true); |
1585 ASSERT_TRUE(file_util::GetFileInfo(filename, &after_info)); | 1585 ASSERT_TRUE(file_util::GetFileInfo(filename, &after_info)); |
1586 EXPECT_EQ(before_info.last_modified, after_info.last_modified); | 1586 EXPECT_EQ(before_info.last_modified, after_info.last_modified); |
1587 } | 1587 } |
OLD | NEW |