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

Issue 7104081: Browser Test (Prerendering) for Favicon (Closed)

Created:
9 years, 6 months ago by tburkard
Modified:
9 years, 6 months ago
CC:
chromium-reviews, tburkard+watch_chromium.org, cbentzel+watch_chromium.org
Visibility:
Public.

Description

Browser Test to verify that a favicon is being displayed correctly after a prerendered page is swapped in. R=dominich@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88527

Patch Set 1 #

Total comments: 3

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -14 lines) Patch
M chrome/browser/prerender/prerender_browsertest.cc View 1 10 chunks +34 lines, -14 lines 2 comments Download

Messages

Total messages: 13 (0 generated)
tburkard
Hi Dominic, ok, so I redid the change with Shishir's new option, and I also ...
9 years, 6 months ago (2011-06-09 09:38:20 UTC) #1
Paweł Hajdan Jr.
Drive-by with test comments. http://codereview.chromium.org/7104081/diff/1/chrome/browser/prerender/prerender_browsertest.cc File chrome/browser/prerender/prerender_browsertest.cc (right): http://codereview.chromium.org/7104081/diff/1/chrome/browser/prerender/prerender_browsertest.cc#newcode1355 chrome/browser/prerender/prerender_browsertest.cc:1355: 2000); No hardcoded timeouts please. ...
9 years, 6 months ago (2011-06-09 09:45:21 UTC) #2
tburkard
http://codereview.chromium.org/7104081/diff/1/chrome/browser/prerender/prerender_browsertest.cc File chrome/browser/prerender/prerender_browsertest.cc (right): http://codereview.chromium.org/7104081/diff/1/chrome/browser/prerender/prerender_browsertest.cc#newcode1355 chrome/browser/prerender/prerender_browsertest.cc:1355: 2000); On 2011/06/09 09:45:21, Paweł Hajdan Jr. wrote: > ...
9 years, 6 months ago (2011-06-09 09:51:16 UTC) #3
Paweł Hajdan Jr.
http://codereview.chromium.org/7104081/diff/1/chrome/browser/prerender/prerender_browsertest.cc File chrome/browser/prerender/prerender_browsertest.cc (right): http://codereview.chromium.org/7104081/diff/1/chrome/browser/prerender/prerender_browsertest.cc#newcode1355 chrome/browser/prerender/prerender_browsertest.cc:1355: 2000); On 2011/06/09 09:51:16, tburkard wrote: > On 2011/06/09 ...
9 years, 6 months ago (2011-06-09 09:55:58 UTC) #4
tburkard
Well, what if the test fails (because the icon does not appear)? In that case, ...
9 years, 6 months ago (2011-06-09 10:33:14 UTC) #5
Paweł Hajdan Jr.
On 2011/06/09 10:33:14, tburkard wrote: > Well, what if the test fails (because the icon ...
9 years, 6 months ago (2011-06-09 10:44:30 UTC) #6
dominich
LGTM Thanks for tidying up the access to the TestPrerenderContents.
9 years, 6 months ago (2011-06-09 14:43:33 UTC) #7
cbentzel
In the future, please hold off on committing until there is agreement from reviewers. I ...
9 years, 6 months ago (2011-06-09 15:41:03 UTC) #8
tburkard
I ran this test many times on trybots and it was not flaky. Should displaying ...
9 years, 6 months ago (2011-06-09 16:49:28 UTC) #9
Paweł Hajdan Jr.
http://codereview.chromium.org/7104081/diff/7001/chrome/browser/prerender/prerender_browsertest.cc File chrome/browser/prerender/prerender_browsertest.cc (right): http://codereview.chromium.org/7104081/diff/7001/chrome/browser/prerender/prerender_browsertest.cc#newcode1353 chrome/browser/prerender/prerender_browsertest.cc:1353: MessageLoopForUI::current()->PostDelayedTask( On 2011/06/09 15:41:04, cbentzel wrote: > I agree ...
9 years, 6 months ago (2011-06-09 19:29:20 UTC) #10
tburkard
Pawel, I will change the test to use a similar observer-triggered detection and eliminate the ...
9 years, 6 months ago (2011-06-10 11:50:53 UTC) #11
tburkard
Pawel/Chris: before I make the change: I am intending on modifying ui_test_utils.{cc,h}, and turn TitleWatcher ...
9 years, 6 months ago (2011-06-10 12:20:50 UTC) #12
Paweł Hajdan Jr.
9 years, 6 months ago (2011-06-10 16:50:18 UTC) #13
On Fri, Jun 10, 2011 at 14:20, Timo Burkard <tburkard@chromium.org> wrote:

> I am intending on modifying ui_test_utils.{cc,h}, and turn TitleWatcher
> into a GenericNotificationWatcher on a TabContents, and make a virtual =0
> method "HasInterestingNotificationBeenObserved()", and then TitleWatcher
> will derive from that and override HasInterestingNotificationBeenObserved to
> figure out if the title matche sthe expected one.


This will have a lot in common with the WindowedNotificationObserver, make
sure to unify that too.


> I will then provide another derived class FaviconWatcher that registers
> favicon changes, and by overriding the
> HasInterestingNotificationBeenObserved, checks whether the favicon is no
> valid.
>
> Does that sound like a reasonable approach?
>

Sure, sounds good.


> Or should I leave TitleWatcher alone, and duplicate the code and just make
> the few changes needed for my FavIcon stuff?  I figured I'd double check
> with you guys first.
>

I generally try to avoid duplication in testing utilities.


> Thanks.
>
> Timo
>
>
> On Fri, Jun 10, 2011 at 4:50 AM, Timo Burkard <tburkard@chromium.org>wrote:
>
>> Pawel, I will change the test to use a similar observer-triggered
>> detection and eliminate the timeout.  I will try to send out the change
>> today.
>>
>> Thanks.
>>
>> Timo
>>
>>
>> On Thu, Jun 9, 2011 at 12:29 PM, <phajdan.jr@chromium.org> wrote:
>>
>>>
>>> http://codereview.chromium.**org/7104081/diff/7001/chrome/**
>>>
browser/prerender/prerender_**browsertest.cc<http://codereview.chromium.org/7104081/diff/7001/chrome/browser/prerender/prerender_browsertest.cc>
>>> File chrome/browser/prerender/**prerender_browsertest.cc (right):
>>>
>>> http://codereview.chromium.**org/7104081/diff/7001/chrome/**
>>>
browser/prerender/prerender_**browsertest.cc#newcode1353<http://codereview.chromium.org/7104081/diff/7001/chrome/browser/prerender/prerender_browsertest.cc#newcode1353>
>>> chrome/browser/prerender/**prerender_browsertest.cc:1353:
>>> MessageLoopForUI::current()->**PostDelayedTask(
>>> On 2011/06/09 15:41:04, cbentzel wrote:
>>>
>>>> I agree with Pawel that this is pretty hairy.
>>>>
>>>
>>>  Could you do something like the TitleWatcher in
>>>>
http://codereview.chromium.**org/7046053/<http://codereview.chromium.org/7046...
listens for the
>>>>
>>> FAVICON_CHANGED
>>>
>>>> event instead?
>>>>
>>>
>>> Yes, that's what I'd like to see. Please do that. Also, I'm slightly
>>> annoyed that the change got committed with unresolved comments.
>>>
>>> Just a note: my comments about this code are not about flakiness, at
>>> least not directly. Waiting for a fixed amount of time and waiting for
>>> an event with a possibly similar timeout are essentially equally solid.
>>>
>>> However, waiting for a fixed amount of time is just wrong. It makes the
>>> test unnecessarily slow, and might encourage a bad test writing style.
>>> It does happen, and it does matter. When most Sleeps disappeared from
>>> the codebase, people stopped adding them to new tests (yes, I'm just
>>> watching _every_ test change, so this is all based on facts and data).
>>> This PostDelayedTask is essentially a Sleep, and that's what makes me
>>> unhappy.
>>>
>>> Finally, thank you for dealing with flaky tests - I appreciate that
>>> effort very much, and the goal of my comments is just to further
>>> increase the quality of the tests.
>>>
>>>
>>>
http://codereview.chromium.**org/7104081/<http://codereview.chromium.org/7104...
>>>
>>
>>
>

Powered by Google App Engine
This is Rietveld 408576698