Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // 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/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 25
25 namespace { 26 namespace {
26 27
27 SBPrefix Sha256Prefix(const std::string& str) { 28 SBPrefix Sha256Prefix(const std::string& str) {
28 SBPrefix prefix; 29 SBPrefix prefix;
29 crypto::SHA256HashString(str, &prefix, sizeof(prefix)); 30 crypto::SHA256HashString(str, &prefix, sizeof(prefix));
30 return prefix; 31 return prefix;
31 } 32 }
32 33
33 SBFullHash Sha256Hash(const std::string& str) { 34 SBFullHash Sha256Hash(const std::string& str) {
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 1619
1619 // Simply calling |UpdateStarted()| then |UpdateFinished()| does not 1620 // Simply calling |UpdateStarted()| then |UpdateFinished()| does not
1620 // update the database file. 1621 // update the database file.
1621 ASSERT_TRUE(file_util::SetLastModifiedTime(filename, old_last_modified)); 1622 ASSERT_TRUE(file_util::SetLastModifiedTime(filename, old_last_modified));
1622 ASSERT_TRUE(file_util::GetFileInfo(filename, &before_info)); 1623 ASSERT_TRUE(file_util::GetFileInfo(filename, &before_info));
1623 EXPECT_TRUE(database_->UpdateStarted(&lists)); 1624 EXPECT_TRUE(database_->UpdateStarted(&lists));
1624 database_->UpdateFinished(true); 1625 database_->UpdateFinished(true);
1625 ASSERT_TRUE(file_util::GetFileInfo(filename, &after_info)); 1626 ASSERT_TRUE(file_util::GetFileInfo(filename, &after_info));
1626 EXPECT_EQ(before_info.last_modified, after_info.last_modified); 1627 EXPECT_EQ(before_info.last_modified, after_info.last_modified);
1627 } 1628 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698