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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc

Issue 1410013008: [Sync] Remove some http-related chrome deps from SyncBackendHostImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary includes/forward decls. Created 5 years, 2 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: chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
index 1e65fcd3ae46cffadc026c22db00ece0f759988e..ed75675609ca82b950e8e6012a5805ade017adb5 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
@@ -12,6 +12,7 @@
#include "base/message_loop/message_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/test_timeouts.h"
+#include "base/time/time.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -32,6 +33,7 @@
#include "google/cacheinvalidation/include/types.h"
#include "google_apis/gaia/gaia_constants.h"
#include "net/url_request/test_url_fetcher_factory.h"
+#include "net/url_request/url_request_context_getter.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/engine/model_safe_worker.h"
#include "sync/internal_api/public/engine/passive_model_worker.h"
@@ -75,6 +77,10 @@ void QuitMessageLoop() {
base::MessageLoop::current()->QuitWhenIdle();
}
+void EmptyNetworkTimeUpdate(const base::Time&,
+ const base::TimeDelta&,
+ const base::TimeDelta&) {}
+
class MockSyncFrontend : public sync_driver::SyncFrontend {
public:
virtual ~MockSyncFrontend() {}
@@ -227,6 +233,12 @@ class SyncBackendHostTest : public testing::Test {
void InitializeBackend(bool expect_success) {
EXPECT_CALL(mock_frontend_, OnBackendInitialized(_, _, _, expect_success)).
WillOnce(InvokeWithoutArgs(QuitMessageLoop));
+ SyncBackendHost::HttpPostProviderFactoryGetter
+ get_http_post_provider_factory =
+ base::Bind(&syncer::NetworkResources::GetHttpPostProviderFactory,
+ base::Unretained(network_resources_.get()),
+ make_scoped_refptr(profile_->GetRequestContext()),
+ base::Bind(&EmptyNetworkTimeUpdate));
backend_->Initialize(
&mock_frontend_, scoped_ptr<base::Thread>(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
@@ -234,7 +246,8 @@ class SyncBackendHostTest : public testing::Test {
syncer::WeakHandle<syncer::JsEventHandler>(), GURL(std::string()),
std::string(), credentials_, true, fake_manager_factory_.Pass(),
MakeWeakHandle(test_unrecoverable_error_handler_.GetWeakPtr()),
- base::Closure(), network_resources_.get(), saved_nigori_state_.Pass());
+ base::Closure(), get_http_post_provider_factory,
+ saved_nigori_state_.Pass());
base::RunLoop run_loop;
BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
run_loop.QuitClosure(),

Powered by Google App Engine
This is Rietveld 408576698