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

Issue 2601843002: Convert more test helpers to base::RunLoop, fix page title checks. (Closed)

Created:
3 years, 12 months ago by Alexander Semashko
Modified:
3 years, 11 months ago
Reviewers:
Peter Kasting, nasko
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Convert more test helpers to base::RunLoop, fix page title checks. This CL removes the "deferred quit" from most of the touched helpers. The exclusions are UrlCommitObserver and TestFrameNavigationObserver. They were already using immediate quit mode, so there is no change in their behavior, just cleanup. Regarding title checks in browser_browsertest.cc: in these tests there is no guarantee on when the new tab will start and stop loading. It can start loading after WindowedNotificationObserver::Wait returns; also it can stop loading while we're still inside it. We can explicitly wait for the title to handle all these cases, and this makes the call to WaitForLoadStop unnecessary. BUG=668707 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2601843002 Cr-Commit-Position: refs/heads/master@{#443395} Committed: https://chromium.googlesource.com/chromium/src/+/e7469132628fa7bd530d68c134e4159d2cfc1804

Patch Set 1 #

Patch Set 2 : Fix tests. #

Patch Set 3 : Revert changes in TestNavigationObserver. #

Patch Set 4 : Enable using bare RunLoop in cast_shell_browsertests and the like. #

Patch Set 5 : Remove unneeded call. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -51 lines) Patch
M chrome/browser/ui/browser_browsertest.cc View 1 2 3 4 3 chunks +9 lines, -6 lines 2 comments Download
M content/public/test/browser_test_base.cc View 1 2 3 1 chunk +8 lines, -1 line 0 comments Download
M content/public/test/browser_test_utils.h View 3 chunks +9 lines, -3 lines 0 comments Download
M content/public/test/browser_test_utils.cc View 1 4 chunks +14 lines, -13 lines 0 comments Download
M content/public/test/test_frame_navigation_observer.h View 2 chunks +3 lines, -2 lines 0 comments Download
M content/public/test/test_frame_navigation_observer.cc View 5 chunks +5 lines, -7 lines 0 comments Download
M content/public/test/test_utils.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/public/test/test_utils.cc View 3 chunks +9 lines, -9 lines 0 comments Download
M content/test/content_browser_test_utils_internal.h View 3 chunks +3 lines, -3 lines 0 comments Download
M content/test/content_browser_test_utils_internal.cc View 2 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 36 (27 generated)
Alexander Semashko
3 years, 12 months ago (2016-12-27 22:02:00 UTC) #5
nasko
LGTM
3 years, 11 months ago (2017-01-04 00:54:46 UTC) #17
Alexander Semashko
Peter, can you take a look at chrome/browser/ui/browser_browsertest.cc please?
3 years, 11 months ago (2017-01-12 15:36:30 UTC) #25
Peter Kasting
LGTM https://codereview.chromium.org/2601843002/diff/80001/chrome/browser/ui/browser_browsertest.cc File chrome/browser/ui/browser_browsertest.cc (right): https://codereview.chromium.org/2601843002/diff/80001/chrome/browser/ui/browser_browsertest.cc#newcode2446 chrome/browser/ui/browser_browsertest.cc:2446: } Nit: The preceding lines could optionally be ...
3 years, 11 months ago (2017-01-12 18:16:17 UTC) #26
Alexander Semashko
https://codereview.chromium.org/2601843002/diff/80001/chrome/browser/ui/browser_browsertest.cc File chrome/browser/ui/browser_browsertest.cc (right): https://codereview.chromium.org/2601843002/diff/80001/chrome/browser/ui/browser_browsertest.cc#newcode2446 chrome/browser/ui/browser_browsertest.cc:2446: } On 2017/01/12 18:16:17, Peter Kasting wrote: > Nit: ...
3 years, 11 months ago (2017-01-12 20:48:19 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2601843002/80001
3 years, 11 months ago (2017-01-12 20:49:04 UTC) #30
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/e7469132628fa7bd530d68c134e4159d2cfc1804
3 years, 11 months ago (2017-01-12 23:57:14 UTC) #34
xlai (Olivia)
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2630683003/ by xlai@chromium.org. ...
3 years, 11 months ago (2017-01-13 21:16:05 UTC) #35
gab
3 years, 11 months ago (2017-01-13 21:20:28 UTC) #36
Message was sent while issue was closed.
On 2017/01/13 21:16:05, xlai (Olivia) wrote:
> A revert of this CL (patchset #5 id:80001) has been created in
> https://codereview.chromium.org/2630683003/ by
https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=xlai@chromium.org.
> 
> The reason for reverting is: ClickModifierTest.WindowOpenBasicClickTest and
> ClickModifierTest.WindowOpenControlShiftClickTest become very flaky recently.
> Example builds are all
> recorded at crbug.com/681035.
> 
> By looking at the error log file
>
(https://build.chromium.org/p/chromium.win/builders/Win%207%20Tests%20x64%20%2...),
> I notice that
> the error comes from src\chrome\browser\ui\browser_browsertest.cc(2451) which
is
> recently modified by this CL. Therefore the revert.
> .

Agreed, was going to revert too, example failure:

ClickModifierTest.WindowOpenControlShiftClickTest (run #1):
[ RUN      ] ClickModifierTest.WindowOpenControlShiftClickTest
Xlib:  extension "RANDR" missing on display ":99".
Xlib:  extension "RANDR" missing on display ":99".
[8570:8570:0113/112014.368268:ERROR:variations_util.cc(102)] Missing Worker Pool
Configuration: Background
[8570:8570:0113/112014.417654:WARNING:audio_manager.cc(317)] Multiple instances
of AudioManager detected
[8570:8570:0113/112014.417772:WARNING:audio_manager.cc(278)] Multiple instances
of AudioManager detected
[8570:8570:0113/112014.840752:WARNING:password_store_factory.cc(247)] Using
basic (unencrypted) store for password storage. See
https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_s...
for more information about password storage options.
[8696:8696:0113/112015.175671:ERROR:variations_util.cc(102)] Missing Worker Pool
Configuration: RendererBackground
../../chrome/browser/ui/browser_browsertest.cc:2451: Failure
Value of: content::TitleWatcher(web_contents).WaitAndGetTitle()
  Actual: data:text/html,<title>New window!</title>this is the new window
Expected: expected_title
Which is: New window!

Powered by Google App Engine
This is Rietveld 408576698