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

Side by Side Diff: sync/internal_api/sync_manager_impl_unittest.cc

Issue 1330443002: Report data usage UMA for Chrome services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewArchServices
Patch Set: Do the necessary plumbing for sync service. Created 5 years, 3 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "sync/test/engine/test_id_factory.h" 68 #include "sync/test/engine/test_id_factory.h"
69 #include "sync/test/fake_encryptor.h" 69 #include "sync/test/fake_encryptor.h"
70 #include "sync/util/cryptographer.h" 70 #include "sync/util/cryptographer.h"
71 #include "sync/util/extensions_activity.h" 71 #include "sync/util/extensions_activity.h"
72 #include "sync/util/mock_unrecoverable_error_handler.h" 72 #include "sync/util/mock_unrecoverable_error_handler.h"
73 #include "sync/util/time.h" 73 #include "sync/util/time.h"
74 #include "testing/gmock/include/gmock/gmock.h" 74 #include "testing/gmock/include/gmock/gmock.h"
75 #include "testing/gtest/include/gtest/gtest.h" 75 #include "testing/gtest/include/gtest/gtest.h"
76 #include "url/gurl.h" 76 #include "url/gurl.h"
77 77
78 namespace net {
79 class URLFetcher;
80 }
81
78 using base::ExpectDictStringValue; 82 using base::ExpectDictStringValue;
79 using testing::_; 83 using testing::_;
80 using testing::DoAll; 84 using testing::DoAll;
81 using testing::InSequence; 85 using testing::InSequence;
82 using testing::Return; 86 using testing::Return;
83 using testing::SaveArg; 87 using testing::SaveArg;
84 using testing::StrictMock; 88 using testing::StrictMock;
85 89
86 namespace syncer { 90 namespace syncer {
87 91
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 const std::string GetResponseHeaderValue( 798 const std::string GetResponseHeaderValue(
795 const std::string& name) const override { 799 const std::string& name) const override {
796 return std::string(); 800 return std::string();
797 } 801 }
798 void Abort() override {} 802 void Abort() override {}
799 }; 803 };
800 804
801 class TestHttpPostProviderFactory : public HttpPostProviderFactory { 805 class TestHttpPostProviderFactory : public HttpPostProviderFactory {
802 public: 806 public:
803 ~TestHttpPostProviderFactory() override {} 807 ~TestHttpPostProviderFactory() override {}
804 void Init(const std::string& user_agent) override {} 808 void Init(const std::string& user_agent,
809 base::Callback<void(net::URLFetcher*)> bind_to_tracker_callback)
810 override {}
805 HttpPostProviderInterface* Create() override { 811 HttpPostProviderInterface* Create() override {
806 return new TestHttpPostProviderInterface(); 812 return new TestHttpPostProviderInterface();
807 } 813 }
808 void Destroy(HttpPostProviderInterface* http) override { 814 void Destroy(HttpPostProviderInterface* http) override {
809 delete static_cast<TestHttpPostProviderInterface*>(http); 815 delete static_cast<TestHttpPostProviderInterface*>(http);
810 } 816 }
811 }; 817 };
812 818
813 class SyncManagerObserverMock : public SyncManager::Observer { 819 class SyncManagerObserverMock : public SyncManager::Observer {
814 public: 820 public:
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
3355 // SyncManagerInitInvalidStorageTest::GetFactory will return 3361 // SyncManagerInitInvalidStorageTest::GetFactory will return
3356 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. 3362 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails.
3357 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's 3363 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's
3358 // task is to ensure that SyncManagerImpl reported initialization failure in 3364 // task is to ensure that SyncManagerImpl reported initialization failure in
3359 // OnInitializationComplete callback. 3365 // OnInitializationComplete callback.
3360 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { 3366 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) {
3361 EXPECT_FALSE(initialization_succeeded_); 3367 EXPECT_FALSE(initialization_succeeded_);
3362 } 3368 }
3363 3369
3364 } // namespace syncer 3370 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698