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

Issue 3529016: Make WaitForInfobarCount() robust (Closed)

Created:
10 years, 2 months ago by Nirnimesh
Modified:
9 years, 7 months ago
Reviewers:
John Grabowski
CC:
chromium-reviews, John Grabowski, anantha, Nirnimesh, Paweł Hajdan Jr.
Visibility:
Public.

Description

Make WaitForInfobarCount() robust Make WaitForInfobarCount() robust to failures in the case of missing tabs or windows. BUG= TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=62307

Patch Set 1 #

Total comments: 2

Patch Set 2 : assertWaitInfobarCount #

Total comments: 1

Patch Set 3 : expect_retval #

Total comments: 2

Patch Set 4 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -14 lines) Patch
M chrome/test/pyautolib/pyauto.py View 1 2 3 3 chunks +24 lines, -14 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Nirnimesh
http://codereview.chromium.org/3529016/diff/1/2 File chrome/test/pyautolib/pyauto.py (left): http://codereview.chromium.org/3529016/diff/1/2#oldcode645 chrome/test/pyautolib/pyauto.py:645: cmd_dict = { This was unused
10 years, 2 months ago (2010-10-06 19:18:41 UTC) #1
John Grabowski
Would prefer descriptive text that can be used for debugging to be printed with this ...
10 years, 2 months ago (2010-10-06 19:40:54 UTC) #2
Nirnimesh
John, this is a suggestive update. I've renamed WaitForInfobarCount to assertWaitForInfobarCount so that I can ...
10 years, 2 months ago (2010-10-07 02:42:25 UTC) #3
John Grabowski
I agree this is more complicated. It seems a little overkill. I like the method ...
10 years, 2 months ago (2010-10-07 05:02:51 UTC) #4
Nirnimesh
Added logging. Also, added |expect_retval| (defaulting to True) so that WaitUntil log last returned vs ...
10 years, 2 months ago (2010-10-07 21:33:34 UTC) #5
John Grabowski
10 years, 2 months ago (2010-10-07 21:49:42 UTC) #6
LGTM

http://codereview.chromium.org/3529016/diff/11001/12001
File chrome/test/pyautolib/pyauto.py (right):

http://codereview.chromium.org/3529016/diff/11001/12001#newcode296
chrome/test/pyautolib/pyauto.py:296: if (type(expect_retval) ==
types.BooleanType and bool(retval)) or \
Is the bool(retval) really necessary? 
The only difference between "if bool(retval)" and "if retval" is if it's a
negative number.  We don't care.  How about expected_retval=None.  Then

if (expected_retval == None) and retval:
  return True
if (expected_retval == retval:
  return True
...

http://codereview.chromium.org/3529016/diff/11001/12001#newcode299
chrome/test/pyautolib/pyauto.py:299: logging.debug('WaitUntil: Function %s still
waiting. '
This could be a LOT of logging.

I would prefer if this only logged (and always logged) if this function returns
False.

Powered by Google App Engine
This is Rietveld 408576698