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/logging.h" | 6 #include "base/logging.h" |
7 #include "base/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | |
10 #include "chrome/browser/safe_browsing/ping_manager.h" | 9 #include "chrome/browser/safe_browsing/ping_manager.h" |
11 #include "google_apis/google_api_keys.h" | 10 #include "google_apis/google_api_keys.h" |
12 #include "net/base/escape.h" | 11 #include "net/base/escape.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using base::Time; | 14 using base::Time; |
15 using base::TimeDelta; | 15 using base::TimeDelta; |
16 | 16 |
17 static const char kUrlPrefix[] = "https://prefix.com/foo"; | 17 static const char kUrlPrefix[] = "https://prefix.com/foo"; |
18 static const char kClient[] = "unittest"; | 18 static const char kClient[] = "unittest"; |
19 static const char kAppVer[] = "1.0"; | 19 static const char kAppVer[] = "1.0"; |
20 | 20 |
21 class SafeBrowsingPingManagerTest : public testing::Test { | 21 class SafeBrowsingPingManagerTest : public testing::Test { |
22 protected: | 22 protected: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 SafeBrowsingProtocolConfig config; | 93 SafeBrowsingProtocolConfig config; |
94 config.client_name = kClient; | 94 config.client_name = kClient; |
95 config.url_prefix = kUrlPrefix; | 95 config.url_prefix = kUrlPrefix; |
96 SafeBrowsingPingManager pm(NULL, config); | 96 SafeBrowsingPingManager pm(NULL, config); |
97 | 97 |
98 pm.version_ = kAppVer; | 98 pm.version_ = kAppVer; |
99 EXPECT_EQ("https://prefix.com/foo/clientreport/malware?" | 99 EXPECT_EQ("https://prefix.com/foo/clientreport/malware?" |
100 "client=unittest&appver=1.0&pver=1.0" + key_param_, | 100 "client=unittest&appver=1.0&pver=1.0" + key_param_, |
101 pm.MalwareDetailsUrl().spec()); | 101 pm.MalwareDetailsUrl().spec()); |
102 } | 102 } |
OLD | NEW |