Introduce brave vpn feature flag

fix https://github.com/brave/brave-browser/issues/17108

We will implement brave vpn behind this feature flag.
This commit is contained in:
Simon Hong
2021-07-22 22:45:38 +09:00
parent f9b949479a
commit 795faa0c44
5 changed files with 71 additions and 0 deletions
+19
View File
@@ -3,6 +3,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import("//brave/components/brave_vpn/buildflags/buildflags.gni")
static_library("brave_vpn") {
sources = [
"brave_vpn_connection_info.cc",
@@ -11,6 +13,8 @@ static_library("brave_vpn") {
"brave_vpn_connection_manager.h",
"brave_vpn_service.cc",
"brave_vpn_service.h",
"features.cc",
"features.h",
]
deps = [
@@ -63,6 +67,21 @@ source_set("brave_vpn_internal") {
}
}
source_set("unit_tests") {
if (enable_brave_vpn) {
testonly = true
sources = [ "brave_vpn_unittest.cc" ]
deps = [
":brave_vpn",
"//base",
"//content/test:test_support",
"//testing/gtest",
]
}
}
executable("vpntool") {
sources = []
deps = [
@@ -0,0 +1,17 @@
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "base/feature_list.h"
#include "brave/components/brave_vpn/features.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace brave_vpn {
TEST(BraveVPNTest, Basic) {
// Disable by default till we implement all brave vpn features.
EXPECT_FALSE(base::FeatureList::IsEnabled(kBraveVPNFeature));
}
} // namespace brave_vpn
+15
View File
@@ -0,0 +1,15 @@
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "brave/components/brave_vpn/features.h"
#include "base/feature_list.h"
namespace brave_vpn {
const base::Feature kBraveVPNFeature{"BraveVPN",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace brave_vpn
+19
View File
@@ -0,0 +1,19 @@
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BRAVE_COMPONENTS_BRAVE_VPN_FEATURES_H_
#define BRAVE_COMPONENTS_BRAVE_VPN_FEATURES_H_
namespace base {
struct Feature;
} // namespace base
namespace brave_vpn {
extern const base::Feature kBraveVPNFeature;
} // namespace brave_vpn
#endif // BRAVE_COMPONENTS_BRAVE_VPN_FEATURES_H_
+1
View File
@@ -180,6 +180,7 @@ test("brave_unit_tests") {
"//brave/components/brave_search/common",
"//brave/components/brave_shields/browser",
"//brave/components/brave_shields/common",
"//brave/components/brave_vpn:unit_tests",
"//brave/components/brave_wallet/browser/test:brave_wallet_unit_tests",
"//brave/components/brave_wallet/common/buildflags",
"//brave/components/child_process_monitor:unittests",