Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #17873 - Disable media router by default #9987

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Fix #17873 - Disable media router by default #9987

merged 1 commit into from
Sep 8, 2021

Conversation

jumde
Copy link
Contributor

@jumde jumde commented Sep 7, 2021

Resolves brave/brave-browser#17873

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  1. Open brave browser with a clean profile.
  2. Open the hamburger menu and verify that cast is not available
  3. Verify that SSDP requests are not initiated on start
  4. Navigate to brave://settings/extensions - Enable Media Router
  5. Verify that cast is available and functional.

@jumde jumde force-pushed the switch_cast branch 2 times, most recently from add7b40 to 119d40e Compare September 7, 2021 03:43
@jumde jumde marked this pull request as ready for review September 7, 2021 03:43
@jumde jumde requested a review from a team as a code owner September 7, 2021 03:43
@jumde jumde requested a review from mariospr September 7, 2021 03:43
Copy link
Contributor

@mariospr mariospr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Also, tested locally and can confirm that no SSDP requests to 239.255.255.250:1900 are made when the feature is left at its default value, or disabled, and that the Cast option is not shown either. All those things work only when the feature is explicitly enabled now.


bool MediaRouterEnabled(content::BrowserContext* context) {
#if !defined(OS_ANDROID)
if (!base::FeatureList::GetInstance()->IsFeatureOverridden(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe a small comment to clarify that this is done to override the default could be useful.

sub-label="$i18n{mediaRouterEnabledDesc}">
<template is="dom-if" if="[[shouldShowRestartForMediaRouter_(
prefs.media_router.enable_media_router.value)]]">
<cr-button on-click="restartBrowser_" slot="more-actions">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting, needs more indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Copy link
Contributor

@mariospr mariospr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jumde jumde merged commit 517a3cf into master Sep 8, 2021
@jumde jumde deleted the switch_cast branch September 8, 2021 15:12
brave-builds pushed a commit that referenced this pull request Sep 8, 2021
brave-builds pushed a commit that referenced this pull request Sep 8, 2021
@jumde jumde added this to the 1.31.x - Nightly milestone Sep 8, 2021
@stephendonner
Copy link
Contributor

Verified PASSED using

Brave 1.31.28 Chromium: 93.0.4577.63 (Official Build) nightly (x86_64)
Revision ff5c0da2ec0adeaed5550e6c7e98417dac77d98a-refs/branch-heads/4577@{#1135}
OS macOS Version 11.5.2 (Build 20G95)

Steps:

  1. clean profile
  2. launched Charles Proxy
  3. launched Brave
  4. confirmed that the Cast... menu was not present

Screen Shot 2021-09-08 at 3 45 08 PM

  1. using Charles Proxy, verified that SSDP requests are not initiated on start

Screen Shot 2021-09-08 at 3 47 42 PM

  1. loaded brave://settings/extensions and set Enable Media Router to on / enabled

Screen Shot 2021-09-08 at 3 49 09 PM

  1. confirmed that the Cast... menu item returned

Screen Shot 2021-09-08 at 3 49 20 PM

  1. loaded youtube.com, chose a video, and casted to my personal TV

Screen Shot 2021-09-08 at 3 50 23 PM

jumde pushed a commit that referenced this pull request Sep 9, 2021
jumde pushed a commit that referenced this pull request Sep 9, 2021
@kjozwiak
Copy link
Member

Verification PASSED on Win 10 x64 using the following build:

Brave | 1.31.33 Chromium: 93.0.4577.63 (Official Build) nightly (64-bit)
-- | --
Revision | ff5c0da2ec0adeaed5550e6c7e98417dac77d98a-refs/branch-heads/4577@{#1135}
OS | Windows 10 OS Version 2009 (Build 19042.1165)
  • ensured that Media Router is disabled by default via brave://settings/extensions
  • ensured that Cast isn't being displayed under the hamburger menu when Media Router is disabled
  • ensured that Cast is added into the hamburger menu once Media Router is enabled via brave://settings/extensions
  • ensured that selecting Cast opens the Cast Tab modal and lists all available devices that can cast
  • ensured that casting a video, entire device & file worked as expected
Casting from YT Same video on TV downstairs
casting Screen Shot 2021-09-11 at 10 12 45 PM
Casting video from local file Same video on TV downstairs
castingFile Screen Shot 2021-09-11 at 10 13 19 PM

Casting Desktop

Screen Shot 2021-09-11 at 10 13 01 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-network-audit Run network-audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable media-router by default
5 participants