Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Side by Side Diff: components/copresence/rpc/http_post_unittest.cc

Issue 484853004: Improving copresence request logging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hack
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/copresence/rpc/http_post.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/copresence/rpc/http_post.h" 5 #include "components/copresence/rpc/http_post.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "components/copresence/proto/data.pb.h" 8 #include "components/copresence/proto/data.pb.h"
9 #include "net/base/url_util.h" 9 #include "net/base/url_util.h"
10 #include "net/http/http_status_code.h" 10 #include "net/http/http_status_code.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 std::string api_key_sent; 72 std::string api_key_sent;
73 net::GetValueForKeyInQuery(GetFetcher()->GetOriginalURL(), 73 net::GetValueForKeyInQuery(GetFetcher()->GetOriginalURL(),
74 HttpPost::kApiKeyField, 74 HttpPost::kApiKeyField,
75 &api_key_sent); 75 &api_key_sent);
76 return api_key_sent; 76 return api_key_sent;
77 } 77 }
78 78
79 const std::string GetTracingTokenSent() { 79 const std::string GetTracingTokenSent() {
80 std::string tracing_token_sent; 80 std::string tracing_token_sent;
81 net::GetValueForKeyInQuery(GetFetcher()->GetOriginalURL(), 81 net::GetValueForKeyInQuery(GetFetcher()->GetOriginalURL(),
82 HttpPost::kTracingTokenField, 82 HttpPost::kTracingField,
83 &tracing_token_sent); 83 &tracing_token_sent);
84 return tracing_token_sent; 84 return tracing_token_sent;
85 } 85 }
86 86
87 net::TestURLFetcherFactory fetcher_factory_; 87 net::TestURLFetcherFactory fetcher_factory_;
88 scoped_refptr<net::TestURLRequestContextGetter> context_getter_; 88 scoped_refptr<net::TestURLRequestContextGetter> context_getter_;
89 89
90 ClientVersion proto_; 90 ClientVersion proto_;
91 91
92 int received_response_code_; 92 int received_response_code_;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 TEST_F(HttpPostTest, ErrorResponse) { 133 TEST_F(HttpPostTest, ErrorResponse) {
134 EXPECT_TRUE(ResponsePassedThrough( 134 EXPECT_TRUE(ResponsePassedThrough(
135 net::HTTP_BAD_REQUEST, "Bad client. Shame on you.")); 135 net::HTTP_BAD_REQUEST, "Bad client. Shame on you."));
136 EXPECT_TRUE(ResponsePassedThrough( 136 EXPECT_TRUE(ResponsePassedThrough(
137 net::HTTP_INTERNAL_SERVER_ERROR, "I'm dying. Forgive me.")); 137 net::HTTP_INTERNAL_SERVER_ERROR, "I'm dying. Forgive me."));
138 EXPECT_TRUE(ResponsePassedThrough(-1, "")); 138 EXPECT_TRUE(ResponsePassedThrough(-1, ""));
139 } 139 }
140 140
141 } // namespace copresence 141 } // namespace copresence
OLDNEW
« no previous file with comments | « components/copresence/rpc/http_post.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698