Commit 65903dc5 authored by MozLando's avatar MozLando
Browse files

Merge #6385



6385: For #6384: Use uri as format argument in error pages description string r=Amejia481 a=mcarare
Co-authored-by: default avatarmcarare <mihai.carare.dev@gmail.com>
parents 021c4456 4d2214c7
......@@ -73,7 +73,7 @@ object ErrorPages {
): String {
val title = context.getString(errorType.titleRes)
val button = context.getString(errorType.refreshButtonRes)
val description = context.getString(errorType.messageRes)
val description = context.getString(errorType.messageRes, uri)
val imageName = if (errorType.imageNameRes != null) context.getString(errorType.imageNameRes) + ".svg" else ""
val badCertAdvanced = context.getString(R.string.mozac_browser_errorpages_security_bad_cert_advanced)
val badCertTechInfo = context.getString(R.string.mozac_browser_errorpages_security_bad_cert_techInfo,
......
......@@ -112,10 +112,12 @@ class ErrorPagesTest {
val htmlFilename = "htmlResource.html"
val uri = "sampleUri"
val errorPage = createUrlEncodedErrorPage(
context,
errorType,
null,
uri,
htmlFilename
)
......@@ -127,7 +129,7 @@ class ErrorPagesTest {
assertTrue(errorPage.startsWith("resource://android/assets/$htmlFilename"))
assertTrue(errorPage.contains("&button=${context.resources.getString(errorType.refreshButtonRes)}"))
assertTrue(errorPage.contains("&description=${context.resources.getString(errorType.messageRes)}"))
assertTrue(errorPage.contains("&description=${context.resources.getString(errorType.messageRes, uri)}"))
assertTrue(errorPage.contains("&image=$expectedImageName"))
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment