shill: vpn: Disconnect L2TP/IPSec properly.
Also, add some missing unit tests.
BUG=chromium-os:29364
TEST=unit tests
Change-Id: I2292fb14a27e0fd5f29c42f5dc58c6b1bdeab9c6
Reviewed-on: https://gerrit.chromium.org/gerrit/21042
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/vpn_service.cc b/vpn_service.cc
index 7573613..509dfa1 100644
--- a/vpn_service.cc
+++ b/vpn_service.cc
@@ -96,12 +96,9 @@
}
bool VPNService::Unload() {
+ // The base method also disconnects the service.
Service::Unload();
- // VPN services which have been removed from the profile should be
- // disconnected.
- driver_->Disconnect();
-
// Ask the VPN provider to remove us from its list.
manager()->vpn_provider()->RemoveService(this);