-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes seg fault crash of BraveViewsDelegateViewLinuxBrowserTest.GetDe…
…faultWindowIconTest As @simonhong noted in his comments: "In test, our BraveViewsDelegateLinux isn't set because ChromeViewsDelegate is set at the very early state by AccessibilityChecker (subclass of ChromeViewsDelegate) in ctor of InProcessBrowserTest. Introduced in v68. To have a test, explicitly set views delegate by initializing here. This is only effective in release mode because initializing views delegate twice isn't allowed by dcheck." In c76 the crash happens due to us initializing BraveViewsDelegateLinux in the test. To work around it, override AccessibilityChecker to use BraveViewsDelegateLinux when building browser tests on linux. This also allows to run the test in debug(non-official) build.
- Loading branch information
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* 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/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_CHROME_TEST_VIEWS_ACCESSIBILITY_CHECKER_H_ | ||
#define BRAVE_CHROMIUM_SRC_CHROME_TEST_VIEWS_ACCESSIBILITY_CHECKER_H_ | ||
|
||
#include "chrome/browser/ui/views/chrome_views_delegate.h" | ||
|
||
#if defined(OS_LINUX) | ||
#include "brave/browser/ui/views/brave_views_delegate_linux.h" | ||
#define ChromeViewsDelegate BraveViewsDelegateLinux | ||
#endif | ||
#include "../../../../../chrome/test/views/accessibility_checker.h" | ||
#if defined(OS_LINUX) | ||
#undef ChromeViewsDelegate | ||
#endif | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_CHROME_TEST_VIEWS_ACCESSIBILITY_CHECKER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters