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

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

Issue 1330443002: Report data usage UMA for Chrome services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewArchServices
Patch Set: Fix calling Init function in sync_client.cc 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 (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 #include "sync/internal_api/syncapi_server_connection_manager.h" 5 #include "sync/internal_api/syncapi_server_connection_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return std::string(); 44 return std::string();
45 } 45 }
46 void Abort() override { wait_for_abort_.Signal(); } 46 void Abort() override { wait_for_abort_.Signal(); }
47 private: 47 private:
48 base::WaitableEvent wait_for_abort_; 48 base::WaitableEvent wait_for_abort_;
49 }; 49 };
50 50
51 class BlockingHttpPostFactory : public HttpPostProviderFactory { 51 class BlockingHttpPostFactory : public HttpPostProviderFactory {
52 public: 52 public:
53 ~BlockingHttpPostFactory() override {} 53 ~BlockingHttpPostFactory() override {}
54 void Init(const std::string& user_agent) override {} 54 void Init(const std::string& user_agent,
55 const BindToTrackerCallback& bind_to_tracker_callback) override {}
56
55 HttpPostProviderInterface* Create() override { 57 HttpPostProviderInterface* Create() override {
56 return new BlockingHttpPost(); 58 return new BlockingHttpPost();
57 } 59 }
58 void Destroy(HttpPostProviderInterface* http) override { 60 void Destroy(HttpPostProviderInterface* http) override {
59 delete static_cast<BlockingHttpPost*>(http); 61 delete static_cast<BlockingHttpPost*>(http);
60 } 62 }
61 }; 63 };
62 64
63 } // namespace 65 } // namespace
64 66
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool result = server.PostBufferToPath( 120 bool result = server.PostBufferToPath(
119 &params, "/testpath", "testauth", &watcher); 121 &params, "/testpath", "testauth", &watcher);
120 122
121 EXPECT_FALSE(result); 123 EXPECT_FALSE(result);
122 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, 124 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE,
123 params.response.server_status); 125 params.response.server_status);
124 abort_thread.Stop(); 126 abort_thread.Stop();
125 } 127 }
126 128
127 } // namespace syncer 129 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/test/fake_server/fake_server_http_post_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698