| 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 "chrome/browser/safe_browsing/safe_browsing_service.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 36 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 37 #include "chrome/browser/safe_browsing/local_database_manager.h" | 37 #include "chrome/browser/safe_browsing/local_database_manager.h" |
| 38 #include "chrome/browser/safe_browsing/protocol_manager.h" | 38 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 39 #include "chrome/browser/safe_browsing/safe_browsing_database.h" | 39 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
| 40 #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" | 40 #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" |
| 41 #include "chrome/browser/safe_browsing/ui_manager.h" | 41 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
| 43 #include "chrome/browser/ui/browser_navigator_params.h" | 43 #include "chrome/browser/ui/browser_navigator_params.h" |
| 44 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 44 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 45 #include "chrome/common/chrome_paths.h" | 45 #include "chrome/common/chrome_paths.h" |
| 46 #include "chrome/common/chrome_switches.h" | |
| 47 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
| 48 #include "chrome/test/base/in_process_browser_test.h" | 47 #include "chrome/test/base/in_process_browser_test.h" |
| 49 #include "chrome/test/base/ui_test_utils.h" | 48 #include "chrome/test/base/ui_test_utils.h" |
| 50 #include "components/bookmarks/browser/startup_task_runner_service.h" | 49 #include "components/bookmarks/browser/startup_task_runner_service.h" |
| 51 #include "components/content_settings/core/browser/host_content_settings_map.h" | 50 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 52 #include "components/prefs/pref_service.h" | 51 #include "components/prefs/pref_service.h" |
| 52 #include "components/safe_browsing/common/safebrowsing_switches.h" |
| 53 #include "components/safe_browsing_db/database_manager.h" | 53 #include "components/safe_browsing_db/database_manager.h" |
| 54 #include "components/safe_browsing_db/metadata.pb.h" | 54 #include "components/safe_browsing_db/metadata.pb.h" |
| 55 #include "components/safe_browsing_db/test_database_manager.h" | 55 #include "components/safe_browsing_db/test_database_manager.h" |
| 56 #include "components/safe_browsing_db/util.h" | 56 #include "components/safe_browsing_db/util.h" |
| 57 #include "components/safe_browsing_db/v4_protocol_manager_util.h" | 57 #include "components/safe_browsing_db/v4_protocol_manager_util.h" |
| 58 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 58 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
| 59 #include "components/subresource_filter/core/browser/subresource_filter_features
.h" | 59 #include "components/subresource_filter/core/browser/subresource_filter_features
.h" |
| 60 #include "components/subresource_filter/core/browser/subresource_filter_features
_test_support.h" | 60 #include "components/subresource_filter/core/browser/subresource_filter_features
_test_support.h" |
| 61 #include "content/public/browser/interstitial_page.h" | 61 #include "content/public/browser/interstitial_page.h" |
| 62 #include "content/public/browser/navigation_entry.h" | 62 #include "content/public/browser/navigation_entry.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 // (which destructs SafeBrowsingService). | 521 // (which destructs SafeBrowsingService). |
| 522 SafeBrowsingDatabase::RegisterFactory(nullptr); | 522 SafeBrowsingDatabase::RegisterFactory(nullptr); |
| 523 SafeBrowsingProtocolManager::RegisterFactory(nullptr); | 523 SafeBrowsingProtocolManager::RegisterFactory(nullptr); |
| 524 SafeBrowsingService::RegisterFactory(nullptr); | 524 SafeBrowsingService::RegisterFactory(nullptr); |
| 525 } | 525 } |
| 526 | 526 |
| 527 void SetUpCommandLine(base::CommandLine* command_line) override { | 527 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 528 // Makes sure the auto update is not triggered during the test. | 528 // Makes sure the auto update is not triggered during the test. |
| 529 // This test will fill up the database using testing prefixes | 529 // This test will fill up the database using testing prefixes |
| 530 // and urls. | 530 // and urls. |
| 531 command_line->AppendSwitch(switches::kSbDisableAutoUpdate); | 531 command_line->AppendSwitch(safe_browsing::switches::kSbDisableAutoUpdate); |
| 532 #if defined(OS_CHROMEOS) | 532 #if defined(OS_CHROMEOS) |
| 533 command_line->AppendSwitch( | 533 command_line->AppendSwitch( |
| 534 chromeos::switches::kIgnoreUserProfileMappingForTests); | 534 chromeos::switches::kIgnoreUserProfileMappingForTests); |
| 535 #endif | 535 #endif |
| 536 } | 536 } |
| 537 | 537 |
| 538 void SetUpOnMainThread() override { | 538 void SetUpOnMainThread() override { |
| 539 InProcessBrowserTest::SetUpOnMainThread(); | 539 InProcessBrowserTest::SetUpOnMainThread(); |
| 540 g_browser_process->safe_browsing_service()->ui_manager()->AddObserver( | 540 g_browser_process->safe_browsing_service()->ui_manager()->AddObserver( |
| 541 &observer_); | 541 &observer_); |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 content::Source<SafeBrowsingDatabaseManager>( | 1775 content::Source<SafeBrowsingDatabaseManager>( |
| 1776 sb_factory_->test_safe_browsing_service()->database_manager().get())); | 1776 sb_factory_->test_safe_browsing_service()->database_manager().get())); |
| 1777 BrowserThread::PostTask( | 1777 BrowserThread::PostTask( |
| 1778 BrowserThread::IO, FROM_HERE, | 1778 BrowserThread::IO, FROM_HERE, |
| 1779 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, | 1779 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, |
| 1780 base::Unretained(this))); | 1780 base::Unretained(this))); |
| 1781 observer.Wait(); | 1781 observer.Wait(); |
| 1782 } | 1782 } |
| 1783 | 1783 |
| 1784 } // namespace safe_browsing | 1784 } // namespace safe_browsing |
| OLD | NEW |