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

Unified Diff: chrome/browser/extensions/api/networking_private/networking_private_apitest.cc

Issue 219333002: Added method getCaptivePortalStatus to networkingPrivate extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 6 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
Index: chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
index 92cfe2de04eb541a5a1c97dae0d7db32c02d55d1..a051809680e91012da5ed966b8c2c5250617276c 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
+++ b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
@@ -13,6 +13,8 @@
#include "testing/gmock/include/gmock/gmock.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/net/network_portal_detector.h"
+#include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -44,6 +46,8 @@ using chromeos::CryptohomeClient;
using chromeos::DBUS_METHOD_CALL_SUCCESS;
using chromeos::DBusMethodCallStatus;
using chromeos::DBusThreadManager;
+using chromeos::NetworkPortalDetector;
+using chromeos::NetworkPortalDetectorTestImpl;
using chromeos::ShillDeviceClient;
using chromeos::ShillManagerClient;
using chromeos::ShillProfileClient;
@@ -452,6 +456,30 @@ IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest,
}
#endif
+#if defined(OS_CHROMEOS)
+// NetworkPortalDetector is only enabled for Chrome OS.
Yoyo Zhou 2014/03/31 20:38:45 nit: comment should come before the #if def
ygorshenin1 2014/04/01 07:07:55 Done.
+IN_PROC_BROWSER_TEST_P(ExtensionNetworkingPrivateApiTest,
+ GetCaptivePortalStatus) {
+ NetworkPortalDetectorTestImpl* detector = new NetworkPortalDetectorTestImpl();
+ NetworkPortalDetector::InitializeForTesting(detector);
+ NetworkPortalDetector::CaptivePortalState state;
+ state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE;
+ detector->SetDetectionResultsForTesting("stub_ethernet", state);
+
+ state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE;
+ detector->SetDetectionResultsForTesting("stub_wifi1", state);
+
+ state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL;
+ detector->SetDetectionResultsForTesting("stub_wifi2", state);
+
+ state.status =
+ NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED;
+ detector->SetDetectionResultsForTesting("stub_cellular1", state);
+
+ EXPECT_TRUE(RunNetworkingSubtest("getCaptivePortalStatus")) << message_;
+}
+#endif
+
INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation,
ExtensionNetworkingPrivateApiTest,
testing::Bool());

Powered by Google App Engine
This is Rietveld 408576698