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

Side by Side Diff: components/search_provider_logos/logo_tracker_unittest.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « components/search_provider_logos/logo_cache.cc ('k') | components/webcrypto/jwk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/search_provider_logos/logo_tracker.h" 5 #include "components/search_provider_logos/logo_tracker.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (!animated_url.empty()) 132 if (!animated_url.empty())
133 dict.SetString("update.logo.url", animated_url); 133 dict.SetString("update.logo.url", animated_url);
134 if (!mime_type.empty()) 134 if (!mime_type.empty())
135 dict.SetString("update.logo.mime_type", mime_type); 135 dict.SetString("update.logo.mime_type", mime_type);
136 dict.SetString("update.logo.fingerprint", fingerprint); 136 dict.SetString("update.logo.fingerprint", fingerprint);
137 if (time_to_live.ToInternalValue() != 0) 137 if (time_to_live.ToInternalValue() != 0)
138 dict.SetInteger("update.logo.time_to_live", 138 dict.SetInteger("update.logo.time_to_live",
139 static_cast<int>(time_to_live.InMilliseconds())); 139 static_cast<int>(time_to_live.InMilliseconds()));
140 140
141 std::string output; 141 std::string output;
142 base::JSONWriter::Write(&dict, &output); 142 base::JSONWriter::Write(dict, &output);
143 return output; 143 return output;
144 } 144 }
145 145
146 std::string MakeServerResponse(const Logo& logo, base::TimeDelta time_to_live) { 146 std::string MakeServerResponse(const Logo& logo, base::TimeDelta time_to_live) {
147 return MakeServerResponse(logo.image, 147 return MakeServerResponse(logo.image,
148 logo.metadata.on_click_url, 148 logo.metadata.on_click_url,
149 logo.metadata.alt_text, 149 logo.metadata.alt_text,
150 logo.metadata.animated_url, 150 logo.metadata.animated_url,
151 logo.metadata.mime_type, 151 logo.metadata.mime_type,
152 logo.metadata.fingerprint, 152 logo.metadata.fingerprint,
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 MockLogoObserver listener2; 733 MockLogoObserver listener2;
734 listener2.ExpectFreshLogo(&logo); 734 listener2.ExpectFreshLogo(&logo);
735 logo_tracker_->GetLogo(&listener2); 735 logo_tracker_->GetLogo(&listener2);
736 736
737 base::RunLoop().RunUntilIdle(); 737 base::RunLoop().RunUntilIdle();
738 } 738 }
739 739
740 } // namespace 740 } // namespace
741 741
742 } // namespace search_provider_logos 742 } // namespace search_provider_logos
OLDNEW
« no previous file with comments | « components/search_provider_logos/logo_cache.cc ('k') | components/webcrypto/jwk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698