Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: sync/internal_api/public/engine/model_safe_worker_unittest.cc

Issue 10690071: [Sync] Move model_type* from syncable/ to base/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/internal_api/public/engine/model_safe_worker.h" 5 #include "sync/internal_api/public/engine/model_safe_worker.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE; 44 routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE;
45 routing_info[syncable::NIGORI] = GROUP_UI; 45 routing_info[syncable::NIGORI] = GROUP_UI;
46 routing_info[syncable::PREFERENCES] = GROUP_DB; 46 routing_info[syncable::PREFERENCES] = GROUP_DB;
47 const syncable::ModelTypeSet expected_types( 47 const syncable::ModelTypeSet expected_types(
48 syncable::BOOKMARKS, 48 syncable::BOOKMARKS,
49 syncable::NIGORI, 49 syncable::NIGORI,
50 syncable::PREFERENCES); 50 syncable::PREFERENCES);
51 EXPECT_TRUE(GetRoutingInfoTypes(routing_info).Equals(expected_types)); 51 EXPECT_TRUE(GetRoutingInfoTypes(routing_info).Equals(expected_types));
52 } 52 }
53 53
54 TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToPayloadMap) {
55 std::string payload = "test";
56 ModelSafeRoutingInfo routing_info;
57 routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE;
58 routing_info[syncable::NIGORI] = GROUP_UI;
59 routing_info[syncable::PREFERENCES] = GROUP_DB;
60 syncable::ModelTypePayloadMap types_with_payloads =
61 ModelSafeRoutingInfoToPayloadMap(routing_info, payload);
62 ASSERT_EQ(routing_info.size(), types_with_payloads.size());
63 for (ModelSafeRoutingInfo::iterator iter = routing_info.begin();
64 iter != routing_info.end();
65 ++iter) {
66 EXPECT_EQ(payload, types_with_payloads[iter->first]);
67 }
68 }
69
54 } // namespace 70 } // namespace
55 } // namespace syncer 71 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/engine/model_safe_worker.cc ('k') | sync/internal_api/public/engine/sync_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698