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

Side by Side Diff: sync/internal_api/public/base/unique_position_unittest.cc

Issue 86913002: Make base::Base64Encode() return void (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more chromeos-specific fix. Created 7 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/internal_api/public/base/unique_position.h" 5 #include "sync/internal_api/public/base/unique_position.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 : cache_guid_(cache_guid), 385 : cache_guid_(cache_guid),
386 next_id_(-65535) { 386 next_id_(-65535) {
387 } 387 }
388 388
389 std::string NextSuffix() { 389 std::string NextSuffix() {
390 // This is not entirely realistic, but that should be OK. The current 390 // This is not entirely realistic, but that should be OK. The current
391 // suffix format is a base64'ed SHA1 hash, which should be fairly close to 391 // suffix format is a base64'ed SHA1 hash, which should be fairly close to
392 // random anyway. 392 // random anyway.
393 std::string input = cache_guid_ + base::Int64ToString(next_id_--); 393 std::string input = cache_guid_ + base::Int64ToString(next_id_--);
394 std::string output; 394 std::string output;
395 CHECK(base::Base64Encode(base::SHA1HashString(input), &output)); 395 base::Base64Encode(base::SHA1HashString(input), &output);
396 return output; 396 return output;
397 } 397 }
398 398
399 private: 399 private:
400 const std::string cache_guid_; 400 const std::string cache_guid_;
401 int64 next_id_; 401 int64 next_id_;
402 }; 402 };
403 403
404 // Cache guids generated in the same style as real clients. 404 // Cache guids generated in the same style as real clients.
405 static const char kCacheGuidStr1[] = "tuiWdG8hV+8y4RT9N5Aikg=="; 405 static const char kCacheGuidStr1[] = "tuiWdG8hV+8y4RT9N5Aikg==";
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 // This requires values in the test harness to be hard-coded in ascending order. 671 // This requires values in the test harness to be hard-coded in ascending order.
672 TEST_F(CompressedPositionTest, OrderingTest) { 672 TEST_F(CompressedPositionTest, OrderingTest) {
673 for (size_t i = 0; i < positions_.size()-1; ++i) { 673 for (size_t i = 0; i < positions_.size()-1; ++i) {
674 EXPECT_PRED_FORMAT2(LessThan, positions_[i], positions_[i+1]); 674 EXPECT_PRED_FORMAT2(LessThan, positions_[i], positions_[i+1]);
675 } 675 }
676 } 676 }
677 677
678 } // namespace 678 } // namespace
679 679
680 } // namespace syncer 680 } // namespace syncer
OLDNEW
« no previous file with comments | « remoting/protocol/v2_authenticator.cc ('k') | sync/internal_api/sync_encryption_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698