| Index: components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
|
| diff --git a/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc b/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
|
| index 0a997b645ae84f0c5ac3cf6a80704553cec9cabc..480dafd4a8df7a38badde7b7e7622c22d1ffd7f8 100644
|
| --- a/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
|
| +++ b/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/base64.h"
|
| #include "base/time/time.h"
|
| #include "net/base/escape.h"
|
| +#include "net/http/http_request_headers.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| using base::Time;
|
| @@ -107,16 +108,21 @@ TEST_F(SafeBrowsingV4ProtocolManagerUtilTest, TestBackOffLogic) {
|
| EXPECT_EQ(TimeDelta::FromHours(24), next);
|
| }
|
|
|
| -TEST_F(SafeBrowsingV4ProtocolManagerUtilTest, TestGetRequestUrl) {
|
| +TEST_F(SafeBrowsingV4ProtocolManagerUtilTest,
|
| + TestGetRequestUrlAndUpdateHeaders) {
|
| V4ProtocolConfig config;
|
| PopulateV4ProtocolConfig(&config);
|
|
|
| std::string expectedUrl =
|
| - "https://safebrowsing.googleapis.com/v4/someMethod/request_base64?"
|
| - "alt=proto&client_id=unittest&client_version=1.0&key=test_key_param";
|
| - EXPECT_EQ(expectedUrl, V4ProtocolManagerUtil::GetRequestUrl(
|
| - "request_base64", "someMethod", config)
|
| + "https://safebrowsing.googleapis.com/v4/someMethod?"
|
| + "$req=request_base64&$ct=application/x-protobuf&key=test_key_param";
|
| + net::HttpRequestHeaders headers;
|
| + EXPECT_EQ(expectedUrl, V4ProtocolManagerUtil::GetRequestUrlAndUpdateHeaders(
|
| + "request_base64", "someMethod", config, &headers)
|
| .spec());
|
| + std::string header_value;
|
| + EXPECT_TRUE(headers.GetHeader("X-HTTP-Method-Override", &header_value));
|
| + EXPECT_EQ("POST", header_value);
|
| }
|
|
|
| } // namespace safe_browsing
|
|
|