Commit 677891d2 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Update JavascriptAppModalDialog titles.

On titlecase systems the "www.example.com Says" heading is awkward, so
to end with the URL these are being replaced by "From www.example.com"
and corresponding "From an Example Page at www.example.com".

Bug: chromium:683346
Change-Id: Ie520328276259f787541a02e39ed725687c1dff6
Reviewed-on: https://chromium-review.googlesource.com/846249Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526642}
parent 5f090efa
......@@ -21,83 +21,83 @@ TEST(JavaScriptDialogManagerTest, GetTitle) {
const char* expected_android;
} cases[] = {
// Standard main frame alert.
{"http://foo.com/", "http://foo.com/", "foo.com Says", "foo.com says",
"foo.com says"},
{"http://foo.com/", "http://foo.com/", "From foo.com", "From foo.com",
"From foo.com"},
// Subframe alert from the same origin.
{"http://foo.com/1", "http://foo.com/2", "foo.com Says", "foo.com says",
"foo.com says"},
{"http://foo.com/1", "http://foo.com/2", "From foo.com", "From foo.com",
"From foo.com"},
// Subframe alert from a different origin.
{"http://foo.com/", "http://bar.com/", "An Embedded Page at bar.com Says",
"An embedded page at bar.com says", "An embedded page at bar.com says"},
{"http://foo.com/", "http://bar.com/", "From an Embedded Page at bar.com",
"From an embedded page at bar.com", "From an embedded page at bar.com"},
// file:
// - main frame:
{"file:///path/to/page.html", "file:///path/to/page.html",
"This Page Says", "This page says", "This page says"},
"From This Page", "From this page", "From this page"},
// - subframe:
{"http://foo.com/", "file:///path/to/page.html",
"An Embedded Page on This Page Says",
"An embedded page on this page says",
"An embedded page on this page says"},
"From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
// ftp:
// - main frame:
{"ftp://foo.com/path/to/page.html", "ftp://foo.com/path/to/page.html",
"foo.com Says", "foo.com says", "ftp://foo.com says"},
"From foo.com", "From foo.com", "From ftp://foo.com"},
// - subframe:
{"http://foo.com/", "ftp://foo.com/path/to/page.html",
"An Embedded Page at foo.com Says", "An embedded page at foo.com says",
"An embedded page at ftp://foo.com says"},
"From an Embedded Page at foo.com", "From an embedded page at foo.com",
"From an embedded page at ftp://foo.com"},
// data:
// - main frame:
{"data:blahblah", "data:blahblah", "This Page Says", "This page says",
"This page says"},
{"data:blahblah", "data:blahblah", "From This Page", "From this page",
"From this page"},
// - subframe:
{"http://foo.com/", "data:blahblah", "An Embedded Page on This Page Says",
"An embedded page on this page says",
"An embedded page on this page says"},
{"http://foo.com/", "data:blahblah", "From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
// javascript:
// - main frame:
{"javascript:abc", "javascript:abc", "This Page Says", "This page says",
"This page says"},
{"javascript:abc", "javascript:abc", "From This Page", "From this page",
"From this page"},
// - subframe:
{"http://foo.com/", "javascript:abc",
"An Embedded Page on This Page Says",
"An embedded page on this page says",
"An embedded page on this page says"},
"From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
// about:
// - main frame:
{"about:blank", "about:blank", "This Page Says", "This page says",
"This page says"},
{"about:blank", "about:blank", "From This Page", "From this page",
"From this page"},
// - subframe:
{"http://foo.com/", "about:blank", "An Embedded Page on This Page Says",
"An embedded page on this page says",
"An embedded page on this page says"},
{"http://foo.com/", "about:blank", "From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
// blob:
// - main frame:
{"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"foo.com Says", "foo.com says", "foo.com says"},
"From foo.com", "From foo.com", "From foo.com"},
// - subframe:
{"http://bar.com/",
"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"An Embedded Page at foo.com Says", "An embedded page at foo.com says",
"An embedded page at foo.com says"},
"From an Embedded Page at foo.com", "From an embedded page at foo.com",
"From an embedded page at foo.com"},
// filesystem:
// - main frame:
{"filesystem:http://foo.com/bar.html",
"filesystem:http://foo.com/bar.html", "foo.com Says", "foo.com says",
"foo.com says"},
"filesystem:http://foo.com/bar.html", "From foo.com", "From foo.com",
"From foo.com"},
// - subframe:
{"http://bar.com/", "filesystem:http://foo.com/bar.html",
"An Embedded Page at foo.com Says", "An embedded page at foo.com says",
"An embedded page at foo.com says"},
"From an Embedded Page at foo.com", "From an embedded page at foo.com",
"From an embedded page at foo.com"},
};
for (const auto& test_case : cases) {
......
......@@ -4,30 +4,30 @@
<!-- JavaScript Dialog Box strings -->
<if expr="not use_titlecase">
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
<ph name="SITE">$1<ex>http://www.google.com</ex></ph> says
From <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
An embedded page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph> says
From an embedded page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
This page says
From this page
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
An embedded page on this page says
From an embedded page on this page
</message>
</if>
<if expr="use_titlecase">
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
<ph name="SITE">$1<ex>http://www.google.com</ex></ph> Says
From <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
An Embedded Page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph> Says
From an Embedded Page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
This Page Says
From This Page
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
An Embedded Page on This Page Says
From an Embedded Page on This Page
</message>
</if>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION" desc="Optional UI shown on the message box, in the form of a checkbox, allowing the user to suppress additional message boxes from the page.">
......
Markdown is supported
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