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

Unified Diff: ash/common/system/chromeos/network/vpn_delegate_unittest.cc

Issue 2513673004: Reland: chromeos: Convert ash VPNDelegate interface to mojo (Closed)
Patch Set: fix manifest for reland Created 4 years, 1 month 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
« no previous file with comments | « ash/common/system/chromeos/network/vpn_delegate.cc ('k') | ash/common/system/chromeos/network/vpn_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/network/vpn_delegate_unittest.cc
diff --git a/ash/common/system/chromeos/network/vpn_delegate_unittest.cc b/ash/common/system/chromeos/network/vpn_delegate_unittest.cc
deleted file mode 100644
index be032a779b82d816895eaa632b3fb1d333246248..0000000000000000000000000000000000000000
--- a/ash/common/system/chromeos/network/vpn_delegate_unittest.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/system/chromeos/network/vpn_delegate.h"
-
-#include <algorithm>
-#include <vector>
-
-#include "base/macros.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace ash {
-
-namespace {
-
-class TestVpnDelegate : public VPNDelegate {
- public:
- TestVpnDelegate() {}
- ~TestVpnDelegate() override {}
-
- // VPNDelegate:
- void ShowAddPage(const std::string& extension_id) override {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestVpnDelegate);
-};
-
-} // namespace
-
-using VpnDelegateTest = testing::Test;
-
-TEST_F(VpnDelegateTest, BuiltInProvider) {
- TestVpnDelegate delegate;
-
- // The VPN list should only contain the built-in provider.
- ASSERT_EQ(1u, delegate.vpn_providers().size());
- VPNProvider provider = delegate.vpn_providers()[0];
- EXPECT_FALSE(provider.third_party);
- EXPECT_TRUE(provider.extension_id.empty());
-}
-
-TEST_F(VpnDelegateTest, ThirdPartyProviders) {
- TestVpnDelegate delegate;
-
- // The VPN list should only contain the built-in provider.
- EXPECT_EQ(1u, delegate.vpn_providers().size());
-
- // Add some third party (extension-backed) providers.
- VPNProvider provider1("extension_id1", "name1");
- VPNProvider provider2("extension_id2", "name2");
- std::vector<VPNProvider> third_party_providers = {provider1, provider2};
- delegate.SetThirdPartyVpnProviders(third_party_providers);
-
- // List contains the extension-backed providers. Order doesn't matter.
- std::vector<VPNProvider> providers = delegate.vpn_providers();
- EXPECT_EQ(3u, providers.size());
- EXPECT_EQ(1u, std::count(providers.begin(), providers.end(), provider1));
- EXPECT_EQ(1u, std::count(providers.begin(), providers.end(), provider2));
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/system/chromeos/network/vpn_delegate.cc ('k') | ash/common/system/chromeos/network/vpn_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698