Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 165393: Add a UI test for "Encoding" menu. Please see crbug.com/5515 for more details... (Closed)

Created:
11 years, 4 months ago by Johnny(Jianning) Ding
Modified:
9 years, 7 months ago
Reviewers:
jungshik at Google
CC:
chromium-reviews_googlegroups.com, xlyuan
Visibility:
Public.

Description

Add a UI test for "Encoding" menu. Please see crbug.com/5515 for more details.This change list is based on http://codereview.chromium.org/18417 which was written by xlyuan@chromiumBug=5515 ( http://crbug.com/5515 ) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24073

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 43

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1310 lines, -21 lines) Patch
A chrome/browser/browser_encoding_uitest.cc View 1 2 3 1 chunk +305 lines, -0 lines 0 comments Download
M chrome/browser/download/save_page_uitest.cc View 1 2 1 chunk +10 lines, -18 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/Big5.html View 4 1 chunk +17 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/EUC-JP.html View 4 1 chunk +24 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-13.html View 4 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-15.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-2.html View 4 1 chunk +105 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-4.html View 4 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-5.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-6.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-7.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/ISO-8859-8.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/KOI8-R.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/KOI8-U.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/Shift-JIS.html View 4 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/UTF-16LE.html View 4 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/UTF-8.html View 4 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/gb18030.html View 4 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/iso-8859-1.html View 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/macintosh.html View 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1250.html View 4 1 chunk +105 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1251.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1252.html View 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1253.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1254.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1255.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1256.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1257.html View 4 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-1258.html View 4 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-874.html View 4 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/alias_mapping/windows-949.html View 4 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/Big5_with_no_encoding_specified.html View 4 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/ISO-8859-5_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/ISO-8859-6_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/ISO-8859-7_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/ISO-8859-8_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/KOI8-R_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/Shift-JIS_with_no_encoding_specified.html View 4 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/UTF-8_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Big5_saved_from_no_encoding_specified.html View 4 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-5_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-6_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-7_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_ISO-8859-8_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_KOI8-R_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_Shift-JIS_saved_from_no_encoding_specified.html View 4 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_UTF-8_saved_from_no_encoding_specified.html View 4 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_gb18030_saved_from_no_encoding_specified.html View 4 1 chunk +19 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_iso-8859-1_saved_from_no_encoding_specified.html View 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1251_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1254_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1255_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-1256_saved_from_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/expected_results/expected_windows-949_saved_from_no_encoding_specified.html View 4 1 chunk +13 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/gb18030_with_no_encoding_specified.html View 4 1 chunk +20 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/iso-8859-1_with_no_encoding_specified.html View 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/windows-1251_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/windows-1254_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/windows-1255_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/windows-1256_with_no_encoding_specified.html View 4 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/auto_detect/windows-949_with_no_encoding_specified.html View 4 1 chunk +13 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/user_override/expected_gb18030_saved_from_iso88591_meta.html View 4 1 chunk +19 lines, -0 lines 0 comments Download
A chrome/test/data/encoding_tests/user_override/gb18030_with_iso88591_meta.html View 4 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/test/ui/ui_test.h View 1 2 3 2 chunks +19 lines, -0 lines 0 comments Download
M chrome/test/ui/ui_test.cc View 1 2 3 2 chunks +50 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Johnny(Jianning) Ding
11 years, 4 months ago (2009-08-12 18:46:23 UTC) #1
jungshik at Google
Sorry for the delay. Overall looks good. Let's go one more round. Thank you for ...
11 years, 4 months ago (2009-08-20 17:58:39 UTC) #2
Johnny(Jianning) Ding
Done, please take another look. Thanks! http://codereview.chromium.org/165393/diff/78/152 File chrome/browser/browser_encoding_uitest.cc (right): http://codereview.chromium.org/165393/diff/78/152#newcode1 Line 1: // Copyright ...
11 years, 4 months ago (2009-08-21 18:17:18 UTC) #3
jungshik at Google
LGTM Before checking this in, can you make these directory names shorter? encoding_alias_mapping ==> alias_mapping ...
11 years, 4 months ago (2009-08-21 20:18:53 UTC) #4
Johnny(Jianning) Ding
11 years, 4 months ago (2009-08-22 03:30:26 UTC) #5
Done.

