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

Side by Side Diff: components/sync_driver/device_info_sync_service_unittest.cc

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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 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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "components/sync_driver/device_info_sync_service.h" 6 #include "components/sync_driver/device_info_sync_service.h"
7 #include "components/sync_driver/local_device_info_provider_mock.h" 7 #include "components/sync_driver/local_device_info_provider_mock.h"
8 #include "sync/api/sync_change.h" 8 #include "sync/api/sync_change.h"
9 #include "sync/api/sync_change_processor.h" 9 #include "sync/api/sync_change_processor.h"
10 #include "sync/api/sync_change_processor_wrapper_for_test.h" 10 #include "sync/api/sync_change_processor_wrapper_for_test.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 private: 72 private:
73 SyncChangeList change_list_; 73 SyncChangeList change_list_;
74 }; 74 };
75 75
76 class DeviceInfoSyncServiceTest : public testing::Test, 76 class DeviceInfoSyncServiceTest : public testing::Test,
77 public DeviceInfoTracker::Observer { 77 public DeviceInfoTracker::Observer {
78 public: 78 public:
79 DeviceInfoSyncServiceTest() : num_device_info_changed_callbacks_(0) {} 79 DeviceInfoSyncServiceTest() : num_device_info_changed_callbacks_(0) {}
80 virtual ~DeviceInfoSyncServiceTest() {} 80 ~DeviceInfoSyncServiceTest() override {}
81 81
82 virtual void SetUp() override { 82 void SetUp() override {
83 local_device_.reset(new LocalDeviceInfoProviderMock( 83 local_device_.reset(new LocalDeviceInfoProviderMock(
84 "guid_1", 84 "guid_1",
85 "client_1", 85 "client_1",
86 "Chromium 10k", 86 "Chromium 10k",
87 "Chrome 10k", 87 "Chrome 10k",
88 sync_pb::SyncEnums_DeviceType_TYPE_LINUX, 88 sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
89 "device_id")); 89 "device_id"));
90 sync_service_.reset(new DeviceInfoSyncService(local_device_.get())); 90 sync_service_.reset(new DeviceInfoSyncService(local_device_.get()));
91 sync_processor_.reset(new TestChangeProcessor()); 91 sync_processor_.reset(new TestChangeProcessor());
92 // Register observer 92 // Register observer
93 sync_service_->AddObserver(this); 93 sync_service_->AddObserver(this);
94 } 94 }
95 95
96 virtual void TearDown() override { 96 void TearDown() override { sync_service_->RemoveObserver(this); }
97 sync_service_->RemoveObserver(this);
98 }
99 97
100 void OnDeviceInfoChange() override { num_device_info_changed_callbacks_++; } 98 void OnDeviceInfoChange() override { num_device_info_changed_callbacks_++; }
101 99
102 scoped_ptr<SyncChangeProcessor> PassProcessor() { 100 scoped_ptr<SyncChangeProcessor> PassProcessor() {
103 return scoped_ptr<SyncChangeProcessor>( 101 return scoped_ptr<SyncChangeProcessor>(
104 new SyncChangeProcessorWrapperForTest(sync_processor_.get())); 102 new SyncChangeProcessorWrapperForTest(sync_processor_.get()));
105 } 103 }
106 104
107 scoped_ptr<SyncErrorFactory> CreateAndPassSyncErrorFactory() { 105 scoped_ptr<SyncErrorFactory> CreateAndPassSyncErrorFactory() {
108 return scoped_ptr<SyncErrorFactory>(new SyncErrorFactoryMock()); 106 return scoped_ptr<SyncErrorFactory>(new SyncErrorFactoryMock());
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 EXPECT_EQ("client_1", sync_processor_->client_name_at(0)); 542 EXPECT_EQ("client_1", sync_processor_->client_name_at(0));
545 543
546 backup_time = syncer::ProtoTimeToTime( 544 backup_time = syncer::ProtoTimeToTime(
547 sync_processor_->device_info_at(0).backup_timestamp()); 545 sync_processor_->device_info_at(0).backup_timestamp());
548 EXPECT_EQ(6000, backup_time.ToTimeT()); 546 EXPECT_EQ(6000, backup_time.ToTimeT());
549 } 547 }
550 548
551 } // namespace 549 } // namespace
552 550
553 } // namespace sync_driver 551 } // namespace sync_driver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698