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 #include "chrome/browser/safe_browsing/protocol_manager.h" | 5 #include "chrome/browser/safe_browsing/protocol_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 namespace safe_browsing { | 70 namespace safe_browsing { |
71 | 71 |
72 class SafeBrowsingProtocolManagerTest : public testing::Test { | 72 class SafeBrowsingProtocolManagerTest : public testing::Test { |
73 protected: | 73 protected: |
74 SafeBrowsingProtocolManagerTest() | 74 SafeBrowsingProtocolManagerTest() |
75 : runner_(new base::TestSimpleTaskRunner), | 75 : runner_(new base::TestSimpleTaskRunner), |
76 runner_handler_(runner_), | 76 runner_handler_(runner_), |
77 io_thread_(content::BrowserThread::IO, base::MessageLoop::current()) {} | 77 io_thread_(content::BrowserThread::IO) {} |
78 | 78 |
79 ~SafeBrowsingProtocolManagerTest() override {} | 79 ~SafeBrowsingProtocolManagerTest() override {} |
80 | 80 |
81 void SetUp() override { | 81 void SetUp() override { |
82 std::string key = google_apis::GetAPIKey(); | 82 std::string key = google_apis::GetAPIKey(); |
83 if (!key.empty()) { | 83 if (!key.empty()) { |
84 key_param_ = base::StringPrintf( | 84 key_param_ = base::StringPrintf( |
85 "&key=%s", | 85 "&key=%s", |
86 net::EscapeQueryParamValue(key, true).c_str()); | 86 net::EscapeQueryParamValue(key, true).c_str()); |
87 } | 87 } |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 | 1098 |
1099 EXPECT_FALSE(pm->IsUpdateScheduled()); | 1099 EXPECT_FALSE(pm->IsUpdateScheduled()); |
1100 | 1100 |
1101 // Invoke the AddChunksCallback to finish the update. | 1101 // Invoke the AddChunksCallback to finish the update. |
1102 runner_->RunPendingTasks(); | 1102 runner_->RunPendingTasks(); |
1103 | 1103 |
1104 EXPECT_TRUE(pm->IsUpdateScheduled()); | 1104 EXPECT_TRUE(pm->IsUpdateScheduled()); |
1105 } | 1105 } |
1106 | 1106 |
1107 } // namespace safe_browsing | 1107 } // namespace safe_browsing |
OLD | NEW |