On 2009/08/21 20:18:53, Jungshik Shin wrote:
> LGTM
> 
> Before checking this in, can you make these directory names shorter?
> 
> encoding_alias_mapping ==> alias_mapping
> encoding_auto_detect ==> auto_detect
> 
> They're already under encoding_tests directory so that I think we don't need
> 'encoding_'.  
> 
> Thank you !
> 
> On 2009/08/21 18:17:18, Johnny(Jianning) Ding wrote:
> > Done, please take another look. Thanks!
> > 
> > http://codereview.chromium.org/165393/diff/78/152
> > File chrome/browser/browser_encoding_uitest.cc (right):
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode1
> > Line 1: // Copyright (c) 2006-2008 The Chromium Authors. All rights
reserved.
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: should be just 2009, I guess because this is a new file.
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode26
> > Line 26: // Make sure the content of the page are expected
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: the page are as expected.
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode52
> > Line 52: // for more details.
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: Please, replace the above comment with the following:
> > > 
> > > TODO: 1. Some encodings are missing here. It'll be added later. See
> > > http://crbug.com/13306.
> > > 2. Add more files with multiple encoding name variants for each canonical
> > > encoding name). Webkit layout tests cover some, but testing in the UI test
> is
> > > also necessary.
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode66
> > Line 66: { L"encoding-windows-949.htm", L"windows-949" },
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > we don't want to expose 'windows-949', but I guess we do at the moment.
I'll
> > > take care of that in another bug. Don't worry about it here. 
> > > 
> > 
> > Thanks.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode67
> > Line 67: { L"encoding-Shift-JIS.htm", L"Shift_JIS" },
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: All these html files are in encoding_alias_mapping directory. Please,
> get
> > > rid  'encoding-' prefix of all html files. And, as a long time Unix/Linux
> > users,
> > > I'd prefer 'html' suffix to  'htm' suffix. 
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode113
> > Line 113: L"gb18030_content_with_encoding_iso88591.htm";
> > Your name is great. Thanks!
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: How about gb18030_with_iso88591_meta.html?  
> > > 
> > > Your current name seems contradictory (gb18030 content but encoding is
> > > iso-8859-1? I know what you meant, but still a bit strange). 
> > > 
> > > 
> > >
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode115
> > Line 115: L"expect_gb18030_content_save_from_iso88591.htm";
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: this one is tough....
> > > how about 
> > > gb18030_expected_from_iso88591_meta.html or
> > > 
> > > expected_gb18030_saved_from_iso88591_meta.html ? 
> > > 
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode127
> > Line 127: // Get the original defined encoding in the page.
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: Get the encoding declared in the page.
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode142
> > Line 142: // Dump the page, the content of dump page should be equal with
our
> > expected
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: should be identical to the expected result file, |expect...html|
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode146
> > Line 146: L"gb18030_content_with_encoding_iso88591_files";
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > I was a bit confused initially. Can you add a comment about this directory
> > (why
> > > we need to specify it)? 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode148
> > Line 148: SavePackage::SAVE_AS_COMPLETE_HTML));
> > We have to save it as complete HTML because Chrome re-writes the correct
meta
> > tag for charset declaration only when using this way. In here we need to
make
> > sure that the override encoding can be correctly serialized, so we use
> > SAVE_AS_COMPLETE_HTML.
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > Can we just use SAVE_AS_ONLY_HTML and get rid of |dir| above? 
> > > 
> > > Later, if we add test files with external resources (frames, javascript,
> css),
> > > we should use SAVE_AS_COMPLETE_HTML, but we don't do that now, do we? 
> > > 
> > > So, why don't you add a TODO comment and just use SAVE_AS_ONLY_HTML?
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode160
> > Line 160: // auto detect doesn't return right value for them
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: Change the comment as below:
> > > 
> > > The following encodings are excluded from the auto-detection test because
> it's
> > a
> > > known issue that the current encoding detector does not detect them:
> > ISO-8859-4,
> > > ISO-8859-13, .... windows-874, windows-1258, windows-1253
> > > 
> > > 
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode182
> > Line 182: { L"Big5_content_without_encoding_declaration.htm",
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: let's try to shorten filenames a little bit:
> > > 
> > > How about "Big5_with_no_encoding_specified.html"? We don't need 'content'.
 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode183
> > Line 183: L"expect_Big5_content_save_from_without_encoding_declaration.htm",
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: how about expected_Big5_saved_from_no_encoding_specified.html ? 
> > > 
> > > and you can make the same changes to all other file names below.
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode243
> > Line 243: bool new_encoding_auto_detect = false;
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > I'm at loss as to why you need these two variables rather than just
> > > encoding_auto_detection? 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode248
> > Line 248: // incorrectly decode the page.
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > This comment does not hold. You're not just testing Simplified Chinese
> > encodings
> > > here. Perhaps, you have to set  the default to one of encodings not
> supported
> > by
> > > the current auto-detector (that are excluded from this test). Let's set it
> to
> > > ISO-8859-4.
> > > 
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode262
> > Line 262: encoding_auto_detect));
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > you can call it with |false|, can't you?
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode273
> > Line 273: prefs::kWebKitUsesUniversalDetector, !encoding_auto_detect));
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > here again, you can just call it with |true|, can't you?
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/152#newcode280
> > Line 280: EXPECT_EQ(new_encoding_auto_detect, !encoding_auto_detect);
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > Getter can be called with |&encoding_auto_detection| and its result can be
> > > checked with EXPECT_TRUE, right? 
> > > 
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/153
> > File chrome/browser/download/save_page_uitest.cc (right):
> > 
> > http://codereview.chromium.org/165393/diff/78/153#newcode33
> > Line 33: const FilePath& expect_result_file) {
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: expected_result_file and expected_result_filepath
> > 
> > Done.
> > 
> > http://codereview.chromium.org/165393/diff/78/151
> > File chrome/test/ui/ui_test.h (right):
> > 
> > http://codereview.chromium.org/165393/diff/78/151#newcode266
> > Line 266: // Waits for a generated file ready, then check it with the
original
> > file
> > On 2009/08/20 17:58:39, Jungshik Shin wrote:
> > > nit: Wait for |generated_file| to be ready and then compare it with 
> > > |original_file| to see if they're identical or not if |compare_file| is
> true.
> > If
> > > need_equal is true, they need to be identical. Otherwise, they should be
> > > different.
> > 
> > Done.

Powered by Google App Engine
This is Rietveld 408576698