| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/sessions/session_state.h" | 5 #include "chrome/browser/sync/sessions/session_state.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/test/values_test_util.h" |
| 11 #include "base/time.h" | 12 #include "base/time.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "chrome/test/base/values_test_util.h" | |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace browser_sync { | 16 namespace browser_sync { |
| 17 namespace sessions { | 17 namespace sessions { |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 using test::ExpectDictBooleanValue; | 20 using base::ExpectDictBooleanValue; |
| 21 using test::ExpectDictDictionaryValue; | 21 using base::ExpectDictDictionaryValue; |
| 22 using test::ExpectDictIntegerValue; | 22 using base::ExpectDictIntegerValue; |
| 23 using test::ExpectDictListValue; | 23 using base::ExpectDictListValue; |
| 24 using test::ExpectDictStringValue; | 24 using base::ExpectDictStringValue; |
| 25 | 25 |
| 26 class SessionStateTest : public testing::Test {}; | 26 class SessionStateTest : public testing::Test {}; |
| 27 | 27 |
| 28 TEST_F(SessionStateTest, SyncSourceInfoToValue) { | 28 TEST_F(SessionStateTest, SyncSourceInfoToValue) { |
| 29 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source = | 29 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source = |
| 30 sync_pb::GetUpdatesCallerInfo::PERIODIC; | 30 sync_pb::GetUpdatesCallerInfo::PERIODIC; |
| 31 syncable::ModelTypePayloadMap types; | 31 syncable::ModelTypePayloadMap types; |
| 32 types[syncable::PREFERENCES] = "preferencespayload"; | 32 types[syncable::PREFERENCES] = "preferencespayload"; |
| 33 types[syncable::EXTENSIONS] = ""; | 33 types[syncable::EXTENSIONS] = ""; |
| 34 scoped_ptr<DictionaryValue> expected_types_value( | 34 scoped_ptr<DictionaryValue> expected_types_value( |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 ExpectDictIntegerValue(kNumConflictingUpdates, *value, | 173 ExpectDictIntegerValue(kNumConflictingUpdates, *value, |
| 174 "numConflictingUpdates"); | 174 "numConflictingUpdates"); |
| 175 ExpectDictBooleanValue(kDidCommitItems, *value, | 175 ExpectDictBooleanValue(kDidCommitItems, *value, |
| 176 "didCommitItems"); | 176 "didCommitItems"); |
| 177 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); | 177 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace | 180 } // namespace |
| 181 } // namespace sessions | 181 } // namespace sessions |
| 182 } // namespace browser_sync | 182 } // namespace browser_sync |
| OLD | NEW |