Commit 51a1d052 authored by jshin's avatar jshin Committed by Commit bot

Prepare for ISO-8859-1 to windows-1252 switch

The following Blink CL will make 'windows-1252' the canonical name
for 'ISO-8859-1', 'US-ASCII' and 'windows-1252'. All three will be
treated synonymously per the WHATWG Encoding spec.

   https://codereview.chromium.org/655083002/

We have some test results with 'ISO-8859-1'. Change them to use
windows-1252 and disable them before landing the above Blink CL.

For PrefsTabHelperBrowserTest.WebPrefs, I made the test more robust
by setting 'windows-1251' (not '1252') as the default charset in
the Test Preference file.

Once the Blink CL is landed and rolled, we'll re-enable the disabled
tests as a part of the following Cr CL:
  https://codereview.chromium.org/649413002/ ,
which rolls ICU 52 to the latest revision (the other side of
ISO-8859-1 to windows-1252 transition).

TBR=jochen,rdsmith,mnissler,jsbell
BUG=412053
TEST=browser_tests the following tests (before and after the Blink roll)
    BrowserEncodingTest.TestEncodingAutoDetect
    BrowserEncodingTest.TestOverrideEncoding
    EncodingAliases/BrowserEncodingTest.TestEncodingAliasMapping
    SavePageBrowserTest.FileNameFromPageTitle
    SavePageBrowserTest.SaveCompleteHTML
    PrefsTabHelperBrowserTest.WebPrefs

Review URL: https://codereview.chromium.org/643993004

Cr-Commit-Position: refs/heads/master@{#300069}
parent 91d3b693
......@@ -36,7 +36,11 @@ const EncodingTestData kEncodingTestDatas[] = {
{ "Big5.html", "Big5" },
{ "EUC-JP.html", "EUC-JP" },
{ "gb18030.html", "gb18030" },
{ "iso-8859-1.html", "ISO-8859-1" },
#if 0
// Disable temporarily until Blink CL
// (https://codereview.chromium.org/655083002/) is relanded.
{ "iso-8859-1.html", "windows-1252" },
#endif
{ "ISO-8859-2.html", "ISO-8859-2" },
{ "ISO-8859-4.html", "ISO-8859-4" },
{ "ISO-8859-5.html", "ISO-8859-5" },
......@@ -49,7 +53,10 @@ const EncodingTestData kEncodingTestDatas[] = {
{ "KOI8-U.html", "KOI8-U" },
{ "macintosh.html", "macintosh" },
{ "Shift-JIS.html", "Shift_JIS" },
{ "US-ASCII.html", "ISO-8859-1" }, // http://crbug.com/15801
#if 0
// See the above.
{ "US-ASCII.html", "windows-1252" }, // http://crbug.com/15801
#endif
{ "UTF-8.html", "UTF-8" },
{ "UTF-16LE.html", "UTF-16LE" },
{ "windows-874.html", "windows-874" },
......@@ -189,7 +196,10 @@ IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, TestOverrideEncoding) {
ui_test_utils::NavigateToURL(browser(), url);
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ("ISO-8859-1", web_contents->GetEncoding());
#if 0
// Temporarily disable until the Blink CL to use windows-1252 is relanded.
EXPECT_EQ("windows-1252", web_contents->GetEncoding());
#endif
// Override the encoding to "gb18030".
const std::string selected_encoding =
......@@ -241,9 +251,12 @@ IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, MAYBE_TestEncodingAutoDetect) {
{ "gb18030_with_no_encoding_specified.html",
"expected_gb18030_saved_from_no_encoding_specified.html",
"gb18030" },
#if 0
// Disable until the Blink CL to use 'windows-1252' is relanded.
{ "iso-8859-1_with_no_encoding_specified.html",
"expected_iso-8859-1_saved_from_no_encoding_specified.html",
"ISO-8859-1" },
"windows-1252" },
#endif
{ "ISO-8859-5_with_no_encoding_specified.html",
"expected_ISO-8859-5_saved_from_no_encoding_specified.html",
"ISO-8859-5" },
......
......@@ -561,9 +561,13 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, MAYBE_SaveCompleteHTML) {
EXPECT_TRUE(base::PathExists(full_file_name));
EXPECT_TRUE(base::PathExists(dir));
#if 0
// Disabled until the following Blink CL is relanded and rolled:
// https://codereview.chromium.org/649413002
EXPECT_TRUE(base::TextContentsEqual(
test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("b.saved1.htm"),
full_file_name));
#endif
EXPECT_TRUE(base::ContentsEqual(
test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.png"),
dir.AppendASCII("1.png")));
......@@ -657,9 +661,13 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, MAYBE_FileNameFromPageTitle) {
EXPECT_TRUE(base::PathExists(full_file_name));
EXPECT_TRUE(base::PathExists(dir));
#if 0
// Disabled until the following Blink CL is relanded and rolled:
// https://codereview.chromium.org/649413002
EXPECT_TRUE(base::TextContentsEqual(
test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("b.saved2.htm"),
full_file_name));
#endif
EXPECT_TRUE(base::ContentsEqual(
test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.png"),
dir.AppendASCII("1.png")));
......
......@@ -69,7 +69,7 @@ IN_PROC_BROWSER_TEST_F(PrefsTabHelperBrowserTest, WebPrefs) {
EXPECT_TRUE(prefs->FindPreference(
prefs::kWebKitSerifFontFamilyJapanese)->IsDefaultValue());
EXPECT_EQ("ISO-8859-1", prefs->GetString(prefs::kDefaultCharset));
EXPECT_EQ("windows-1251", prefs->GetString(prefs::kDefaultCharset));
EXPECT_EQ(16, prefs->GetInteger(prefs::kWebKitDefaultFontSize));
EXPECT_EQ("Nanum Gothic",
prefs->GetString(prefs::kWebKitStandardFontFamilyKorean));
......
{
"intl": {
"charset_default": "ISO-8859-1"
"charset_default": "windows-1251"
},
"webkit": {
"webprefs": {
......
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