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 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <map> | 10 #include <map> |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 } | 1198 } |
1199 | 1199 |
1200 { | 1200 { |
1201 ListValue args; | 1201 ListValue args; |
1202 args.Append(Value::CreateStringValue("9999")); | 1202 args.Append(Value::CreateStringValue("9999")); |
1203 SendJsMessage("getChildNodeIds", | 1203 SendJsMessage("getChildNodeIds", |
1204 JsArgList(&args), reply_handler.AsWeakHandle()); | 1204 JsArgList(&args), reply_handler.AsWeakHandle()); |
1205 } | 1205 } |
1206 } | 1206 } |
1207 | 1207 |
1208 // TODO(akalin): Add unit tests for findNodesContainingString message. | 1208 // TODO(rlarocque): Add unit tests for getAllNodes message. |
1209 | 1209 |
1210 TEST_F(SyncManagerTest, OnNotificationStateChange) { | 1210 TEST_F(SyncManagerTest, OnNotificationStateChange) { |
1211 InSequence dummy; | 1211 InSequence dummy; |
1212 StrictMock<MockJsEventHandler> event_handler; | 1212 StrictMock<MockJsEventHandler> event_handler; |
1213 | 1213 |
1214 DictionaryValue true_details; | 1214 DictionaryValue true_details; |
1215 true_details.SetBoolean("enabled", true); | 1215 true_details.SetBoolean("enabled", true); |
1216 DictionaryValue false_details; | 1216 DictionaryValue false_details; |
1217 false_details.SetBoolean("enabled", false); | 1217 false_details.SetBoolean("enabled", false); |
1218 | 1218 |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2434 EXPECT_EQ(title, node.GetTitle()); | 2434 EXPECT_EQ(title, node.GetTitle()); |
2435 EXPECT_EQ(GURL(url2), node.GetURL()); | 2435 EXPECT_EQ(GURL(url2), node.GetURL()); |
2436 const syncable::Entry* node_entry = node.GetEntry(); | 2436 const syncable::Entry* node_entry = node.GetEntry(); |
2437 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); | 2437 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); |
2438 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); | 2438 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); |
2439 EXPECT_TRUE(specifics.has_encrypted()); | 2439 EXPECT_TRUE(specifics.has_encrypted()); |
2440 } | 2440 } |
2441 } | 2441 } |
2442 | 2442 |
2443 } // namespace browser_sync | 2443 } // namespace browser_sync |
OLD | NEW |