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

Issue 255057: Unit Test for Toggling of Encoding Auto-Detect (Closed)

Created:
11 years, 2 months ago by Roland
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org, tim (not reviewing)
Visibility:
Public.

Description

This is a (first) implementation for a UI test of ToggleEncodingAutoDetect(), as discussed in http://codereview.chromium.org/173265 . While the test (seems to) work as implemented (tested both Debug and Release builds), I would like to ask the reviewers to check and comment on those parts of the test that I marked as "Hack!". In detail: .) In order to check that disabling auto-detect doesn't result in a page load currently the test waits 500ms and checks whether a page load occurred. While this time frame should be sufficient, on heavily loaded try servers there might be cases where a page load would be triggered after 500ms in a failure case. I.e., the test isn't 100% reliable to flag such failures. However, I haven't yet found a better, more reliable approach. The following bullet point has been resolved: .) [REMOVED: There are 2 other cases where I added a pause of 100ms. Without that pause the test would often hang in the following WaitForNavigation(), waiting for a navigation that has already occurred. I have to admit that I don't fully understand how this can happen (can a navigation be so fast that the recorded time stays the same?). AFAICT those pauses are in a place where they shouldn't have another side-effect, but it's still a hackish solution.] UPDATE: cannot reproduce the above anymore. However, there still is flakiness on shutdown, although this doesn't seem to be caused by this test per se. I filed a separate bug for this - see http://code.google.com/p/chromium/issues/detail?id=24708 Any further input would be highly appreciated. (The patch set contains also a few remnants of the fix for the GetBooleanPreference parameter order issue, submitted at http://codereview.chromium.org/209029) BUG=23617 TEST=BrowserEncodingTest.TestToggleAutoDetect

Patch Set 1 #

Total comments: 5

Patch Set 2 : '' #

Patch Set 3 : UI test for ToggleEncodingAutoDetect... #

Total comments: 2

Patch Set 4 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -12 lines) Patch
M chrome/browser/automation/automation_provider.h View 1 2 3 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/automation/automation_provider.cc View 1 2 3 3 chunks +28 lines, -3 lines 0 comments Download
M chrome/browser/browser_encoding_uitest.cc View 1 2 3 2 chunks +89 lines, -2 lines 1 comment Download
M chrome/test/automation/automation_messages_internal.h View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M chrome/test/automation/tab_proxy.h View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/test/automation/tab_proxy.cc View 1 2 3 2 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Roland
As previously discussed (http://codereview.chromium.org/173265), I wrote a UI test for ToggleEncodingAutodetect. However, there are a ...
11 years, 2 months ago (2009-10-02 06:44:08 UTC) #1
Paweł Hajdan Jr.
Drive-by. http://codereview.chromium.org/255057/diff/1/5 File chrome/browser/browser_encoding_uitest.cc (right): http://codereview.chromium.org/255057/diff/1/5#newcode186 Line 186: WaitUntilTabCount(1); I don't understand why this WaitUntilTabCount(1) ...
11 years, 2 months ago (2009-10-03 16:47:01 UTC) #2
Roland
Uploaded a new patch set with some minor changes and comments, see the general description ...
11 years, 2 months ago (2009-10-13 13:27:32 UTC) #3
Roland Steiner
After more debugging it seems the flakiness stems from the leak detector running before everything ...
11 years, 1 month ago (2009-11-05 11:50:39 UTC) #4
Paweł Hajdan Jr.
Please fix the flakiness issue before committing. http://codereview.chromium.org/255057/diff/6001/7004 File chrome/browser/browser_encoding_uitest.cc (right): http://codereview.chromium.org/255057/diff/6001/7004#newcode187 Line 187: scoped_refptr<TabProxy> ...
11 years, 1 month ago (2009-11-05 11:56:28 UTC) #5
Roland Steiner
On 2009/11/05 11:56:28, Paweł Hajdan Jr. wrote: > http://codereview.chromium.org/255057/diff/6001/7004#newcode187 > Line 187: scoped_refptr<TabProxy> tab(GetActiveTab()); > ...
11 years, 1 month ago (2009-11-06 04:02:47 UTC) #6
Paweł Hajdan Jr.
LGTM On 2009/11/06 04:02:47, Roland Steiner wrote: > > http://codereview.chromium.org/255057/diff/6001/7004#newcode215 > > Line 215: EXPECT_TRUE(CrashAwareSleep(500)); ...
11 years, 1 month ago (2009-11-06 06:12:58 UTC) #7
Johnny(Jianning) Ding
On 2009/10/13 13:27:32, Roland wrote: > Uploaded a new patch set with some minor changes ...
11 years, 1 month ago (2009-11-07 11:02:25 UTC) #8
Johnny(Jianning) Ding
11 years, 1 month ago (2009-11-07 11:09:14 UTC) #9
Roland,

Thanks for writing this and sorry for being late response.
One style nit, please see below comments.

http://codereview.chromium.org/255057/diff/11001/11005
File chrome/browser/browser_encoding_uitest.cc (right):

http://codereview.chromium.org/255057/diff/11001/11005#newcode175
Line 175: // turn off auto-detect before loading the file
The first character should be in uppercase in comments, and according to team
style, the comments usually end with a period. (same on line 246)

Powered by Google App Engine
This is Rietveld 408576698