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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.cc

Issue 1943783002: [NTP Snippets] Add unit tests for NTPSnippetsFetcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce FailingFakeURLFetcherFactory to avoid null pointers. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/ntp_snippets_fetcher.cc
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.cc b/components/ntp_snippets/ntp_snippets_fetcher.cc
index 2cb82135958e12b116cb883a50fef15634f8b8c3..89d26f7810f129fd1eae9449bbcd0405a564b372 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/ntp_snippets_fetcher.cc
@@ -86,13 +86,13 @@ NTPSnippetsFetcher::AddCallback(const SnippetsAvailableCallback& callback) {
void NTPSnippetsFetcher::FetchSnippets(const std::set<std::string>& hosts,
int count) {
- // TODO(treib): What to do if there's already a pending request?
const std::string& key = is_stable_channel_
? google_apis::GetAPIKey()
: google_apis::GetNonStableAPIKey();
std::string url =
base::StringPrintf(kContentSnippetsServerFormat, key.c_str());
url_fetcher_ = URLFetcher::Create(GURL(url), URLFetcher::POST, this);
+ CHECK(url_fetcher_ != nullptr);
Marc Treib 2016/05/03 11:33:42 DCHECK please (DCHECKS are enabled on all the bots
mastiz 2016/05/03 11:48:57 Done. Removed, as discussed offline.
url_fetcher_->SetRequestContext(url_request_context_getter_.get());
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);

Powered by Google App Engine
This is Rietveld 408576698