Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 // ISO-8859-4 | 186 // ISO-8859-4 |
| 187 // ISO-8859-13 | 187 // ISO-8859-13 |
| 188 // KOI8-U | 188 // KOI8-U |
| 189 // macintosh | 189 // macintosh |
| 190 // windows-874 | 190 // windows-874 |
| 191 // windows-1252 | 191 // windows-1252 |
| 192 // windows-1253 | 192 // windows-1253 |
| 193 // windows-1257 | 193 // windows-1257 |
| 194 // windows-1258 | 194 // windows-1258 |
| 195 | 195 |
| 196 // For Hebrew, the expected encoding value is ISO-8859-8-I. See | 196 IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, TestEncodingAutoDetect) { |
| 197 // http://crbug.com/2927 for more details. | |
| 198 // | |
| 199 // This test is failing consistently on ChromeOS, see http://crbug.com/512996. | |
| 200 #if defined(OS_CHROMEOS) | |
| 201 #define MAYBE_TestEncodingAutoDetect DISABLED_TestEncodingAutoDetect | |
| 202 #else | |
| 203 #define MAYBE_TestEncodingAutoDetect TestEncodingAutoDetect | |
| 204 #endif | |
| 205 // TODO(phajdan.jr): See if fix for http://crbug.com/122053 would help here. | |
| 206 // Disabled to revert a depending Blink CL. crbug.com/328354, and | |
| 207 // crbug.com/510422. | |
| 208 IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, DISABLED_TestEncodingAutoDetect) { | |
| 209 struct EncodingAutoDetectTestData { | 197 struct EncodingAutoDetectTestData { |
| 210 const char* test_file_name; // File name of test data. | 198 const char* test_file_name; // File name of test data. |
| 211 const char* expected_result; // File name of expected results. | 199 const char* expected_result; // File name of expected results. |
| 212 const char* expected_encoding; // expected encoding. | 200 const char* expected_encoding; // expected encoding. |
| 213 }; | 201 }; |
| 214 const EncodingAutoDetectTestData kTestDatas[] = { | 202 const EncodingAutoDetectTestData kTestDatas[] = { |
| 215 { "Big5_with_no_encoding_specified.html", | 203 { "Big5_with_no_encoding_specified.html", |
| 216 "expected_Big5_saved_from_no_encoding_specified.html", | 204 "expected_Big5_saved_from_no_encoding_specified.html", |
| 217 "Big5" }, | 205 "Big5" }, |
| 218 { "gb18030_with_no_encoding_specified.html", | 206 { "gb18030_with_no_encoding_specified.html", |
| 219 "expected_gb18030_saved_from_no_encoding_specified.html", | 207 "expected_gb18030_saved_from_no_encoding_specified.html", |
| 220 "gb18030" }, | 208 "GBK" }, |
|
jungshik at Google
2016/09/01 09:04:59
nit:
Perhaps, it's nice to make the input file na
| |
| 221 { "iso-8859-1_with_no_encoding_specified.html", | 209 { "iso-8859-1_with_no_encoding_specified.html", |
| 222 "expected_iso-8859-1_saved_from_no_encoding_specified.html", | 210 "expected_iso-8859-1_saved_from_no_encoding_specified.html", |
| 223 "windows-1252" }, | 211 "windows-1252" }, |
| 224 { "ISO-8859-5_with_no_encoding_specified.html", | 212 { "ISO-8859-5_with_no_encoding_specified.html", |
| 225 "expected_ISO-8859-5_saved_from_no_encoding_specified.html", | 213 "expected_ISO-8859-5_saved_from_no_encoding_specified.html", |
| 226 "ISO-8859-5" }, | 214 "ISO-8859-5" }, |
| 227 { "ISO-8859-6_with_no_encoding_specified.html", | 215 { "ISO-8859-6_with_no_encoding_specified.html", |
| 228 "expected_ISO-8859-6_saved_from_no_encoding_specified.html", | 216 "expected_ISO-8859-6_saved_from_no_encoding_specified.html", |
| 229 "ISO-8859-6" }, | 217 "ISO-8859-6" }, |
| 230 { "ISO-8859-7_with_no_encoding_specified.html", | 218 { "ISO-8859-7_with_no_encoding_specified.html", |
| 231 "expected_ISO-8859-7_saved_from_no_encoding_specified.html", | 219 "expected_ISO-8859-7_saved_from_no_encoding_specified.html", |
| 232 "ISO-8859-7" }, | 220 "ISO-8859-7" }, |
| 233 { "ISO-8859-8_with_no_encoding_specified.html", | 221 { "ISO-8859-8_with_no_encoding_specified.html", |
| 234 "expected_ISO-8859-8_saved_from_no_encoding_specified.html", | 222 "expected_ISO-8859-8_saved_from_no_encoding_specified.html", |
| 235 "ISO-8859-8-I" }, | 223 "windows-1255" }, |
| 236 { "KOI8-R_with_no_encoding_specified.html", | 224 { "KOI8-R_with_no_encoding_specified.html", |
| 237 "expected_KOI8-R_saved_from_no_encoding_specified.html", | 225 "expected_KOI8-R_saved_from_no_encoding_specified.html", |
| 238 "KOI8-R" }, | 226 "KOI8-R" }, |
| 239 { "Shift-JIS_with_no_encoding_specified.html", | 227 { "Shift-JIS_with_no_encoding_specified.html", |
| 240 "expected_Shift-JIS_saved_from_no_encoding_specified.html", | 228 "expected_Shift-JIS_saved_from_no_encoding_specified.html", |
| 241 "Shift_JIS" }, | 229 "Shift_JIS" }, |
| 242 { "UTF-8_with_no_encoding_specified.html", | 230 { "UTF-8_with_no_encoding_specified.html", |
| 243 "expected_UTF-8_saved_from_no_encoding_specified.html", | 231 "expected_UTF-8_saved_from_no_encoding_specified.html", |
| 244 "UTF-8" }, | 232 "UTF-8" }, |
| 245 { "EUC-KR_with_no_encoding_specified.html", | 233 { "EUC-KR_with_no_encoding_specified.html", |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 | 277 |
| 290 // Dump the page, the content of dump page should be equal with our expect | 278 // Dump the page, the content of dump page should be equal with our expect |
| 291 // result file. | 279 // result file. |
| 292 base::FilePath expected_result_file_name = | 280 base::FilePath expected_result_file_name = |
| 293 base::FilePath().AppendASCII(kAutoDetectDir). | 281 base::FilePath().AppendASCII(kAutoDetectDir). |
| 294 AppendASCII(kExpectedResultDir). | 282 AppendASCII(kExpectedResultDir). |
| 295 AppendASCII(kTestDatas[i].expected_result); | 283 AppendASCII(kTestDatas[i].expected_result); |
| 296 SaveAndCompare(kTestDatas[i].test_file_name, expected_result_file_name); | 284 SaveAndCompare(kTestDatas[i].test_file_name, expected_result_file_name); |
| 297 } | 285 } |
| 298 } | 286 } |
| OLD | NEW |