shill: vpn: Auto-connect at most one service at a time, only when online.
This patch suppresses auto-connect for non-primary technologies (such
as VPN) while the system is offline. Also, don't auto-connect a VPN
service if there's already an active (connecting or connected) VPN
service.
Cleanup Manager's online/offline API a bit.
BUG=chromium-os:38229
TEST=unit tests
Change-Id: Iedd3879cf45c8b509a956415c7de5e5ba1af4652
Reviewed-on: https://gerrit.chromium.org/gerrit/42226
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
diff --git a/mock_manager.h b/mock_manager.h
index ce21c3f..8b1ef7e 100644
--- a/mock_manager.h
+++ b/mock_manager.h
@@ -43,6 +43,7 @@
bool (const ProfileRefPtr &profile,
const std::string &entry_name));
MOCK_CONST_METHOD0(GetDefaultService, ServiceRefPtr());
+ MOCK_CONST_METHOD0(IsOnline, bool());
MOCK_METHOD0(UpdateEnabledTechnologies, void());
MOCK_METHOD1(LoadDeviceFromProfiles, void(const DeviceRefPtr &device));
MOCK_METHOD1(IsPortalDetectionEnabled, bool(Technology::Identifier tech));