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

Unified Diff: chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc

Issue 2753223002: cleanup: Replace NULL with nullptr in network_portal_detector_impl_unittest.cc (Closed)
Patch Set: Created 3 years, 9 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/chromeos/net/network_portal_detector_impl_unittest.cc
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
index daba966fdab2016e621979b1218cba1dea264df1..b64467b68c5559d2673890172cc9579782113f62 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
@@ -146,7 +146,7 @@ class NetworkPortalDetectorImplTest
ASSERT_EQ(expected_no_response_result_count, no_response_result_count());
ASSERT_EQ(base::TimeDelta::FromSeconds(expected_request_timeout_sec),
get_next_attempt_timeout());
- CompleteURLFetch(net_error, status_code, NULL);
+ CompleteURLFetch(net_error, status_code, nullptr);
}
Profile* profile() { return profile_; }
@@ -314,7 +314,7 @@ TEST_F(NetworkPortalDetectorImplTest, NoPortal) {
CheckPortalState(
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN, -1, kStubWireless1);
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -332,7 +332,7 @@ TEST_F(NetworkPortalDetectorImplTest, Portal) {
SetConnected(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 200, NULL);
+ CompleteURLFetch(net::OK, 200, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -342,7 +342,7 @@ TEST_F(NetworkPortalDetectorImplTest, Portal) {
SetConnected(kStubWireless2);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 301, NULL);
+ CompleteURLFetch(net::OK, 301, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -352,7 +352,7 @@ TEST_F(NetworkPortalDetectorImplTest, Portal) {
SetConnected(kStubEthernet);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 302, NULL);
+ CompleteURLFetch(net::OK, 302, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -376,7 +376,7 @@ TEST_F(NetworkPortalDetectorImplTest, Online2Offline) {
// WiFi is in online state.
{
// When transitioning to a connected state, the network will transition to
- // connecting states which will set the default network to NULL. This may
+ // connecting states which will set the default network to nullptr. This may
// get triggered multiple times.
EXPECT_CALL(observer, OnPortalDetectionCompleted(_, offline_state))
.Times(AnyNumber());
@@ -390,7 +390,7 @@ TEST_F(NetworkPortalDetectorImplTest, Online2Offline) {
SetConnected(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
// Check that observer was notified about online state.
@@ -399,7 +399,7 @@ TEST_F(NetworkPortalDetectorImplTest, Online2Offline) {
// WiFi is turned off.
{
- EXPECT_CALL(observer, OnPortalDetectionCompleted(NULL, offline_state))
+ EXPECT_CALL(observer, OnPortalDetectionCompleted(nullptr, offline_state))
.Times(1);
SetDisconnected(kStubWireless1);
@@ -424,14 +424,14 @@ TEST_F(NetworkPortalDetectorImplTest, TwoNetworks) {
ASSERT_TRUE(is_state_checking_for_portal());
// WiFi is in portal state.
- CompleteURLFetch(net::OK, 200, NULL);
+ CompleteURLFetch(net::OK, 200, nullptr);
ASSERT_FALSE(is_state_idle());
SetConnected(kStubEthernet);
ASSERT_TRUE(is_state_checking_for_portal());
// ethernet is in online state.
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, kStubEthernet);
@@ -462,7 +462,7 @@ TEST_F(NetworkPortalDetectorImplTest, NetworkChanged) {
ASSERT_TRUE(is_state_checking_for_portal());
// ethernet is in online state.
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, kStubEthernet);
@@ -484,7 +484,7 @@ TEST_F(NetworkPortalDetectorImplTest, NetworkStateNotChanged) {
SetConnected(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -506,7 +506,7 @@ TEST_F(NetworkPortalDetectorImplTest, NetworkStateChanged) {
SetBehindPortal(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 200, NULL);
+ CompleteURLFetch(net::OK, 200, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -515,7 +515,7 @@ TEST_F(NetworkPortalDetectorImplTest, NetworkStateChanged) {
SetConnected(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -524,7 +524,7 @@ TEST_F(NetworkPortalDetectorImplTest, NetworkStateChanged) {
SetBehindPortal(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 200, NULL);
+ CompleteURLFetch(net::OK, 200, nullptr);
ASSERT_FALSE(is_state_idle());
CheckPortalState(
@@ -618,7 +618,7 @@ TEST_F(NetworkPortalDetectorImplTest, FirstAttemptFailed) {
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_FALSE(is_state_idle());
ASSERT_EQ(0, no_response_result_count());
CheckPortalState(
@@ -675,17 +675,17 @@ TEST_F(NetworkPortalDetectorImplTest, ProxyAuthRequired) {
set_delay_till_next_attempt(base::TimeDelta());
SetConnected(kStubWireless1);
- CompleteURLFetch(net::OK, 407, NULL);
+ CompleteURLFetch(net::OK, 407, nullptr);
ASSERT_EQ(1, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(net::OK, 407, NULL);
+ CompleteURLFetch(net::OK, 407, nullptr);
ASSERT_EQ(2, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(net::OK, 407, NULL);
+ CompleteURLFetch(net::OK, 407, nullptr);
ASSERT_EQ(3, no_response_result_count());
ASSERT_FALSE(is_state_idle());
@@ -708,24 +708,24 @@ TEST_F(NetworkPortalDetectorImplTest, NoResponseButBehindPortal) {
SetBehindPortal(kStubWireless1);
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(
- net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, NULL);
+ CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
+ net::URLFetcher::RESPONSE_CODE_INVALID, nullptr);
ASSERT_EQ(1, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(
- net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, NULL);
+ CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
+ net::URLFetcher::RESPONSE_CODE_INVALID, nullptr);
ASSERT_EQ(2, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(
- net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, NULL);
+ CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
+ net::URLFetcher::RESPONSE_CODE_INVALID, nullptr);
ASSERT_EQ(3, no_response_result_count());
ASSERT_FALSE(is_state_idle());
@@ -761,7 +761,7 @@ TEST_F(NetworkPortalDetectorImplTest, ErrorScreenStrategyForOnlineNetwork) {
enable_error_screen_strategy();
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_TRUE(is_state_portal_detection_pending());
CheckPortalState(
@@ -770,7 +770,7 @@ TEST_F(NetworkPortalDetectorImplTest, ErrorScreenStrategyForOnlineNetwork) {
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
ASSERT_TRUE(is_state_portal_detection_pending());
CheckPortalState(
@@ -785,7 +785,7 @@ TEST_F(NetworkPortalDetectorImplTest, ErrorScreenStrategyForOnlineNetwork) {
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
CheckPortalState(
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, kStubWireless1);
@@ -803,8 +803,8 @@ TEST_F(NetworkPortalDetectorImplTest, ErrorScreenStrategyForPortalNetwork) {
enable_error_screen_strategy();
SetConnected(kStubWireless1);
- CompleteURLFetch(
- net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, NULL);
+ CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
+ net::URLFetcher::RESPONSE_CODE_INVALID, nullptr);
ASSERT_EQ(1, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
CheckPortalState(
@@ -813,8 +813,8 @@ TEST_F(NetworkPortalDetectorImplTest, ErrorScreenStrategyForPortalNetwork) {
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(
- net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, NULL);
+ CompleteURLFetch(net::ERR_CONNECTION_CLOSED,
+ net::URLFetcher::RESPONSE_CODE_INVALID, nullptr);
ASSERT_EQ(2, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
CheckPortalState(
@@ -823,7 +823,7 @@ TEST_F(NetworkPortalDetectorImplTest, ErrorScreenStrategyForPortalNetwork) {
// To run CaptivePortalDetector::DetectCaptivePortal().
base::RunLoop().RunUntilIdle();
- CompleteURLFetch(net::OK, 200, NULL);
+ CompleteURLFetch(net::OK, 200, nullptr);
ASSERT_EQ(0, no_response_result_count());
ASSERT_TRUE(is_state_portal_detection_pending());
CheckPortalState(
@@ -872,7 +872,7 @@ TEST_F(NetworkPortalDetectorImplTest, TestDetectionRestart) {
ASSERT_TRUE(is_state_checking_for_portal());
ASSERT_FALSE(start_detection_if_idle());
- CompleteURLFetch(net::OK, 204, NULL);
+ CompleteURLFetch(net::OK, 204, nullptr);
CheckPortalState(
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE, 204, kStubWireless1);
@@ -883,7 +883,7 @@ TEST_F(NetworkPortalDetectorImplTest, TestDetectionRestart) {
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(is_state_checking_for_portal());
- CompleteURLFetch(net::OK, 200, NULL);
+ CompleteURLFetch(net::OK, 200, nullptr);
CheckPortalState(
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL, 200, kStubWireless1);
« 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