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

Side by Side Diff: components/sync/device_info/local_device_info_provider_unittest.cc

Issue 2376123003: [Sync] Move //components/sync to the syncer namespace. (Closed)
Patch Set: Rebase. Created 4 years, 2 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
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/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "components/sync/base/get_session_name.h" 8 #include "components/sync/base/get_session_name.h"
9 #include "components/sync/device_info/local_device_info_provider_impl.h" 9 #include "components/sync/device_info/local_device_info_provider_impl.h"
10 #include "components/version_info/version_info.h" 10 #include "components/version_info/version_info.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 using sync_driver::DeviceInfo; 13 namespace syncer {
14 using sync_driver::LocalDeviceInfoProvider;
15
16 namespace browser_sync {
17 14
18 const char kLocalDeviceGuid[] = "foo"; 15 const char kLocalDeviceGuid[] = "foo";
19 const char kSigninScopedDeviceId[] = "device_id"; 16 const char kSigninScopedDeviceId[] = "device_id";
20 17
21 class LocalDeviceInfoProviderTest : public testing::Test { 18 class LocalDeviceInfoProviderTest : public testing::Test {
22 public: 19 public:
23 LocalDeviceInfoProviderTest() : called_back_(false) {} 20 LocalDeviceInfoProviderTest() : called_back_(false) {}
24 ~LocalDeviceInfoProviderTest() override {} 21 ~LocalDeviceInfoProviderTest() override {}
25 22
26 void SetUp() override { 23 void SetUp() override {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo()); 80 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo());
84 StartInitializeProvider(); 81 StartInitializeProvider();
85 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo()); 82 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo());
86 FinishInitializeProvider(); 83 FinishInitializeProvider();
87 84
88 const DeviceInfo* local_device_info = provider_->GetLocalDeviceInfo(); 85 const DeviceInfo* local_device_info = provider_->GetLocalDeviceInfo();
89 ASSERT_NE(nullptr, local_device_info); 86 ASSERT_NE(nullptr, local_device_info);
90 EXPECT_EQ(std::string(kLocalDeviceGuid), local_device_info->guid()); 87 EXPECT_EQ(std::string(kLocalDeviceGuid), local_device_info->guid());
91 EXPECT_EQ(std::string(kSigninScopedDeviceId), 88 EXPECT_EQ(std::string(kSigninScopedDeviceId),
92 local_device_info->signin_scoped_device_id()); 89 local_device_info->signin_scoped_device_id());
93 EXPECT_EQ(syncer::GetSessionNameSynchronouslyForTesting(), 90 EXPECT_EQ(GetSessionNameSynchronouslyForTesting(),
94 local_device_info->client_name()); 91 local_device_info->client_name());
95 92
96 EXPECT_EQ(provider_->GetSyncUserAgent(), 93 EXPECT_EQ(provider_->GetSyncUserAgent(),
97 local_device_info->sync_user_agent()); 94 local_device_info->sync_user_agent());
98 95
99 provider_->Clear(); 96 provider_->Clear();
100 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo()); 97 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo());
101 } 98 }
102 99
103 TEST_F(LocalDeviceInfoProviderTest, GetLocalSyncCacheGUID) { 100 TEST_F(LocalDeviceInfoProviderTest, GetLocalSyncCacheGUID) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo()); 133 ASSERT_EQ(nullptr, provider_->GetLocalDeviceInfo());
137 EXPECT_EQ(guid2, provider_->GetLocalSyncCacheGUID()); 134 EXPECT_EQ(guid2, provider_->GetLocalSyncCacheGUID());
138 135
139 FinishInitializeProvider(); 136 FinishInitializeProvider();
140 const DeviceInfo* local_device_info = provider_->GetLocalDeviceInfo(); 137 const DeviceInfo* local_device_info = provider_->GetLocalDeviceInfo();
141 ASSERT_NE(nullptr, local_device_info); 138 ASSERT_NE(nullptr, local_device_info);
142 EXPECT_EQ(guid2, local_device_info->guid()); 139 EXPECT_EQ(guid2, local_device_info->guid());
143 EXPECT_EQ(guid2, provider_->GetLocalSyncCacheGUID()); 140 EXPECT_EQ(guid2, provider_->GetLocalSyncCacheGUID());
144 } 141 }
145 142
146 } // namespace browser_sync 143 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/device_info/local_device_info_provider_mock.cc ('k') | components/sync/driver/about_sync_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698