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

Unified Diff: chrome/browser/printing/cloud_print/privet_notifications_unittest.cc

Issue 2027883002: Fix PrivetNotificationService::PrivetNotify() silliness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix crazy formatting in unit test Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
diff --git a/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc b/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
index f621eb275f30bc143e0cfeccb985389b18ba5566..aeb13955096fd07df7200596831a95452a9dbd47 100644
--- a/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
+++ b/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
@@ -69,8 +69,7 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
};
explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context)
- : request_context_(request_context) {
- }
+ : request_context_(request_context) {}
Lei Zhang 2016/06/01 02:15:17 I let "git cl format" reformat the file.
std::unique_ptr<PrivetHTTPResolution> CreatePrivetHTTP(
const std::string& name) override {
@@ -78,7 +77,7 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
}
private:
- scoped_refptr<net::URLRequestContextGetter> request_context_;
+ scoped_refptr<net::URLRequestContextGetter> request_context_;
};
class PrivetNotificationsListenerTest : public ::testing::Test {
@@ -95,8 +94,7 @@ class PrivetNotificationsListenerTest : public ::testing::Test {
description_.description = kExampleDeviceDescription;
}
- virtual ~PrivetNotificationsListenerTest() {
- }
+ virtual ~PrivetNotificationsListenerTest() {}
bool SuccessfulResponseToInfo(const std::string& response) {
net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
@@ -107,8 +105,8 @@ class PrivetNotificationsListenerTest : public ::testing::Test {
return false;
fetcher->SetResponseString(response);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
+ fetcher->set_status(
+ net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
fetcher->set_response_code(200);
fetcher->delegate()->OnURLFetchComplete(fetcher);
return true;
@@ -124,40 +122,27 @@ class PrivetNotificationsListenerTest : public ::testing::Test {
};
TEST_F(PrivetNotificationsListenerTest, DisappearReappearTest) {
- EXPECT_CALL(mock_delegate_, PrivetNotify(
- 1,
- true));
+ EXPECT_CALL(mock_delegate_, PrivetNotify(1, true));
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
SuccessfulResponseToInfo(kInfoResponseUptime20);
EXPECT_CALL(mock_delegate_, PrivetRemoveNotification());
- notification_listener_->DeviceRemoved(
- kExampleDeviceName);
+ notification_listener_->DeviceRemoved(kExampleDeviceName);
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
description_.id = kExampleDeviceID;
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
}
TEST_F(PrivetNotificationsListenerTest, RegisterTest) {
- EXPECT_CALL(mock_delegate_, PrivetNotify(
- 1,
- true));
+ EXPECT_CALL(mock_delegate_, PrivetNotify(1, true));
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
SuccessfulResponseToInfo(kInfoResponseUptime20);
@@ -165,42 +150,32 @@ TEST_F(PrivetNotificationsListenerTest, RegisterTest) {
description_.id = kExampleDeviceID;
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
}
TEST_F(PrivetNotificationsListenerTest, HighUptimeTest) {
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
SuccessfulResponseToInfo(kInfoResponseUptime3600);
description_.id = kExampleDeviceID;
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
}
TEST_F(PrivetNotificationsListenerTest, HTTPErrorTest) {
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
+ fetcher->set_status(
+ net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
fetcher->set_response_code(200);
fetcher->delegate()->OnURLFetchComplete(fetcher);
}
TEST_F(PrivetNotificationsListenerTest, DictionaryErrorTest) {
- notification_listener_->DeviceChanged(
- kExampleDeviceName,
- description_);
+ notification_listener_->DeviceChanged(kExampleDeviceName, description_);
SuccessfulResponseToInfo(kInfoResponseNoUptime);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698