OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/login/user.h" | 10 #include "chrome/browser/chromeos/login/user.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 GetWifiTDLSStatus) { | 503 GetWifiTDLSStatus) { |
504 EXPECT_TRUE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; | 504 EXPECT_TRUE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; |
505 } | 505 } |
506 #endif | 506 #endif |
507 | 507 |
508 // NetworkPortalDetector is only enabled for Chrome OS. | 508 // NetworkPortalDetector is only enabled for Chrome OS. |
509 #if defined(OS_CHROMEOS) | 509 #if defined(OS_CHROMEOS) |
510 IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, | 510 IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, |
511 GetCaptivePortalStatus) { | 511 GetCaptivePortalStatus) { |
512 NetworkPortalDetector::CaptivePortalState state; | 512 NetworkPortalDetector::CaptivePortalState state; |
513 state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | 513 state.status = captive_portal::CAPTIVE_PORTAL_STATUS_ONLINE; |
514 detector()->SetDetectionResultsForTesting("stub_ethernet", state); | 514 detector()->SetDetectionResultsForTesting("stub_ethernet", state); |
515 | 515 |
516 state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE; | 516 state.status = captive_portal::CAPTIVE_PORTAL_STATUS_OFFLINE; |
517 detector()->SetDetectionResultsForTesting("stub_wifi1", state); | 517 detector()->SetDetectionResultsForTesting("stub_wifi1", state); |
518 | 518 |
519 state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL; | 519 state.status = captive_portal::CAPTIVE_PORTAL_STATUS_PORTAL; |
520 detector()->SetDetectionResultsForTesting("stub_wifi2", state); | 520 detector()->SetDetectionResultsForTesting("stub_wifi2", state); |
521 | 521 |
522 state.status = | 522 state.status = |
523 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED; | 523 captive_portal::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED; |
524 detector()->SetDetectionResultsForTesting("stub_cellular1", state); | 524 detector()->SetDetectionResultsForTesting("stub_cellular1", state); |
525 | 525 |
526 EXPECT_TRUE(RunNetworkingSubtest("getCaptivePortalStatus")) << message_; | 526 EXPECT_TRUE(RunNetworkingSubtest("getCaptivePortalStatus")) << message_; |
527 } | 527 } |
528 | 528 |
529 IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, | 529 IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest, |
530 CaptivePortalNotification) { | 530 CaptivePortalNotification) { |
531 detector()->SetDefaultNetworkPathForTesting("wifi"); | 531 detector()->SetDefaultNetworkPathForTesting("wifi"); |
532 NetworkPortalDetector::CaptivePortalState state; | 532 NetworkPortalDetector::CaptivePortalState state; |
533 state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | 533 state.status = captive_portal::CAPTIVE_PORTAL_STATUS_ONLINE; |
534 detector()->SetDetectionResultsForTesting("wifi", state); | 534 detector()->SetDetectionResultsForTesting("wifi", state); |
535 | 535 |
536 TestListener listener( | 536 TestListener listener( |
537 "notifyPortalDetectorObservers", | 537 "notifyPortalDetectorObservers", |
538 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, | 538 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, |
539 base::Unretained(detector()))); | 539 base::Unretained(detector()))); |
540 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; | 540 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; |
541 } | 541 } |
542 #endif // defined(OS_CHROMEOS) | 542 #endif // defined(OS_CHROMEOS) |
543 | 543 |
544 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, | 544 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, |
545 ExtensionNetworkingPrivateApiTest, | 545 ExtensionNetworkingPrivateApiTest, |
546 testing::Bool()); | 546 testing::Bool()); |
547 | 547 |
548 } // namespace | 548 } // namespace |
OLD | NEW |