| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 19 #include "base/strings/string_split.h" | 19 #include "base/strings/string_split.h" |
| 20 #include "base/test/thread_test_helper.h" | 20 #include "base/test/thread_test_helper.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "chrome/browser/bookmarks/startup_task_runner_service_factory.h" |
| 22 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/chrome_notification_types.h" | 24 #include "chrome/browser/chrome_notification_types.h" |
| 24 #include "chrome/browser/prerender/prerender_manager.h" | 25 #include "chrome/browser/prerender/prerender_manager.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/profiles/profile_manager.h" | 27 #include "chrome/browser/profiles/profile_manager.h" |
| 27 #include "chrome/browser/profiles/startup_task_runner_service.h" | |
| 28 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" | |
| 29 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 28 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 30 #include "chrome/browser/safe_browsing/database_manager.h" | 29 #include "chrome/browser/safe_browsing/database_manager.h" |
| 31 #include "chrome/browser/safe_browsing/local_database_manager.h" | 30 #include "chrome/browser/safe_browsing/local_database_manager.h" |
| 32 #include "chrome/browser/safe_browsing/metadata.pb.h" | 31 #include "chrome/browser/safe_browsing/metadata.pb.h" |
| 33 #include "chrome/browser/safe_browsing/protocol_manager.h" | 32 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 34 #include "chrome/browser/safe_browsing/safe_browsing_database.h" | 33 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
| 35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 34 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 36 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 35 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 37 #include "chrome/browser/safe_browsing/ui_manager.h" | 36 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 38 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
| 39 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 38 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 40 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
| 41 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
| 43 #include "chrome/test/base/in_process_browser_test.h" | 42 #include "chrome/test/base/in_process_browser_test.h" |
| 44 #include "chrome/test/base/ui_test_utils.h" | 43 #include "chrome/test/base/ui_test_utils.h" |
| 44 #include "components/bookmarks/browser/startup_task_runner_service.h" |
| 45 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 46 #include "net/cookies/cookie_store.h" | 46 #include "net/cookies/cookie_store.h" |
| 47 #include "sql/connection.h" | 47 #include "sql/connection.h" |
| 48 #include "sql/statement.h" | 48 #include "sql/statement.h" |
| 49 #include "testing/gmock/include/gmock/gmock.h" | 49 #include "testing/gmock/include/gmock/gmock.h" |
| 50 | 50 |
| 51 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 52 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 52 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 53 #include "chromeos/chromeos_switches.h" | 53 #include "chromeos/chromeos_switches.h" |
| 54 #endif | 54 #endif |
| (...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 content::WindowedNotificationObserver observer( | 1301 content::WindowedNotificationObserver observer( |
| 1302 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 1302 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
| 1303 content::Source<SafeBrowsingDatabaseManager>( | 1303 content::Source<SafeBrowsingDatabaseManager>( |
| 1304 sb_service_->database_manager().get())); | 1304 sb_service_->database_manager().get())); |
| 1305 BrowserThread::PostTask( | 1305 BrowserThread::PostTask( |
| 1306 BrowserThread::IO, | 1306 BrowserThread::IO, |
| 1307 FROM_HERE, | 1307 FROM_HERE, |
| 1308 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 1308 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
| 1309 observer.Wait(); | 1309 observer.Wait(); |
| 1310 } | 1310 } |
| OLD | NEW |