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

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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/http_bridge.cc ('k') | sync/internal_api/public/http_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7c6fe8228eaec6df28832d8e3372397b3274827e 100644
--- a/sync/internal_api/http_bridge_unittest.cc
+++ b/sync/internal_api/http_bridge_unittest.cc
@@ -14,6 +14,7 @@
#include "net/url_request/url_request_test_util.h"
#include "sync/internal_api/public/base/cancelation_signal.h"
#include "sync/internal_api/public/http_bridge.h"
+#include "sync/internal_api/public/http_post_provider_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/zlib.h"
@@ -144,9 +145,8 @@ class MAYBE_SyncHttpBridgeTest : public testing::Test {
fake_default_request_context_getter_->AddRef();
}
HttpBridge* bridge =
- new HttpBridge(kUserAgent,
- fake_default_request_context_getter_,
- NetworkTimeUpdateCallback());
+ new HttpBridge(kUserAgent, fake_default_request_context_getter_,
+ NetworkTimeUpdateCallback(), BindToTrackerCallback());
return bridge;
}
@@ -207,11 +207,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(),
+ BindToTrackerCallback()),
+ test_(test),
+ never_finishes_(never_finishes) {}
+
protected:
void MakeAsynchronousPost() override {
ASSERT_TRUE(base::MessageLoop::current() == test_->GetIOThreadLoop());
@@ -579,7 +583,7 @@ void HttpBridgeRunOnSyncThread(
new syncer::HttpBridgeFactory(baseline_context_getter,
NetworkTimeUpdateCallback(),
factory_cancelation_signal));
- bridge_factory->Init("test");
+ bridge_factory->Init("test", BindToTrackerCallback());
*bridge_factory_out = bridge_factory.get();
HttpPostProviderInterface* bridge = bridge_factory->Create();
@@ -673,7 +677,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", BindToTrackerCallback());
// 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.
« no previous file with comments | « sync/internal_api/http_bridge.cc ('k') | sync/internal_api/public/http_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698