| 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 "sync/syncable/syncable_id.h" | 5 #include "sync/syncable/syncable_id.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/test/values_test_util.h" | 10 #include "base/test/values_test_util.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "sync/test/engine/test_id_factory.h" | 12 #include "sync/test/engine/test_id_factory.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 using std::vector; | 15 using std::vector; |
| 16 | 16 |
| 17 namespace syncer { |
| 17 namespace syncable { | 18 namespace syncable { |
| 18 | 19 |
| 19 using syncer::TestIdFactory; | 20 using syncer::TestIdFactory; |
| 20 | 21 |
| 21 class SyncableIdTest : public testing::Test { }; | 22 class SyncableIdTest : public testing::Test { }; |
| 22 | 23 |
| 23 TEST(SyncableIdTest, TestIDCreation) { | 24 TEST(SyncableIdTest, TestIDCreation) { |
| 24 vector<Id> v; | 25 vector<Id> v; |
| 25 v.push_back(TestIdFactory::FromNumber(5)); | 26 v.push_back(TestIdFactory::FromNumber(5)); |
| 26 v.push_back(TestIdFactory::FromNumber(1)); | 27 v.push_back(TestIdFactory::FromNumber(1)); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 TEST(SyncableIdTest, ToValue) { | 88 TEST(SyncableIdTest, ToValue) { |
| 88 base::ExpectStringValue("r", Id::CreateFromServerId("0").ToValue()); | 89 base::ExpectStringValue("r", Id::CreateFromServerId("0").ToValue()); |
| 89 base::ExpectStringValue("svalue", Id::CreateFromServerId("value").ToValue()); | 90 base::ExpectStringValue("svalue", Id::CreateFromServerId("value").ToValue()); |
| 90 | 91 |
| 91 base::ExpectStringValue("r", Id::CreateFromClientString("0").ToValue()); | 92 base::ExpectStringValue("r", Id::CreateFromClientString("0").ToValue()); |
| 92 base::ExpectStringValue("cvalue", | 93 base::ExpectStringValue("cvalue", |
| 93 Id::CreateFromClientString("value").ToValue()); | 94 Id::CreateFromClientString("value").ToValue()); |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace syncable | 97 } // namespace syncable |
| 98 } // namespace syncer |
| OLD | NEW |