Commit 1eee5dd3 authored by warx's avatar warx Committed by Commit bot

cleanup: Replace NULL with nullptr in network_portal_detector_impl_unittest.cc

Changes:
(1) s/NULL/nullptr/g (2) git cl format; just a cleanup, do not want it included in issue 2756643002

BUG=NONE
TEST=NONE

Review-Url: https://codereview.chromium.org/2753223002
Cr-Commit-Position: refs/heads/master@{#457798}
parent 69cbe27e
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment