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

Unified Diff: chrome/browser/local_discovery/privet_url_fetcher_unittest.cc

Issue 215573003: Send an empty Privet token with /privet/info always (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « chrome/browser/local_discovery/privet_url_fetcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/privet_url_fetcher_unittest.cc
diff --git a/chrome/browser/local_discovery/privet_url_fetcher_unittest.cc b/chrome/browser/local_discovery/privet_url_fetcher_unittest.cc
index 2737755a00d810fc9bd92f487e08c73c00dd90bc..bfa78a75084cb62997a99c224db8cb32b27d9a42 100644
--- a/chrome/browser/local_discovery/privet_url_fetcher_unittest.cc
+++ b/chrome/browser/local_discovery/privet_url_fetcher_unittest.cc
@@ -209,7 +209,24 @@ TEST_F(PrivetURLFetcherTest, Header2) {
PrivetURLFetcher::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
"");
- privet_urlfetcher_->AllowEmptyPrivetToken();
+ privet_urlfetcher_->SendEmptyPrivetToken();
+ privet_urlfetcher_->Start();
+
+ net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
+ ASSERT_TRUE(fetcher != NULL);
+ net::HttpRequestHeaders headers;
+ fetcher->GetExtraRequestHeaders(&headers);
+
+ std::string header_token;
+ ASSERT_TRUE(headers.GetHeader("X-Privet-Token", &header_token));
+ EXPECT_EQ(kEmptyPrivetToken, header_token);
+}
+
+TEST_F(PrivetURLFetcherTest, AlwaysSendEmpty) {
+ PrivetURLFetcher::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
+ "SampleToken");
+
+ privet_urlfetcher_->SendEmptyPrivetToken();
privet_urlfetcher_->Start();
net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
« no previous file with comments | « chrome/browser/local_discovery/privet_url_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698