Restore variadic macros in DevToolsEmbedderMessageDispatcher
[chromium-blink-merge.git] / components / sync_driver / about_sync_util_unittest.cc
blob47edbf1834f45a079949b70407be64189c7274ea
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/strings/utf_string_conversions.h"
6 #include "components/sync_driver/about_sync_util.h"
7 #include "components/sync_driver/fake_sync_service.h"
8 #include "components/version_info/version_info.h"
9 #include "sync/internal_api/public/engine/sync_status.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 using ::testing::NiceMock;
14 using ::testing::Return;
15 using ::testing::_;
17 namespace sync_driver {
18 namespace sync_ui_util {
19 namespace {
21 class SyncServiceMock : public sync_driver::FakeSyncService {
22 public:
23 bool HasSyncSetupCompleted() const override {
24 return true;
27 bool HasUnrecoverableError() const override {
28 return true;
31 bool QueryDetailedSyncStatus(syncer::SyncStatus* result) override {
32 return false;
35 base::string16 GetLastSyncedTimeString() const override {
36 return base::string16(base::ASCIIToUTF16("none"));
39 syncer::sessions::SyncSessionSnapshot GetLastSessionSnapshot()
40 const override {
41 return syncer::sessions::SyncSessionSnapshot();
45 TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) {
46 SyncServiceMock service;
48 scoped_ptr<base::DictionaryValue> strings(
49 ConstructAboutInformation(&service, NULL,
50 version_info::Channel::UNKNOWN));
52 EXPECT_TRUE(strings->HasKey("unrecoverable_error_detected"));
55 } // namespace
56 } // namespace sync_ui_util
57 } // namespace sync_driver