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

Side by Side Diff: sync/sessions/nudge_tracker_unittest.cc

Issue 1539843002: Convert Pass()→std::move() in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up Created 4 years, 12 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 | « sync/sessions/nudge_tracker.cc ('k') | sync/syncable/directory.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 (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/sessions/nudge_tracker.h" 5 #include "sync/sessions/nudge_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9
10 #include <string> 9 #include <string>
10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "sync/internal_api/public/base/model_type_test_util.h" 15 #include "sync/internal_api/public/base/model_type_test_util.h"
16 #include "sync/test/mock_invalidation.h" 16 #include "sync/test/mock_invalidation.h"
17 #include "sync/test/mock_invalidation_tracker.h" 17 #include "sync/test/mock_invalidation_tracker.h"
18 #include "sync/test/trackable_mock_invalidation.h" 18 #include "sync/test/trackable_mock_invalidation.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 20
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 return tracker_.IsDropped(tracking_id); 834 return tracker_.IsDropped(tracking_id);
835 } 835 }
836 836
837 int SendInvalidation(ModelType type, int version, const std::string& hint) { 837 int SendInvalidation(ModelType type, int version, const std::string& hint) {
838 // Build and register the invalidation. 838 // Build and register the invalidation.
839 scoped_ptr<TrackableMockInvalidation> inv = 839 scoped_ptr<TrackableMockInvalidation> inv =
840 tracker_.IssueInvalidation(version, hint); 840 tracker_.IssueInvalidation(version, hint);
841 int id = inv->GetTrackingId(); 841 int id = inv->GetTrackingId();
842 842
843 // Send it to the NudgeTracker. 843 // Send it to the NudgeTracker.
844 nudge_tracker_.RecordRemoteInvalidation(type, inv.Pass()); 844 nudge_tracker_.RecordRemoteInvalidation(type, std::move(inv));
845 845
846 // Return its ID to the test framework for use in assertions. 846 // Return its ID to the test framework for use in assertions.
847 return id; 847 return id;
848 } 848 }
849 849
850 int SendUnknownVersionInvalidation(ModelType type) { 850 int SendUnknownVersionInvalidation(ModelType type) {
851 // Build and register the invalidation. 851 // Build and register the invalidation.
852 scoped_ptr<TrackableMockInvalidation> inv = 852 scoped_ptr<TrackableMockInvalidation> inv =
853 tracker_.IssueUnknownVersionInvalidation(); 853 tracker_.IssueUnknownVersionInvalidation();
854 int id = inv->GetTrackingId(); 854 int id = inv->GetTrackingId();
855 855
856 // Send it to the NudgeTracker. 856 // Send it to the NudgeTracker.
857 nudge_tracker_.RecordRemoteInvalidation(type, inv.Pass()); 857 nudge_tracker_.RecordRemoteInvalidation(type, std::move(inv));
858 858
859 // Return its ID to the test framework for use in assertions. 859 // Return its ID to the test framework for use in assertions.
860 return id; 860 return id;
861 } 861 }
862 862
863 bool AllInvalidationsAccountedFor() const { 863 bool AllInvalidationsAccountedFor() const {
864 return tracker_.AllInvalidationsAccountedFor(); 864 return tracker_.AllInvalidationsAccountedFor();
865 } 865 }
866 866
867 void RecordSuccessfulSyncCycle() { 867 void RecordSuccessfulSyncCycle() {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id)); 972 EXPECT_TRUE(IsInvalidationAcknowledged(inv2_id));
973 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id)); 973 EXPECT_TRUE(IsInvalidationAcknowledged(inv3_id));
974 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id)); 974 EXPECT_TRUE(IsInvalidationAcknowledged(inv4_id));
975 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id)); 975 EXPECT_TRUE(IsInvalidationAcknowledged(inv5_id));
976 976
977 EXPECT_TRUE(AllInvalidationsAccountedFor()); 977 EXPECT_TRUE(AllInvalidationsAccountedFor());
978 } 978 }
979 979
980 } // namespace sessions 980 } // namespace sessions
981 } // namespace syncer 981 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/sessions/nudge_tracker.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698