| 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.h" | 58 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver.h" |
| 59 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 59 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
| 60 #include "components/subresource_filter/core/browser/subresource_filter_features
.h" | 60 #include "components/subresource_filter/core/browser/subresource_filter_features
.h" |
| 61 #include "components/subresource_filter/core/browser/subresource_filter_features
_test_support.h" | 61 #include "components/subresource_filter/core/browser/subresource_filter_features
_test_support.h" |
| 62 #include "content/public/browser/interstitial_page.h" | 62 #include "content/public/browser/interstitial_page.h" |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 // (which destructs SafeBrowsingService). | 538 // (which destructs SafeBrowsingService). |
| 539 SafeBrowsingDatabase::RegisterFactory(nullptr); | 539 SafeBrowsingDatabase::RegisterFactory(nullptr); |
| 540 SafeBrowsingProtocolManager::RegisterFactory(nullptr); | 540 SafeBrowsingProtocolManager::RegisterFactory(nullptr); |
| 541 SafeBrowsingService::RegisterFactory(nullptr); | 541 SafeBrowsingService::RegisterFactory(nullptr); |
| 542 } | 542 } |
| 543 | 543 |
| 544 void SetUpCommandLine(base::CommandLine* command_line) override { | 544 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 545 // Makes sure the auto update is not triggered during the test. | 545 // Makes sure the auto update is not triggered during the test. |
| 546 // This test will fill up the database using testing prefixes | 546 // This test will fill up the database using testing prefixes |
| 547 // and urls. | 547 // and urls. |
| 548 command_line->AppendSwitch(switches::kSbDisableAutoUpdate); | 548 command_line->AppendSwitch(safe_browsing::switches::kSbDisableAutoUpdate); |
| 549 #if defined(OS_CHROMEOS) | 549 #if defined(OS_CHROMEOS) |
| 550 command_line->AppendSwitch( | 550 command_line->AppendSwitch( |
| 551 chromeos::switches::kIgnoreUserProfileMappingForTests); | 551 chromeos::switches::kIgnoreUserProfileMappingForTests); |
| 552 #endif | 552 #endif |
| 553 } | 553 } |
| 554 | 554 |
| 555 void SetUpOnMainThread() override { | 555 void SetUpOnMainThread() override { |
| 556 InProcessBrowserTest::SetUpOnMainThread(); | 556 InProcessBrowserTest::SetUpOnMainThread(); |
| 557 g_browser_process->safe_browsing_service()->ui_manager()->AddObserver( | 557 g_browser_process->safe_browsing_service()->ui_manager()->AddObserver( |
| 558 &observer_); | 558 &observer_); |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 content::Source<SafeBrowsingDatabaseManager>( | 1824 content::Source<SafeBrowsingDatabaseManager>( |
| 1825 sb_factory_->test_safe_browsing_service()->database_manager().get())); | 1825 sb_factory_->test_safe_browsing_service()->database_manager().get())); |
| 1826 BrowserThread::PostTask( | 1826 BrowserThread::PostTask( |
| 1827 BrowserThread::IO, FROM_HERE, | 1827 BrowserThread::IO, FROM_HERE, |
| 1828 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, | 1828 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, |
| 1829 base::Unretained(this))); | 1829 base::Unretained(this))); |
| 1830 observer.Wait(); | 1830 observer.Wait(); |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 } // namespace safe_browsing | 1833 } // namespace safe_browsing |
| OLD | NEW |