Commit 58a14a28 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Use TestSyncService in about_sync_util_unittest.cc

Bug: 859874
Change-Id: I7416dee32bd2daf93976f2e63f397a76e9a30b72
Reviewed-on: https://chromium-review.googlesource.com/c/1326006Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606436}
parent b874f30d
...@@ -2,36 +2,21 @@ ...@@ -2,36 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/sync/driver/about_sync_util.h" #include <memory>
#include "components/sync/driver/fake_sync_service.h" #include "base/values.h"
#include "components/sync/engine/sync_status.h" #include "components/sync/driver/about_sync_util.h"
#include "testing/gmock/include/gmock/gmock.h" #include "components/sync/driver/test_sync_service.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace syncer { namespace syncer {
namespace sync_ui_util { namespace sync_ui_util {
namespace { namespace {
class SyncServiceMock : public FakeSyncService {
public:
bool IsFirstSetupComplete() const override { return true; }
int GetDisableReasons() const override {
return DISABLE_REASON_UNRECOVERABLE_ERROR;
}
bool QueryDetailedSyncStatus(SyncStatus* result) const override {
return false;
}
SyncCycleSnapshot GetLastCycleSnapshot() const override {
return SyncCycleSnapshot();
}
};
TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) { TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) {
SyncServiceMock service; TestSyncService service;
service.SetDisableReasons(
syncer::SyncService::DISABLE_REASON_UNRECOVERABLE_ERROR);
std::unique_ptr<base::DictionaryValue> strings( std::unique_ptr<base::DictionaryValue> strings(
ConstructAboutInformation(&service, version_info::Channel::UNKNOWN)); ConstructAboutInformation(&service, version_info::Channel::UNKNOWN));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment