OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/safe_browsing_db/v4_local_database_manager.h" | 5 #include "components/safe_browsing_db/v4_local_database_manager.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
10 #include "base/test/test_simple_task_runner.h" | 11 #include "base/test/test_simple_task_runner.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
12 #include "components/safe_browsing_db/v4_database.h" | 13 #include "components/safe_browsing_db/v4_database.h" |
13 #include "components/safe_browsing_db/v4_test_util.h" | 14 #include "components/safe_browsing_db/v4_test_util.h" |
14 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" |
15 #include "crypto/sha2.h" | 16 #include "crypto/sha2.h" |
16 #include "net/url_request/test_url_fetcher_factory.h" | 17 #include "net/url_request/test_url_fetcher_factory.h" |
17 #include "testing/platform_test.h" | 18 #include "testing/platform_test.h" |
18 | 19 |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 | 954 |
954 TestClient client(SB_THREAT_TYPE_BINARY_MALWARE_URL, url_chain); | 955 TestClient client(SB_THREAT_TYPE_BINARY_MALWARE_URL, url_chain); |
955 EXPECT_FALSE( | 956 EXPECT_FALSE( |
956 v4_local_database_manager_->CheckDownloadUrl(url_chain, &client)); | 957 v4_local_database_manager_->CheckDownloadUrl(url_chain, &client)); |
957 EXPECT_FALSE(client.on_check_download_urls_result_called_); | 958 EXPECT_FALSE(client.on_check_download_urls_result_called_); |
958 WaitForTasksOnTaskRunner(); | 959 WaitForTasksOnTaskRunner(); |
959 EXPECT_TRUE(client.on_check_download_urls_result_called_); | 960 EXPECT_TRUE(client.on_check_download_urls_result_called_); |
960 } | 961 } |
961 | 962 |
962 } // namespace safe_browsing | 963 } // namespace safe_browsing |
OLD | NEW |