OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_snippets/remote/json_request.h" | 5 #include "components/ntp_snippets/remote/json_request.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // be those lexically first. | 249 // be those lexically first. |
250 " ]," | 250 " ]," |
251 " \"userActivenessClass\": \"ACTIVE_NTP_USER\"" | 251 " \"userActivenessClass\": \"ACTIVE_NTP_USER\"" |
252 "}")); | 252 "}")); |
253 } | 253 } |
254 | 254 |
255 TEST_F(JsonRequestTest, BuildRequestNoUserClass) { | 255 TEST_F(JsonRequestTest, BuildRequestNoUserClass) { |
256 JsonRequest::Builder builder; | 256 JsonRequest::Builder builder; |
257 RequestParams params; | 257 RequestParams params; |
258 params.interactive_request = false; | 258 params.interactive_request = false; |
259 builder.SetParams(params) | 259 builder.SetParams(params).SetFetchAPI( |
260 .SetFetchAPI(FetchAPI::CHROME_CONTENT_SUGGESTIONS_API); | 260 FetchAPI::CHROME_CONTENT_SUGGESTIONS_API); |
261 | 261 |
262 EXPECT_THAT(builder.PreviewRequestBodyForTesting(), | 262 EXPECT_THAT(builder.PreviewRequestBodyForTesting(), |
263 EqualsJSON("{" | 263 EqualsJSON("{" |
264 " \"priority\": \"BACKGROUND_PREFETCH\"," | 264 " \"priority\": \"BACKGROUND_PREFETCH\"," |
265 " \"excludedSuggestionIds\": []" | 265 " \"excludedSuggestionIds\": []" |
266 "}")); | 266 "}")); |
267 } | 267 } |
268 | 268 |
269 TEST_F(JsonRequestTest, BuildRequestWithTwoLanguages) { | 269 TEST_F(JsonRequestTest, BuildRequestWithTwoLanguages) { |
270 JsonRequest::Builder builder; | 270 JsonRequest::Builder builder; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 " \"topLanguages\": [{" | 314 " \"topLanguages\": [{" |
315 " \"language\" : \"en\"," | 315 " \"language\" : \"en\"," |
316 " \"frequency\" : 1.0" | 316 " \"frequency\" : 1.0" |
317 " }]" | 317 " }]" |
318 "}")); | 318 "}")); |
319 } | 319 } |
320 | 320 |
321 } // namespace internal | 321 } // namespace internal |
322 | 322 |
323 } // namespace ntp_snippets | 323 } // namespace ntp_snippets |
OLD | NEW |