diff options
author | newt <newt@chromium.org> | 2014-09-24 13:55:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-24 20:55:21 +0000 |
commit | 673cc76103079eaada968c537c6605dbaf8d909c (patch) | |
tree | 917f3e2c7bd454ac46457d154d6ef0d80db9d2b3 /components/search_provider_logos/logo_tracker_unittest.cc | |
parent | f53a0a3b2be14a0a56234b2d984ccc4043ec4283 (diff) | |
download | chromium_src-673cc76103079eaada968c537c6605dbaf8d909c.zip chromium_src-673cc76103079eaada968c537c6605dbaf8d909c.tar.gz chromium_src-673cc76103079eaada968c537c6605dbaf8d909c.tar.bz2 |
Fix doodle verification URL.
When verifying that the cached doodle is still valid, we load the doodle
URL and append the query param "async=es_dfp:<fingerprint>". Previously,
the ":" was being escape to "%3A", causing the server to respond with a
400 error. This mollifies the server by keeping the colon unescaped.
BUG=413845
Review URL: https://codereview.chromium.org/587943003
Cr-Commit-Position: refs/heads/master@{#296512}
Diffstat (limited to 'components/search_provider_logos/logo_tracker_unittest.cc')
-rw-r--r-- | components/search_provider_logos/logo_tracker_unittest.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/components/search_provider_logos/logo_tracker_unittest.cc b/components/search_provider_logos/logo_tracker_unittest.cc index c32df2a..84f8a22 100644 --- a/components/search_provider_logos/logo_tracker_unittest.cc +++ b/components/search_provider_logos/logo_tracker_unittest.cc @@ -371,8 +371,7 @@ void LogoTrackerTest::SetServerResponseWhenFingerprint( const std::string& response_when_fingerprint, net::URLRequestStatus::Status request_status, net::HttpStatusCode response_code) { - GURL url_with_fp = - net::AppendQueryParameter(logo_url_, "async", "es_dfp:" + fingerprint); + GURL url_with_fp = GoogleAppendFingerprintToLogoURL(logo_url_, fingerprint); fake_url_fetcher_factory_.SetFakeResponse( url_with_fp, response_when_fingerprint, response_code, request_status); } @@ -384,6 +383,16 @@ void LogoTrackerTest::GetLogo() { // Tests ----------------------------------------------------------------------- +TEST_F(LogoTrackerTest, FingerprintURLHasColon) { + GURL url_with_fp = GoogleAppendFingerprintToLogoURL( + GURL("http://logourl.com/path"), "abc123"); + EXPECT_EQ("http://logourl.com/path?async=es_dfp:abc123", url_with_fp.spec()); + + url_with_fp = GoogleAppendFingerprintToLogoURL( + GURL("http://logourl.com/?a=b"), "cafe0"); + EXPECT_EQ("http://logourl.com/?a=b&async=es_dfp:cafe0", url_with_fp.spec()); +} + TEST_F(LogoTrackerTest, DownloadAndCacheLogo) { Logo logo = GetSampleLogo(logo_url_, test_clock_->Now()); SetServerResponse(ServerResponse(logo)); |