Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/browser/sync/glue/local_device_info_provider_impl.h" | 8 #include "components/sync_driver/local_device_info_provider_impl.h" |
| 9 #include "sync/util/get_session_name.h" | 9 #include "sync/util/get_session_name.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using sync_driver::DeviceInfo; | 12 using sync_driver::DeviceInfo; |
| 13 using sync_driver::LocalDeviceInfoProvider; | 13 using sync_driver::LocalDeviceInfoProvider; |
| 14 | 14 |
| 15 namespace browser_sync { | 15 namespace browser_sync { |
|
stanisc
2015/10/09 17:18:03
Should the namespace change as well?
| |
| 16 | 16 |
| 17 const char kLocalDeviceGuid[] = "foo"; | 17 const char kLocalDeviceGuid[] = "foo"; |
| 18 const char kSigninScopedDeviceId[] = "device_id"; | 18 const char kSigninScopedDeviceId[] = "device_id"; |
| 19 | 19 |
| 20 class LocalDeviceInfoProviderTest : public testing::Test { | 20 class LocalDeviceInfoProviderTest : public testing::Test { |
| 21 public: | 21 public: |
| 22 LocalDeviceInfoProviderTest() | 22 LocalDeviceInfoProviderTest() : called_back_(false) {} |
| 23 : called_back_(false) {} | |
| 24 ~LocalDeviceInfoProviderTest() override {} | 23 ~LocalDeviceInfoProviderTest() override {} |
| 25 | 24 |
| 26 void SetUp() override { provider_.reset(new LocalDeviceInfoProviderImpl()); } | 25 void SetUp() override { provider_.reset(new LocalDeviceInfoProviderImpl()); } |
| 27 | 26 |
| 28 void TearDown() override { | 27 void TearDown() override { |
| 29 provider_.reset(); | 28 provider_.reset(); |
| 30 called_back_ = false; | 29 called_back_ = false; |
| 31 } | 30 } |
| 32 | 31 |
| 33 protected: | 32 protected: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 | 83 |
| 85 TEST_F(LocalDeviceInfoProviderTest, GetLocalSyncCacheGUID) { | 84 TEST_F(LocalDeviceInfoProviderTest, GetLocalSyncCacheGUID) { |
| 86 ASSERT_EQ(std::string(), provider_->GetLocalSyncCacheGUID()); | 85 ASSERT_EQ(std::string(), provider_->GetLocalSyncCacheGUID()); |
| 87 | 86 |
| 88 InitializeProvider(); | 87 InitializeProvider(); |
| 89 | 88 |
| 90 EXPECT_EQ(std::string(kLocalDeviceGuid), provider_->GetLocalSyncCacheGUID()); | 89 EXPECT_EQ(std::string(kLocalDeviceGuid), provider_->GetLocalSyncCacheGUID()); |
| 91 } | 90 } |
| 92 | 91 |
| 93 } // namespace browser_sync | 92 } // namespace browser_sync |
| OLD | NEW |