| 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 "chrome/browser/sync/glue/local_device_info_provider_impl.h" | 
| 9 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" | 
| 10 #include "sync/util/get_session_name.h" | 10 #include "sync/util/get_session_name.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 using sync_driver::DeviceInfo; | 
| 14 using sync_driver::LocalDeviceInfoProvider; | 14 using sync_driver::LocalDeviceInfoProvider; | 
| 15 | 15 | 
| 16 namespace browser_sync { | 16 namespace browser_sync { | 
| 17 | 17 | 
| 18 const char kLocalDeviceGuid[] = "foo"; | 18 const char kLocalDeviceGuid[] = "foo"; | 
| 19 const char kSigninScopedDeviceId[] = "device_id"; | 19 const char kSigninScopedDeviceId[] = "device_id"; | 
| 20 | 20 | 
| 21 class LocalDeviceInfoProviderTest : public testing::Test { | 21 class LocalDeviceInfoProviderTest : public testing::Test { | 
| 22  public: | 22  public: | 
| 23   LocalDeviceInfoProviderTest() | 23   LocalDeviceInfoProviderTest() | 
| 24     : called_back_(false) {} | 24     : called_back_(false) {} | 
| 25   virtual ~LocalDeviceInfoProviderTest() {} | 25   virtual ~LocalDeviceInfoProviderTest() {} | 
| 26 | 26 | 
| 27   virtual void SetUp() OVERRIDE { | 27   virtual void SetUp() override { | 
| 28     provider_.reset(new LocalDeviceInfoProviderImpl()); | 28     provider_.reset(new LocalDeviceInfoProviderImpl()); | 
| 29   } | 29   } | 
| 30 | 30 | 
| 31   virtual void TearDown() OVERRIDE { | 31   virtual void TearDown() override { | 
| 32     provider_.reset(); | 32     provider_.reset(); | 
| 33     called_back_ = false; | 33     called_back_ = false; | 
| 34   } | 34   } | 
| 35 | 35 | 
| 36  protected: | 36  protected: | 
| 37   void InitializeProvider() { | 37   void InitializeProvider() { | 
| 38     // Start initialization. | 38     // Start initialization. | 
| 39     provider_->Initialize(kLocalDeviceGuid, kSigninScopedDeviceId); | 39     provider_->Initialize(kLocalDeviceGuid, kSigninScopedDeviceId); | 
| 40 | 40 | 
| 41     // Subscribe to the notification and wait until the callback | 41     // Subscribe to the notification and wait until the callback | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 89 | 89 | 
| 90 TEST_F(LocalDeviceInfoProviderTest, GetLocalSyncCacheGUID) { | 90 TEST_F(LocalDeviceInfoProviderTest, GetLocalSyncCacheGUID) { | 
| 91   ASSERT_EQ(std::string(), provider_->GetLocalSyncCacheGUID()); | 91   ASSERT_EQ(std::string(), provider_->GetLocalSyncCacheGUID()); | 
| 92 | 92 | 
| 93   InitializeProvider(); | 93   InitializeProvider(); | 
| 94 | 94 | 
| 95   EXPECT_EQ(std::string(kLocalDeviceGuid), provider_->GetLocalSyncCacheGUID()); | 95   EXPECT_EQ(std::string(kLocalDeviceGuid), provider_->GetLocalSyncCacheGUID()); | 
| 96 } | 96 } | 
| 97 | 97 | 
| 98 }  // namespace browser_sync | 98 }  // namespace browser_sync | 
| OLD | NEW | 
|---|