Skip to content

Commit

Permalink
Merge pull request #342 from brave/disable_hyperlink_auditing
Browse files Browse the repository at this point in the history
Disable hyperlink auditing by appending kNoPings option
  • Loading branch information
bbondy authored Aug 20, 2018
2 parents 0126337 + d6ed3e5 commit ff3ef0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
command_line.AppendSwitch(switches::kEnableTabAudioMuting);
command_line.AppendSwitch(switches::kDisableDomainReliability);
command_line.AppendSwitch(switches::kDisableChromeGoogleURLTrackingClient);
command_line.AppendSwitch(switches::kNoPings);

std::stringstream enabled_features;
enabled_features << features::kEnableEmojiContextMenu.name
Expand Down
13 changes: 13 additions & 0 deletions app/brave_main_delegate_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
* 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_switches.h"
#include "chrome/browser/domain_reliability/service_factory.h"
#include "components/domain_reliability/service.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/web_preferences.h"

using BraveMainDelegateBrowserTest = InProcessBrowserTest;

Expand All @@ -16,3 +19,13 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DomainReliabilityServiceDis
ASSERT_EQ(domain_reliability::DomainReliabilityServiceFactory::GetForBrowserContext(
((content::BrowserContext *)browser()->profile())), nullptr);
}

IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisableHyperlinkAuditing) {
EXPECT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kNoPings));
content::WebContents* contents =
browser()->tab_strip_model()->GetActiveWebContents();
const content::WebPreferences prefs =
contents->GetRenderViewHost()->GetWebkitPreferences();
EXPECT_FALSE(prefs.hyperlink_auditing_enabled);
}

0 comments on commit ff3ef0d

Please sign in to comment.