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

Unified Diff: components/sync/driver/sync_stopped_reporter_unittest.cc

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 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/driver/sync_stopped_reporter_unittest.cc
diff --git a/components/sync_driver/sync_stopped_reporter_unittest.cc b/components/sync/driver/sync_stopped_reporter_unittest.cc
similarity index 87%
rename from components/sync_driver/sync_stopped_reporter_unittest.cc
rename to components/sync/driver/sync_stopped_reporter_unittest.cc
index 88a13b86bd85f8933988d4cf0caa1e1c5c6b50aa..501c2b7c36c95d89009edf1838c6ba8e04e57026 100644
--- a/components/sync_driver/sync_stopped_reporter_unittest.cc
+++ b/components/sync/driver/sync_stopped_reporter_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/sync_driver/sync_stopped_reporter.h"
+#include "components/sync/driver/sync_stopped_reporter.h"
#include <string>
@@ -37,21 +37,17 @@ class SyncStoppedReporterTest : public testing::Test {
~SyncStoppedReporterTest() override {}
void SetUp() override {
- request_context_ = new net::TestURLRequestContextGetter(
- message_loop_.task_runner());
+ request_context_ =
+ new net::TestURLRequestContextGetter(message_loop_.task_runner());
}
void RequestFinishedCallback(const SyncStoppedReporter::Result& result) {
request_result_ = result;
}
- GURL test_url() {
- return GURL(kTestURL);
- }
+ GURL test_url() { return GURL(kTestURL); }
- std::string user_agent() const {
- return std::string(kTestUserAgent);
- }
+ std::string user_agent() const { return std::string(kTestUserAgent); }
SyncStoppedReporter::ResultCallback callback() {
return base::Bind(&SyncStoppedReporterTest::RequestFinishedCallback,
@@ -77,8 +73,8 @@ class SyncStoppedReporterTest : public testing::Test {
// Test that the event URL gets constructed correctly.
TEST_F(SyncStoppedReporterTest, EventURL) {
net::TestURLFetcherFactory factory;
- SyncStoppedReporter ssr(GURL(kTestURL), user_agent(),
- request_context(), callback());
+ SyncStoppedReporter ssr(GURL(kTestURL), user_agent(), request_context(),
+ callback());
ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday);
net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
EXPECT_EQ(kEventURL, fetcher->GetOriginalURL().spec());
@@ -97,8 +93,8 @@ TEST_F(SyncStoppedReporterTest, EventURLWithSlash) {
// Test that the URLFetcher gets configured correctly.
TEST_F(SyncStoppedReporterTest, FetcherConfiguration) {
net::TestURLFetcherFactory factory;
- SyncStoppedReporter ssr(test_url(), user_agent(),
- request_context(), callback());
+ SyncStoppedReporter ssr(test_url(), user_agent(), request_context(),
+ callback());
ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday);
net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
@@ -123,8 +119,8 @@ TEST_F(SyncStoppedReporterTest, FetcherConfiguration) {
TEST_F(SyncStoppedReporterTest, HappyCase) {
net::TestURLFetcherFactory factory;
- SyncStoppedReporter ssr(test_url(), user_agent(),
- request_context(), callback());
+ SyncStoppedReporter ssr(test_url(), user_agent(), request_context(),
+ callback());
ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday);
net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
fetcher->set_response_code(net::HTTP_OK);
@@ -136,8 +132,8 @@ TEST_F(SyncStoppedReporterTest, HappyCase) {
TEST_F(SyncStoppedReporterTest, ServerNotFound) {
net::TestURLFetcherFactory factory;
- SyncStoppedReporter ssr(test_url(), user_agent(),
- request_context(), callback());
+ SyncStoppedReporter ssr(test_url(), user_agent(), request_context(),
+ callback());
ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday);
net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
fetcher->set_response_code(net::HTTP_NOT_FOUND);
@@ -151,8 +147,8 @@ TEST_F(SyncStoppedReporterTest, DestructionDuringRequestHandler) {
net::TestURLFetcherFactory factory;
factory.set_remove_fetcher_on_delete(true);
{
- SyncStoppedReporter ssr(test_url(), user_agent(),
- request_context(), callback());
+ SyncStoppedReporter ssr(test_url(), user_agent(), request_context(),
+ callback());
ssr.ReportSyncStopped(kAuthToken, kCacheGuid, kBirthday);
EXPECT_FALSE(factory.GetFetcherByID(0) == nullptr);
}
@@ -160,8 +156,8 @@ TEST_F(SyncStoppedReporterTest, DestructionDuringRequestHandler) {
}
TEST_F(SyncStoppedReporterTest, Timeout) {
- SyncStoppedReporter ssr(test_url(), user_agent(),
- request_context(), callback());
+ SyncStoppedReporter ssr(test_url(), user_agent(), request_context(),
+ callback());
// A task runner that can trigger the timeout immediately.
scoped_refptr<base::TestSimpleTaskRunner> task_runner(
« no previous file with comments | « components/sync/driver/sync_stopped_reporter.cc ('k') | components/sync/driver/sync_type_preference_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698