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

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

Created:
3 years, 11 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. (Reland) 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. This is a reland of https://codereview.chromium.org/2601843002. It caused flakiness in a pair of ClickModifierTests, because I was wrong when removed the WaitForLoadStop call. After that the TitleWatcher could be created after the load start, but before the title arrives. In this case WebContents::GetTitle basically returns the url, and TitleWatcher was modified to simply return it. Turns out that waiting this way (without specific expectations) for a title can easily be done wrong, so I removed changes related to it. These tests now use TestNavigationObserver, which should be robust (unless there is some unrelated feature that can create WebContents at a random time, which I believe is not the case in chromium browser tests). The first patch set contains the original CL, the second one includes the fix. BUG=668707, 681035 Review-Url: https://codereview.chromium.org/2635933003 Cr-Commit-Position: refs/heads/master@{#444674} Committed: https://chromium.googlesource.com/chromium/src/+/29276c3a4db55690390a4a2c7d072f21cd7b34d9

Patch Set 1 #

Patch Set 2 : Fix ClickModifierTests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -53 lines) Patch
M chrome/browser/ui/browser_browsertest.cc View 1 3 chunks +8 lines, -10 lines 0 comments Download
M content/public/test/browser_test_base.cc View 1 chunk +8 lines, -1 line 0 comments Download
M content/public/test/browser_test_utils.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M content/public/test/browser_test_utils.cc View 1 4 chunks +8 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: 16 (9 generated)
Alexander Semashko
3 years, 11 months ago (2017-01-16 20:39:29 UTC) #5
Peter Kasting
LGTM
3 years, 11 months ago (2017-01-17 20:39:38 UTC) #8
Alexander Semashko
nasko, please take a look
3 years, 11 months ago (2017-01-18 17:08:15 UTC) #9
nasko
Surprised that only one test was using the title watcher for arbitrary title. Less code ...
3 years, 11 months ago (2017-01-18 23:44:19 UTC) #10
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/2635933003/20001
3 years, 11 months ago (2017-01-19 06:54:24 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/29276c3a4db55690390a4a2c7d072f21cd7b34d9
3 years, 11 months ago (2017-01-19 07:37:07 UTC) #15
Alexander Semashko
3 years, 11 months ago (2017-01-19 10:28:57 UTC) #16
Message was sent while issue was closed.
On 2017/01/18 23:44:19, nasko wrote:
> Surprised that only one test was using the title watcher for arbitrary title.
> Less code is always good, so thanks a lot!
> 
> LGTM

Actually, I just added it in the original CL, so there is no surprise :)

Powered by Google App Engine
This is Rietveld 408576698