| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 'e', 'f', 'g', 'h' // 4-byte prefix | 65 'e', 'f', 'g', 'h' // 4-byte prefix |
| 66 }; | 66 }; |
| 67 const std::string kChunkPayload2(kRawChunkPayload2, sizeof(kRawChunkPayload2)); | 67 const std::string kChunkPayload2(kRawChunkPayload2, sizeof(kRawChunkPayload2)); |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 class SafeBrowsingProtocolManagerTest : public testing::Test { | 71 class SafeBrowsingProtocolManagerTest : public testing::Test { |
| 72 protected: | 72 protected: |
| 73 std::string key_param_; | 73 std::string key_param_; |
| 74 | 74 |
| 75 virtual void SetUp() { | 75 void SetUp() override { |
| 76 std::string key = google_apis::GetAPIKey(); | 76 std::string key = google_apis::GetAPIKey(); |
| 77 if (!key.empty()) { | 77 if (!key.empty()) { |
| 78 key_param_ = base::StringPrintf( | 78 key_param_ = base::StringPrintf( |
| 79 "&key=%s", | 79 "&key=%s", |
| 80 net::EscapeQueryParamValue(key, true).c_str()); | 80 net::EscapeQueryParamValue(key, true).c_str()); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 scoped_ptr<SafeBrowsingProtocolManager> CreateProtocolManager( | 84 scoped_ptr<SafeBrowsingProtocolManager> CreateProtocolManager( |
| 85 SafeBrowsingProtocolManagerDelegate* delegate) { | 85 SafeBrowsingProtocolManagerDelegate* delegate) { |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 second_chunk_url_fetcher->delegate()->OnURLFetchComplete( | 1126 second_chunk_url_fetcher->delegate()->OnURLFetchComplete( |
| 1127 second_chunk_url_fetcher); | 1127 second_chunk_url_fetcher); |
| 1128 | 1128 |
| 1129 EXPECT_FALSE(pm->IsUpdateScheduled()); | 1129 EXPECT_FALSE(pm->IsUpdateScheduled()); |
| 1130 | 1130 |
| 1131 // Invoke the AddChunksCallback to finish the update. | 1131 // Invoke the AddChunksCallback to finish the update. |
| 1132 runner->RunPendingTasks(); | 1132 runner->RunPendingTasks(); |
| 1133 | 1133 |
| 1134 EXPECT_TRUE(pm->IsUpdateScheduled()); | 1134 EXPECT_TRUE(pm->IsUpdateScheduled()); |
| 1135 } | 1135 } |
| OLD | NEW |