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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 virtual void TearDown() { | 397 virtual void TearDown() { |
398 InProcessBrowserTest::TearDown(); | 398 InProcessBrowserTest::TearDown(); |
399 | 399 |
400 // Unregister test factories after InProcessBrowserTest::TearDown | 400 // Unregister test factories after InProcessBrowserTest::TearDown |
401 // (which destructs SafeBrowsingService). | 401 // (which destructs SafeBrowsingService). |
402 SafeBrowsingDatabase::RegisterFactory(NULL); | 402 SafeBrowsingDatabase::RegisterFactory(NULL); |
403 SafeBrowsingProtocolManager::RegisterFactory(NULL); | 403 SafeBrowsingProtocolManager::RegisterFactory(NULL); |
404 SafeBrowsingService::RegisterFactory(NULL); | 404 SafeBrowsingService::RegisterFactory(NULL); |
405 } | 405 } |
406 | 406 |
407 virtual void SetUpCommandLine(CommandLine* command_line) override { | 407 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
408 // Makes sure the auto update is not triggered during the test. | 408 // Makes sure the auto update is not triggered during the test. |
409 // This test will fill up the database using testing prefixes | 409 // This test will fill up the database using testing prefixes |
410 // and urls. | 410 // and urls. |
411 command_line->AppendSwitch(switches::kSbDisableAutoUpdate); | 411 command_line->AppendSwitch(switches::kSbDisableAutoUpdate); |
412 #if defined(OS_CHROMEOS) | 412 #if defined(OS_CHROMEOS) |
413 command_line->AppendSwitch( | 413 command_line->AppendSwitch( |
414 chromeos::switches::kIgnoreUserProfileMappingForTests); | 414 chromeos::switches::kIgnoreUserProfileMappingForTests); |
415 #endif | 415 #endif |
416 } | 416 } |
417 | 417 |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 content::WindowedNotificationObserver observer( | 1233 content::WindowedNotificationObserver observer( |
1234 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 1234 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
1235 content::Source<SafeBrowsingDatabaseManager>( | 1235 content::Source<SafeBrowsingDatabaseManager>( |
1236 sb_service_->database_manager().get())); | 1236 sb_service_->database_manager().get())); |
1237 BrowserThread::PostTask( | 1237 BrowserThread::PostTask( |
1238 BrowserThread::IO, | 1238 BrowserThread::IO, |
1239 FROM_HERE, | 1239 FROM_HERE, |
1240 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 1240 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
1241 observer.Wait(); | 1241 observer.Wait(); |
1242 } | 1242 } |
OLD | NEW |