-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Freetype crash regression test (uplift to 1.52.x) (#18372)
Uplift of #18338 (squashed) to beta
- Loading branch information
1 parent
0d742c0
commit f99664e
Showing
4 changed files
with
68 additions
and
0 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,45 @@ | ||
/* Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "base/path_service.h" | ||
#include "brave/components/constants/brave_paths.h" | ||
#include "chrome/test/base/in_process_browser_test.h" | ||
#include "chrome/test/base/ui_test_utils.h" | ||
#include "content/public/test/browser_test.h" | ||
#include "net/dns/mock_host_resolver.h" | ||
#include "net/test/embedded_test_server/embedded_test_server.h" | ||
#include "url/gurl.h" | ||
|
||
class FontBrowserTest : public InProcessBrowserTest { | ||
public: | ||
FontBrowserTest() : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { | ||
brave::RegisterPathProvider(); | ||
base::FilePath test_data_dir; | ||
base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir); | ||
https_server_.SetSSLConfig(net::EmbeddedTestServer::CERT_OK); | ||
https_server_.ServeFilesFromDirectory(test_data_dir); | ||
} | ||
|
||
~FontBrowserTest() override = default; | ||
|
||
void SetUpOnMainThread() override { | ||
InProcessBrowserTest::SetUpOnMainThread(); | ||
|
||
EXPECT_TRUE(https_server_.Start()); | ||
// Map all hosts to localhost. | ||
host_resolver()->AddRule("*", "127.0.0.1"); | ||
} | ||
|
||
protected: | ||
net::EmbeddedTestServer https_server_; | ||
}; | ||
|
||
IN_PROC_BROWSER_TEST_F(FontBrowserTest, FreetypeRegression) { | ||
// Loading this page on 1.50.121 on Linux crashed the tab. | ||
// See https://github.com/brave/brave-browser/issues/29893 | ||
// and https://bugs.chromium.org/p/chromium/issues/detail?id=1434194 | ||
const GURL url = https_server_.GetURL("/freetype-crash.html"); | ||
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); | ||
} |
Binary file not shown.
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,22 @@ | ||
<!DOCTYPE html> | ||
<html lang=en> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<style> | ||
/* Triggering version of Google Noto Sans VF */ | ||
@font-face { | ||
font-family: Noto Crash; | ||
src: url(NotoSans-VF.ttf) | ||
} | ||
select { | ||
font-family: Noto Crash; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<select> | ||
<!-- In this environment the tab crashed with the Noto variable font. --> | ||
<option>crash me</option> | ||
</select> | ||
</body> | ||
</html> |