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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 GURL url_prefix = test_server()->GetURL( | 888 GURL url_prefix = test_server()->GetURL( |
889 "expect-and-set-cookie?expect=a%3db" | 889 "expect-and-set-cookie?expect=a%3db" |
890 "&set=c%3dd%3b%20Expires=Fri,%2001%20Jan%202038%2001:01:01%20GMT" | 890 "&set=c%3dd%3b%20Expires=Fri,%2001%20Jan%202038%2001:01:01%20GMT" |
891 "&data=foo#"); | 891 "&data=foo#"); |
892 command_line->AppendSwitchASCII(switches::kSbURLPrefix, url_prefix.spec()); | 892 command_line->AppendSwitchASCII(switches::kSbURLPrefix, url_prefix.spec()); |
893 } | 893 } |
894 | 894 |
895 virtual bool SetUpUserDataDirectory() OVERRIDE { | 895 virtual bool SetUpUserDataDirectory() OVERRIDE { |
896 base::FilePath cookie_path( | 896 base::FilePath cookie_path( |
897 SafeBrowsingService::GetCookieFilePathForTesting()); | 897 SafeBrowsingService::GetCookieFilePathForTesting()); |
898 EXPECT_FALSE(file_util::PathExists(cookie_path)); | 898 EXPECT_FALSE(base::PathExists(cookie_path)); |
899 | 899 |
900 base::FilePath test_dir; | 900 base::FilePath test_dir; |
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. |
(...skipping 77 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 |