| 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 | 5 |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 // Tests the contents of the POST body when there are contents in the | 401 // Tests the contents of the POST body when there are contents in the |
| 402 // local database. This is not exhaustive, as the actual list formatting | 402 // local database. This is not exhaustive, as the actual list formatting |
| 403 // is covered by SafeBrowsingProtocolManagerTest.TestChunkStrings. | 403 // is covered by SafeBrowsingProtocolManagerTest.TestChunkStrings. |
| 404 TEST_F(SafeBrowsingProtocolManagerTest, ExistingDatabase) { | 404 TEST_F(SafeBrowsingProtocolManagerTest, ExistingDatabase) { |
| 405 scoped_refptr<base::TestSimpleTaskRunner> runner( | 405 scoped_refptr<base::TestSimpleTaskRunner> runner( |
| 406 new base::TestSimpleTaskRunner()); | 406 new base::TestSimpleTaskRunner()); |
| 407 base::ThreadTaskRunnerHandle runner_handler(runner); | 407 base::ThreadTaskRunnerHandle runner_handler(runner); |
| 408 net::TestURLFetcherFactory url_fetcher_factory; | 408 net::TestURLFetcherFactory url_fetcher_factory; |
| 409 | 409 |
| 410 std::vector<SBListChunkRanges> ranges; | 410 std::vector<SBListChunkRanges> ranges; |
| 411 SBListChunkRanges range_phish(safe_browsing::kPhishingList); | 411 SBListChunkRanges range_phish(safe_browsing_util::kPhishingList); |
| 412 range_phish.adds = "adds_phish"; | 412 range_phish.adds = "adds_phish"; |
| 413 range_phish.subs = "subs_phish"; | 413 range_phish.subs = "subs_phish"; |
| 414 ranges.push_back(range_phish); | 414 ranges.push_back(range_phish); |
| 415 | 415 |
| 416 SBListChunkRanges range_unknown("unknown_list"); | 416 SBListChunkRanges range_unknown("unknown_list"); |
| 417 range_unknown.adds = "adds_unknown"; | 417 range_unknown.adds = "adds_unknown"; |
| 418 range_unknown.subs = "subs_unknown"; | 418 range_unknown.subs = "subs_unknown"; |
| 419 ranges.push_back(range_unknown); | 419 ranges.push_back(range_unknown); |
| 420 | 420 |
| 421 testing::StrictMock<MockProtocolDelegate> test_delegate; | 421 testing::StrictMock<MockProtocolDelegate> test_delegate; |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 second_chunk_url_fetcher->delegate()->OnURLFetchComplete( | 1124 second_chunk_url_fetcher->delegate()->OnURLFetchComplete( |
| 1125 second_chunk_url_fetcher); | 1125 second_chunk_url_fetcher); |
| 1126 | 1126 |
| 1127 EXPECT_FALSE(pm->IsUpdateScheduled()); | 1127 EXPECT_FALSE(pm->IsUpdateScheduled()); |
| 1128 | 1128 |
| 1129 // Invoke the AddChunksCallback to finish the update. | 1129 // Invoke the AddChunksCallback to finish the update. |
| 1130 runner->RunPendingTasks(); | 1130 runner->RunPendingTasks(); |
| 1131 | 1131 |
| 1132 EXPECT_TRUE(pm->IsUpdateScheduled()); | 1132 EXPECT_TRUE(pm->IsUpdateScheduled()); |
| 1133 } | 1133 } |
| OLD | NEW |