Skip to content

Commit

Permalink
Merge pull request #2029 from brave/fix_3816
Browse files Browse the repository at this point in the history
Disabling metrics reporting; Updating ad-block deps to fix audit_deps error; Updating crypto deps to fix audit_deps error;
  • Loading branch information
jumde committed Mar 26, 2019
1 parent 2d7b229 commit 24c9541
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use_relative_paths = True

deps = {
"vendor/ad-block": "https://github.com/brave/ad-block.git@74b167c8b49c33f3f61c15dafa2ffde953a25653",
"vendor/ad-block": "https://github.com/brave/ad-block.git@d5c7128599889e4e2a797b402a517c664d53fad2",
"vendor/tracking-protection": "https://github.com/brave/tracking-protection.git@e67738e656244f7ab6e0ed9815071ca744f5468f",
"vendor/hashset-cpp": "https://github.com/brave/hashset-cpp.git@4b55fe39bb25bb0d8b11a43d547d75f00c6c46fb",
"vendor/bloom-filter-cpp": "https://github.com/brave/bloom-filter-cpp.git@9be5c63b14e094156e00c8b28f205e7794f0b92c",
Expand All @@ -15,8 +15,8 @@ deps = {
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@9b119931c702d55be994117eb505d56310720b1d",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@19fb43fd58b852fd2c6e4d4c68daa99c835f5182",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@1b4362968c8f22720bfb75af6f506d4ecc0f3116",
"components/brave_sync/extension/brave-sync": "https://github.com/brave/sync.git@76bf8f1295b46a7112756af631a8f5cd217953e6",
"components/brave_sync/extension/brave-crypto": "https://github.com/brave/crypto@518d17d97003d1ccb2116c498ab363e0834e184c",
"components/brave_sync/extension/brave-sync": "https://github.com/brave/sync.git@6691e9594f66050ba30206d9f49f90ce1a44bb51",
"components/brave_sync/extension/brave-crypto": "https://github.com/brave/crypto@0cd5dda4fd7c948d6c13107cb4f9b7d293ffc7e3",
"vendor/bat-native-ads": "https://github.com/brave-intl/bat-native-ads.git@fd6d9859a8327975aec0c11091066b0d3387bf4f",
"vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@c3b6111aa862c5c452c84be8a225d5f1df32b284",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@8b181292ec5fe2ace58cbedfb4d1eab6ec734560",
Expand Down
17 changes: 17 additions & 0 deletions chromium_src/components/metrics/enabled_state_provider.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright (c) 2019 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 "components/metrics/enabled_state_provider.h"

#include "base/base_switches.h"
#include "base/command_line.h"

namespace metrics {

bool EnabledStateProvider::IsReportingEnabled() const {
return false;
}

} // namespace metrics
27 changes: 27 additions & 0 deletions chromium_src/components/metrics/enabled_state_provider_unittest.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Copyright (c) 2019 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 "chrome/browser/metrics/chrome_metrics_services_manager_client.h"

#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "components/metrics/enabled_state_provider.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"

TEST(ChromeMetricsServicesManagerClient, MetricsReportingDisabled) {
TestingPrefServiceSimple local_state;
metrics::RegisterMetricsReportingStatePrefs(local_state.registry());
local_state.registry()->RegisterBooleanPref(
metrics::prefs::kMetricsReportingEnabled, true);

ChromeMetricsServicesManagerClient client(&local_state);
const metrics::EnabledStateProvider& provider =
client.GetEnabledStateProviderForTesting();

// Reporting should never be enabled
EXPECT_FALSE(provider.IsReportingEnabled());
}
1 change: 1 addition & 0 deletions test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ test("brave_unit_tests") {
"//brave/chromium_src/chrome/browser/external_protocol/external_protocol_handler_unittest.cc",
"//brave/chromium_src/chrome/browser/signin/account_consistency_disabled_unittest.cc",
"//brave/chromium_src/chrome/browser/ui/bookmarks/brave_bookmark_context_menu_controller_unittest.cc",
"//brave/chromium_src/components/metrics/enabled_state_provider_unittest.cc",
"//brave/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc",
"//brave/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc",
"//brave/chromium_src/components/version_info/brave_version_info_unittest.cc",
Expand Down

0 comments on commit 24c9541

Please sign in to comment.