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

Unified Diff: sync/internal_api/http_bridge_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 side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/http_bridge_unittest.cc
diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc
index 4ea4e705d749d67d88d7bd4c2916c283aebce657..81b851949f3f5398616e4418b5443ed5b09e332e 100644
--- a/sync/internal_api/http_bridge_unittest.cc
+++ b/sync/internal_api/http_bridge_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/callback.h"
#include "base/metrics/field_trial.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h"
@@ -17,6 +18,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/zlib.h"
+namespace net {
+class URLFetcher;
+}
+
namespace syncer {
namespace {
@@ -143,10 +148,9 @@ class MAYBE_SyncHttpBridgeTest : public testing::Test {
new net::TestURLRequestContextGetter(io_thread_.task_runner());
fake_default_request_context_getter_->AddRef();
}
- HttpBridge* bridge =
- new HttpBridge(kUserAgent,
- fake_default_request_context_getter_,
- NetworkTimeUpdateCallback());
+ HttpBridge* bridge = new HttpBridge(
+ kUserAgent, fake_default_request_context_getter_,
+ NetworkTimeUpdateCallback(), base::Callback<void(net::URLFetcher*)>());
return bridge;
}
@@ -207,11 +211,15 @@ class ShuntedHttpBridge : public HttpBridge {
// If |never_finishes| is true, the simulated request never actually
// returns.
ShuntedHttpBridge(net::URLRequestContextGetter* baseline_context_getter,
- MAYBE_SyncHttpBridgeTest* test, bool never_finishes)
+ MAYBE_SyncHttpBridgeTest* test,
+ bool never_finishes)
: HttpBridge(kUserAgent,
baseline_context_getter,
- NetworkTimeUpdateCallback()),
- test_(test), never_finishes_(never_finishes) { }
+ NetworkTimeUpdateCallback(),
+ base::Callback<void(net::URLFetcher*)>()),
+ test_(test),
+ never_finishes_(never_finishes) {}
+
protected:
void MakeAsynchronousPost() override {
ASSERT_TRUE(base::MessageLoop::current() == test_->GetIOThreadLoop());
@@ -579,7 +587,7 @@ void HttpBridgeRunOnSyncThread(
new syncer::HttpBridgeFactory(baseline_context_getter,
NetworkTimeUpdateCallback(),
factory_cancelation_signal));
- bridge_factory->Init("test");
+ bridge_factory->Init("test", base::Callback<void(net::URLFetcher*)>());
*bridge_factory_out = bridge_factory.get();
HttpPostProviderInterface* bridge = bridge_factory->Create();
@@ -673,7 +681,7 @@ TEST_F(MAYBE_SyncHttpBridgeTest, EarlyAbortFactory) {
// Sync thread: Finally run the posted task, only to find that our
// HttpBridgeFactory has been neutered. Should not crash.
- factory->Init("TestUserAgent");
+ factory->Init("TestUserAgent", base::Callback<void(net::URLFetcher*)>());
// At this point, attempting to use the factory would trigger a crash. Both
// this test and the real world code should make sure this never happens.

Powered by Google App Engine
This is Rietveld 408576698