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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc

Issue 2520843002: [NTP] Cleanup: add brackets in components/ntp_snippets. [1/2] (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/remote/ntp_snippets_fetcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc
diff --git a/components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc b/components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc
index a188e3c5aef9a57a474d79fa4cd1c363bc6409ba..dedc24dd9edb7cf16a1b17fde375d8c3071fe01a 100644
--- a/components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc
+++ b/components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc
@@ -174,10 +174,11 @@ void ParseJson(
const ntp_snippets::NTPSnippetsFetcher::ErrorCallback& error_callback) {
base::JSONReader json_reader;
std::unique_ptr<base::Value> value = json_reader.ReadToValue(json);
- if (value)
+ if (value) {
success_callback.Run(std::move(value));
- else
+ } else {
error_callback.Run(json_reader.GetErrorMessage());
+ }
}
void ParseJsonDelayed(
@@ -247,8 +248,9 @@ class NTPSnippetsFetcherTest : public testing::Test {
}
void InitFakeURLFetcherFactory() {
- if (fake_url_fetcher_factory_)
+ if (fake_url_fetcher_factory_) {
return;
+ }
// Instantiation of factory automatically sets itself as URLFetcher's
// factory.
fake_url_fetcher_factory_.reset(new net::FakeURLFetcherFactory(
@@ -411,8 +413,9 @@ TEST_F(NTPSnippetsFetcherTest, BuildRequestExcludedIds) {
NTPSnippetsFetcher::RequestBuilder builder;
builder.params = test_params();
builder.params.interactive_request = false;
- for (int i = 0; i < 200; ++i)
+ for (int i = 0; i < 200; ++i) {
builder.params.excluded_ids.insert(base::StringPrintf("%03d", i));
+ }
builder.only_return_personalized_results = false;
builder.user_class = "ACTIVE_NTP_USER";
« no previous file with comments | « components/ntp_snippets/remote/ntp_snippets_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698