| 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 // This test creates a safebrowsing service using test safebrowsing database | 5 // This test creates a safebrowsing service using test safebrowsing database |
| 6 // and a test protocol manager. It is used to test logics in safebrowsing | 6 // and a test protocol manager. It is used to test logics in safebrowsing |
| 7 // service. | 7 // service. |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_dir)) { | 901 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_dir)) { |
| 902 EXPECT_TRUE(false); | 902 EXPECT_TRUE(false); |
| 903 return false; | 903 return false; |
| 904 } | 904 } |
| 905 | 905 |
| 906 // Initialize the SafeBrowsing cookies with a pre-created cookie store. It | 906 // Initialize the SafeBrowsing cookies with a pre-created cookie store. It |
| 907 // contains a single cookie, for domain 127.0.0.1, with value a=b, and | 907 // contains a single cookie, for domain 127.0.0.1, with value a=b, and |
| 908 // expires in 2038. | 908 // expires in 2038. |
| 909 base::FilePath initial_cookies = test_dir.AppendASCII("safe_browsing") | 909 base::FilePath initial_cookies = test_dir.AppendASCII("safe_browsing") |
| 910 .AppendASCII("Safe Browsing Cookies"); | 910 .AppendASCII("Safe Browsing Cookies"); |
| 911 if (!file_util::CopyFile(initial_cookies, cookie_path)) { | 911 if (!base::CopyFile(initial_cookies, cookie_path)) { |
| 912 EXPECT_TRUE(false); | 912 EXPECT_TRUE(false); |
| 913 return false; | 913 return false; |
| 914 } | 914 } |
| 915 | 915 |
| 916 sql::Connection db; | 916 sql::Connection db; |
| 917 if (!db.Open(cookie_path)) { | 917 if (!db.Open(cookie_path)) { |
| 918 EXPECT_TRUE(false); | 918 EXPECT_TRUE(false); |
| 919 return false; | 919 return false; |
| 920 } | 920 } |
| 921 // Ensure the host value in the cookie file matches the test server we will | 921 // Ensure the host value in the cookie file matches the test server we will |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 content::WindowedNotificationObserver observer( | 986 content::WindowedNotificationObserver observer( |
| 987 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 987 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
| 988 content::Source<SafeBrowsingDatabaseManager>( | 988 content::Source<SafeBrowsingDatabaseManager>( |
| 989 sb_service_->database_manager().get())); | 989 sb_service_->database_manager().get())); |
| 990 BrowserThread::PostTask( | 990 BrowserThread::PostTask( |
| 991 BrowserThread::IO, | 991 BrowserThread::IO, |
| 992 FROM_HERE, | 992 FROM_HERE, |
| 993 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 993 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
| 994 observer.Wait(); | 994 observer.Wait(); |
| 995 } | 995 } |
| OLD | NEW |