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

Side by Side Diff: chrome/browser/sync/engine/model_safe_worker_unittest.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/engine/model_safe_worker.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/values.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace browser_sync {
12 namespace {
13
14 class ModelSafeWorkerTest : public ::testing::Test {
15 };
16
17 TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToValue) {
18 ModelSafeRoutingInfo routing_info;
19 routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE;
20 routing_info[syncable::NIGORI] = GROUP_UI;
21 routing_info[syncable::PREFERENCES] = GROUP_DB;
22 DictionaryValue expected_value;
23 expected_value.SetString("Bookmarks", "GROUP_PASSIVE");
24 expected_value.SetString("Encryption keys", "GROUP_UI");
25 expected_value.SetString("Preferences", "GROUP_DB");
26 scoped_ptr<DictionaryValue> value(
27 ModelSafeRoutingInfoToValue(routing_info));
28 EXPECT_TRUE(value->Equals(&expected_value));
29 }
30
31 TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToString) {
32 ModelSafeRoutingInfo routing_info;
33 routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE;
34 routing_info[syncable::NIGORI] = GROUP_UI;
35 routing_info[syncable::PREFERENCES] = GROUP_DB;
36 EXPECT_EQ(
37 "{\"Bookmarks\":\"GROUP_PASSIVE\",\"Encryption keys\":\"GROUP_UI\","
38 "\"Preferences\":\"GROUP_DB\"}",
39 ModelSafeRoutingInfoToString(routing_info));
40 }
41
42 TEST_F(ModelSafeWorkerTest, GetRoutingInfoTypes) {
43 ModelSafeRoutingInfo routing_info;
44 routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE;
45 routing_info[syncable::NIGORI] = GROUP_UI;
46 routing_info[syncable::PREFERENCES] = GROUP_DB;
47 const syncable::ModelTypeSet expected_types(
48 syncable::BOOKMARKS,
49 syncable::NIGORI,
50 syncable::PREFERENCES);
51 EXPECT_TRUE(GetRoutingInfoTypes(routing_info).Equals(expected_types));
52 }
53
54 } // namespace
55 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/model_safe_worker.cc ('k') | chrome/browser/sync/engine/net/server_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698