summaryrefslogtreecommitdiffstats
path: root/sync/syncable/entry_kernel_unittest.cc
blob: 55563d5285d3c276d3fa291ee5924e0771ea1a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "sync/syncable/entry_kernel.h"

#include "testing/gtest/include/gtest/gtest.h"

namespace syncer {

namespace syncable {

class EntryKernelTest : public testing::Test {};

TEST_F(EntryKernelTest, ToValue) {
  EntryKernel kernel;
  scoped_ptr<base::DictionaryValue> value(kernel.ToValue(NULL));
  if (value) {
    // Not much to check without repeating the ToValue() code.
    EXPECT_TRUE(value->HasKey("isDirty"));
    // The extra +2 is for "isDirty" and "serverModelType".
    EXPECT_EQ(BIT_TEMPS_END - BEGIN_FIELDS + 2,
              static_cast<int>(value->size()));
  } else {
    ADD_FAILURE();
  }
}

}  // namespace syncable

}  // namespace syncer