OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/syncable/model_type_payload_map.h" | 5 #include "chrome/browser/sync/syncable/model_type_payload_map.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/test/values_test_util.h" | 11 #include "chrome/test/base/values_test_util.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace syncable { | 14 namespace syncable { |
15 namespace { | 15 namespace { |
16 | 16 |
17 using test::ExpectDictStringValue; | 17 using test::ExpectDictStringValue; |
18 | 18 |
19 class ModelTypePayloadMapTest : public testing::Test {}; | 19 class ModelTypePayloadMapTest : public testing::Test {}; |
20 | 20 |
21 TEST_F(ModelTypePayloadMapTest, TypePayloadMapToValue) { | 21 TEST_F(ModelTypePayloadMapTest, TypePayloadMapToValue) { |
22 ModelTypePayloadMap payloads; | 22 ModelTypePayloadMap payloads; |
23 payloads[syncable::BOOKMARKS] = "bookmarkpayload"; | 23 payloads[syncable::BOOKMARKS] = "bookmarkpayload"; |
24 payloads[syncable::APPS] = ""; | 24 payloads[syncable::APPS] = ""; |
25 | 25 |
26 scoped_ptr<DictionaryValue> value(ModelTypePayloadMapToValue(payloads)); | 26 scoped_ptr<DictionaryValue> value(ModelTypePayloadMapToValue(payloads)); |
27 EXPECT_EQ(2u, value->size()); | 27 EXPECT_EQ(2u, value->size()); |
28 ExpectDictStringValue("bookmarkpayload", *value, "Bookmarks"); | 28 ExpectDictStringValue("bookmarkpayload", *value, "Bookmarks"); |
29 ExpectDictStringValue("", *value, "Apps"); | 29 ExpectDictStringValue("", *value, "Apps"); |
30 EXPECT_FALSE(value->HasKey("Preferences")); | 30 EXPECT_FALSE(value->HasKey("Preferences")); |
31 } | 31 } |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 } // namespace syncable | 34 } // namespace syncable |
OLD | NEW |