Skip to content

Commit 545fa57

Browse files
mkarolinsangwoo108
andauthored
Don't call GetSessionRoute() when media router is disabled (#18245) (1.51.x). (#18264)
Don't call GetSessionRoute() when media router is disabled (#18245) Otherwise, it would end in reaching NOTREACHED() Co-authored-by: Sangwoo Ko <[email protected]>
1 parent 0fbe592 commit 545fa57

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Copyright (c) 2023 The Brave Authors. All rights reserved.
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
* You can obtain one at https://mozilla.org/MPL/2.0/. */
5+
6+
#include "chrome/browser/media/router/media_router_feature.h"
7+
#include "chrome/browser/ui/views/global_media_controls/media_item_ui_helper.h"
8+
9+
// Don't try to get session route when the feature is disabled. Upstream folks
10+
// seem to miss this.
11+
// https://github.com/brave/brave-browser/issues/29999
12+
#define GetSessionRoute(ID, ITEM, PROFILE) \
13+
media_router::MediaRouterEnabled(PROFILE) \
14+
? GetSessionRoute(ID, ITEM, PROFILE) \
15+
: absl::nullopt;
16+
17+
#include "src/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc"
18+
19+
#undef GetSessionRoute

test/filters/unit_tests.filter

+4
Original file line numberDiff line numberDiff line change
@@ -686,3 +686,7 @@
686686
# This test crashes because AutocompleteClassifier called when TabStripModel
687687
# was not initialized in test.
688688
-RenderViewContextMenuPrefsTest.ShowAllPasswordsIncognito
689+
690+
691+
# We changed the default value of media router to disabled, so the tests fail.
692+
-MediaDialogViewWithRemotePlaybackTest.*

0 commit comments

Comments
 (0)