| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 EXPECT_EQ(BaseNode::INIT_FAILED_PRECONDITION, | 646 EXPECT_EQ(BaseNode::INIT_FAILED_PRECONDITION, |
| 647 node.InitByTagLookup(empty_tag)); | 647 node.InitByTagLookup(empty_tag)); |
| 648 } | 648 } |
| 649 | 649 |
| 650 namespace { | 650 namespace { |
| 651 | 651 |
| 652 class TestHttpPostProviderInterface : public HttpPostProviderInterface { | 652 class TestHttpPostProviderInterface : public HttpPostProviderInterface { |
| 653 public: | 653 public: |
| 654 virtual ~TestHttpPostProviderInterface() {} | 654 virtual ~TestHttpPostProviderInterface() {} |
| 655 | 655 |
| 656 virtual void SetUserAgent(const char* user_agent) OVERRIDE {} | |
| 657 virtual void SetExtraRequestHeaders(const char* headers) OVERRIDE {} | 656 virtual void SetExtraRequestHeaders(const char* headers) OVERRIDE {} |
| 658 virtual void SetURL(const char* url, int port) OVERRIDE {} | 657 virtual void SetURL(const char* url, int port) OVERRIDE {} |
| 659 virtual void SetPostPayload(const char* content_type, | 658 virtual void SetPostPayload(const char* content_type, |
| 660 int content_length, | 659 int content_length, |
| 661 const char* content) OVERRIDE {} | 660 const char* content) OVERRIDE {} |
| 662 virtual bool MakeSynchronousPost(int* error_code, int* response_code) | 661 virtual bool MakeSynchronousPost(int* error_code, int* response_code) |
| 663 OVERRIDE { | 662 OVERRIDE { |
| 664 return false; | 663 return false; |
| 665 } | 664 } |
| 666 virtual int GetResponseContentLength() const OVERRIDE { | 665 virtual int GetResponseContentLength() const OVERRIDE { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 std::vector<ModelSafeWorker*> workers; | 777 std::vector<ModelSafeWorker*> workers; |
| 779 ModelSafeRoutingInfo routing_info; | 778 ModelSafeRoutingInfo routing_info; |
| 780 GetModelSafeRoutingInfo(&routing_info); | 779 GetModelSafeRoutingInfo(&routing_info); |
| 781 | 780 |
| 782 // Takes ownership of |sync_notifier_mock_|. | 781 // Takes ownership of |sync_notifier_mock_|. |
| 783 sync_manager_.Init(temp_dir_.path(), | 782 sync_manager_.Init(temp_dir_.path(), |
| 784 WeakHandle<JsEventHandler>(), | 783 WeakHandle<JsEventHandler>(), |
| 785 "bogus", 0, false, | 784 "bogus", 0, false, |
| 786 base::MessageLoopProxy::current(), | 785 base::MessageLoopProxy::current(), |
| 787 new TestHttpPostProviderFactory(), routing_info, workers, | 786 new TestHttpPostProviderFactory(), routing_info, workers, |
| 788 &extensions_activity_monitor_, this, "bogus", | 787 &extensions_activity_monitor_, this, |
| 789 credentials, | 788 credentials, |
| 790 sync_notifier_mock_, "", | 789 sync_notifier_mock_, "", |
| 791 csync::SyncManager::TEST_IN_MEMORY, | 790 csync::SyncManager::TEST_IN_MEMORY, |
| 792 &encryptor_, | 791 &encryptor_, |
| 793 &handler_, | 792 &handler_, |
| 794 NULL); | 793 NULL); |
| 795 | 794 |
| 796 EXPECT_TRUE(sync_notifier_observer_); | 795 EXPECT_TRUE(sync_notifier_observer_); |
| 797 EXPECT_TRUE(js_backend_.IsInitialized()); | 796 EXPECT_TRUE(js_backend_.IsInitialized()); |
| 798 | 797 |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2505 EXPECT_EQ(title, node.GetTitle()); | 2504 EXPECT_EQ(title, node.GetTitle()); |
| 2506 EXPECT_EQ(GURL(url2), node.GetURL()); | 2505 EXPECT_EQ(GURL(url2), node.GetURL()); |
| 2507 const syncable::Entry* node_entry = node.GetEntry(); | 2506 const syncable::Entry* node_entry = node.GetEntry(); |
| 2508 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); | 2507 EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); |
| 2509 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); | 2508 const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); |
| 2510 EXPECT_TRUE(specifics.has_encrypted()); | 2509 EXPECT_TRUE(specifics.has_encrypted()); |
| 2511 } | 2510 } |
| 2512 } | 2511 } |
| 2513 | 2512 |
| 2514 } // namespace csync | 2513 } // namespace csync |
| OLD | NEW |