Skip to content

Commit

Permalink
Merge pull request #2382 from brave/disable_lookalike_url_feature
Browse files Browse the repository at this point in the history
Disable lookalike url feature
  • Loading branch information
simonhong committed May 8, 2019
2 parents b6bf7c5 + 49677b6 commit 0d4e31f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
features::kDefaultEnableOopRasterization.name,
network::features::kNetworkService.name,
unified_consent::kUnifiedConsent.name,
features::kLookalikeUrlNavigationSuggestionsUI.name,
};

command_line.AppendFeatures(enabled_features, disabled_features);
Expand Down
27 changes: 25 additions & 2 deletions app/brave_main_delegate_browsertest.cc
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* 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/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/browser/domain_reliability/service_factory.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/unified_consent/feature.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/web_preferences.h"
#include "gpu/config/gpu_finch_features.h"
#include "services/network/public/cpp/features.h"

using BraveMainDelegateBrowserTest = InProcessBrowserTest;

IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DomainReliabilityServiceDisabled) {
IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest,
DomainReliabilityServiceDisabled) {
EXPECT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableDomainReliability));
EXPECT_FALSE(domain_reliability::DomainReliabilityServiceFactory::
Expand All @@ -28,3 +36,18 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisableHyperlinkAuditing) {
contents->GetRenderViewHost()->GetWebkitPreferences();
EXPECT_FALSE(prefs.hyperlink_auditing_enabled);
}

IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
const base::Feature* disabled_features[] = {
&autofill::features::kAutofillSaveCardSignInAfterLocalSave,
&autofill::features::kAutofillServerCommunication,
&features::kAudioServiceOutOfProcess,
&features::kDefaultEnableOopRasterization,
&network::features::kNetworkService,
&unified_consent::kUnifiedConsent,
&features::kLookalikeUrlNavigationSuggestionsUI,
};

for (const auto* feature : disabled_features)
EXPECT_FALSE(base::FeatureList::IsEnabled(*feature));
}

0 comments on commit 0d4e31f

Please sign in to comment.