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

Unified Diff: components/sync/core/http_bridge_unittest.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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: components/sync/core/http_bridge_unittest.cc
diff --git a/sync/internal_api/http_bridge_unittest.cc b/components/sync/core/http_bridge_unittest.cc
similarity index 95%
rename from sync/internal_api/http_bridge_unittest.cc
rename to components/sync/core/http_bridge_unittest.cc
index 6f5e46e9ad499d3e87fc8ed9650df1ac781edee2..5dfbe3db1ae3ec50b8f6af6118f665a80b15213b 100644
--- a/sync/internal_api/http_bridge_unittest.cc
+++ b/components/sync/core/http_bridge_unittest.cc
@@ -12,14 +12,14 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
+#include "components/sync/base/cancelation_signal.h"
+#include "components/sync/core/http_bridge.h"
+#include "components/sync/core/http_post_provider_factory.h"
#include "net/http/http_response_headers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher_delegate.h"
#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"
namespace syncer {
@@ -75,9 +75,7 @@ class MAYBE_SyncHttpBridgeTest : public testing::Test {
return bridge;
}
- static void Abort(HttpBridge* bridge) {
- bridge->Abort();
- }
+ static void Abort(HttpBridge* bridge) { bridge->Abort(); }
// Used by AbortAndReleaseBeforeFetchCompletes to test an interesting race
// condition.
@@ -88,13 +86,14 @@ class MAYBE_SyncHttpBridgeTest : public testing::Test {
MAYBE_SyncHttpBridgeTest* test) {
scoped_refptr<HttpBridge> http_bridge(test->BuildBridge());
EXPECT_TRUE(test->GetTestRequestContextGetter());
- net::HttpNetworkSession* test_session =
- test->GetTestRequestContextGetter()->GetURLRequestContext()->
- http_transaction_factory()->GetSession();
- EXPECT_EQ(test_session,
- http_bridge->GetRequestContextGetterForTest()->
- GetURLRequestContext()->
- http_transaction_factory()->GetSession());
+ net::HttpNetworkSession* test_session = test->GetTestRequestContextGetter()
+ ->GetURLRequestContext()
+ ->http_transaction_factory()
+ ->GetSession();
+ EXPECT_EQ(test_session, http_bridge->GetRequestContextGetterForTest()
+ ->GetURLRequestContext()
+ ->http_transaction_factory()
+ ->GetSession());
main_message_loop->task_runner()->PostTask(
FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
@@ -309,8 +308,8 @@ TEST_F(MAYBE_SyncHttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) {
http_bridge->GetResponseContentLength());
EXPECT_EQ(std::string::npos, response.find("Cookie:"));
EXPECT_NE(std::string::npos,
- response.find(base::StringPrintf("%s: %s",
- net::HttpRequestHeaders::kUserAgent, kUserAgent)));
+ response.find(base::StringPrintf(
+ "%s: %s", net::HttpRequestHeaders::kUserAgent, kUserAgent)));
EXPECT_NE(std::string::npos, response.find(test_payload.c_str()));
}
@@ -442,9 +441,8 @@ TEST_F(MAYBE_SyncHttpBridgeTest, AbortAndReleaseBeforeFetchComplete) {
fetcher.set_response_code(200);
fetcher.SetResponseString(response_content);
ASSERT_TRUE(io_thread()->task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&net::URLFetcherDelegate::OnURLFetchComplete,
- base::Unretained(delegate), &fetcher)));
+ FROM_HERE, base::Bind(&net::URLFetcherDelegate::OnURLFetchComplete,
+ base::Unretained(delegate), &fetcher)));
// Abort the fetch. This should be smart enough to handle the case where
// the bridge is destroyed before the callback scheduled above completes.
« no previous file with comments | « components/sync/core/http_bridge_network_resources.cc ('k') | components/sync/core/http_post_provider_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698