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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/format_macros.h" | 15 #include "base/format_macros.h" |
16 #include "base/location.h" | 16 #include "base/location.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
19 #include "base/message_loop_proxy.h" | 19 #include "base/message_loop_proxy.h" |
20 #include "base/scoped_temp_dir.h" | 20 #include "base/scoped_temp_dir.h" |
21 #include "base/string_number_conversions.h" | 21 #include "base/string_number_conversions.h" |
22 #include "base/stringprintf.h" | 22 #include "base/stringprintf.h" |
23 #include "base/test/values_test_util.h" | 23 #include "base/test/values_test_util.h" |
24 #include "base/utf_string_conversions.h" | 24 #include "base/utf_string_conversions.h" |
25 #include "base/values.h" | 25 #include "base/values.h" |
26 #include "chrome/browser/sync/internal_api/change_record.h" | |
27 #include "chrome/browser/sync/internal_api/http_post_provider_factory.h" | |
28 #include "chrome/browser/sync/internal_api/http_post_provider_interface.h" | |
29 #include "chrome/browser/sync/internal_api/read_node.h" | |
30 #include "chrome/browser/sync/internal_api/read_transaction.h" | |
31 #include "chrome/browser/sync/internal_api/sync_manager.h" | |
32 #include "chrome/browser/sync/internal_api/syncapi_internal.h" | |
33 #include "chrome/browser/sync/internal_api/write_node.h" | |
34 #include "chrome/browser/sync/internal_api/write_transaction.h" | |
35 #include "chrome/browser/sync/test/engine/test_user_share.h" | |
36 #include "sync/engine/model_safe_worker.h" | 26 #include "sync/engine/model_safe_worker.h" |
37 #include "sync/engine/nigori_util.h" | 27 #include "sync/engine/nigori_util.h" |
38 #include "sync/engine/polling_constants.h" | 28 #include "sync/engine/polling_constants.h" |
| 29 #include "sync/internal_api/change_record.h" |
| 30 #include "sync/internal_api/http_post_provider_factory.h" |
| 31 #include "sync/internal_api/http_post_provider_interface.h" |
| 32 #include "sync/internal_api/read_node.h" |
| 33 #include "sync/internal_api/read_transaction.h" |
| 34 #include "sync/internal_api/sync_manager.h" |
| 35 #include "sync/internal_api/syncapi_internal.h" |
| 36 #include "sync/internal_api/test_user_share.h" |
| 37 #include "sync/internal_api/write_node.h" |
| 38 #include "sync/internal_api/write_transaction.h" |
39 #include "sync/js/js_arg_list.h" | 39 #include "sync/js/js_arg_list.h" |
40 #include "sync/js/js_backend.h" | 40 #include "sync/js/js_backend.h" |
41 #include "sync/js/js_event_handler.h" | 41 #include "sync/js/js_event_handler.h" |
42 #include "sync/js/js_reply_handler.h" | 42 #include "sync/js/js_reply_handler.h" |
43 #include "sync/js/js_test_util.h" | 43 #include "sync/js/js_test_util.h" |
44 #include "sync/notifier/sync_notifier.h" | 44 #include "sync/notifier/sync_notifier.h" |
45 #include "sync/notifier/sync_notifier_observer.h" | 45 #include "sync/notifier/sync_notifier_observer.h" |
46 #include "sync/protocol/bookmark_specifics.pb.h" | 46 #include "sync/protocol/bookmark_specifics.pb.h" |
47 #include "sync/protocol/encryption.pb.h" | 47 #include "sync/protocol/encryption.pb.h" |
48 #include "sync/protocol/extension_specifics.pb.h" | 48 #include "sync/protocol/extension_specifics.pb.h" |
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 EXPECT_EQ(title, node.GetTitle()); | 2510 EXPECT_EQ(title, node.GetTitle()); |
2511 EXPECT_EQ(GURL(url2), node.GetURL()); | 2511 EXPECT_EQ(GURL(url2), node.GetURL()); |
2512 const syncable::Entry* node_entry = node.GetEntry(); | 2512 const syncable::Entry* node_entry = node.GetEntry(); |
2513 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); | 2513 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); |
2514 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); | 2514 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); |
2515 EXPECT_TRUE(specifics.has_encrypted()); | 2515 EXPECT_TRUE(specifics.has_encrypted()); |
2516 } | 2516 } |
2517 } | 2517 } |
2518 | 2518 |
2519 } // namespace browser_sync | 2519 } // namespace browser_sync |
OLD | NEW |