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

Issue 2008283002: Tool to generate screenshots of Chrome in various languages

Created:
4 years, 7 months ago by battre
Modified:
4 years, 4 months ago
Reviewers:
melandory
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Tool to generate screenshots of Chrome in various languages This tool allows us to easily create the same screenshot of a certain setup in all languages that are supported by Chrome (e.g. "Take a screenshot of the UMA settings in all languages."). BUG=614676

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+636 lines, -2 lines) Patch
A tools/privacy_whitepaper/OWNERS View 1 chunk +2 lines, -0 lines 0 comments Download
A tools/privacy_whitepaper/README.md View 1 chunk +63 lines, -0 lines 0 comments Download
A + tools/privacy_whitepaper/__init__.py View 1 chunk +3 lines, -2 lines 0 comments Download
A tools/privacy_whitepaper/environment.py View 1 chunk +139 lines, -0 lines 1 comment Download
A tools/privacy_whitepaper/generate_screenshots.py View 1 chunk +205 lines, -0 lines 1 comment Download
A tools/privacy_whitepaper/geolocation-icon.png View Binary file 0 comments Download
A tools/privacy_whitepaper/screenshot_generator.py View 1 chunk +224 lines, -0 lines 1 comment Download

Messages

Total messages: 5 (2 generated)
battre
Hi Tanja, could you please review this CL? Thanks, Dominic
4 years, 7 months ago (2016-05-25 11:11:35 UTC) #2
melandory
On 2016/05/25 11:11:35, battre wrote: > Hi Tanja, > > could you please review this ...
4 years, 6 months ago (2016-05-30 12:17:39 UTC) #3
melandory
4 years, 6 months ago (2016-05-30 13:51:49 UTC) #4
https://codereview.chromium.org/2008283002/diff/1/tools/privacy_whitepaper/en...
File tools/privacy_whitepaper/environment.py (right):

https://codereview.chromium.org/2008283002/diff/1/tools/privacy_whitepaper/en...
tools/privacy_whitepaper/environment.py:105: pyautogui.click(x = 746, y = 62)
nit: pyautogui.click( x = 57 if self.is_rtl_language else 62
                 y = 62)?

It's up to you, but I think python form of ternary operator makes it very
readable.

https://codereview.chromium.org/2008283002/diff/1/tools/privacy_whitepaper/ge...
File tools/privacy_whitepaper/generate_screenshots.py (right):

https://codereview.chromium.org/2008283002/diff/1/tools/privacy_whitepaper/ge...
tools/privacy_whitepaper/generate_screenshots.py:64:
self.GoTo("https://www.amazon.co.jp")
nit: I would make website prefix a class member, just to simplify editing in a
future in case one wanted to take screenshot of google.fr or google.co.jp. But
ignore if you think that readability of the current solution wins other
potentially non-existent problem I'm suggesting to solve :)

https://codereview.chromium.org/2008283002/diff/1/tools/privacy_whitepaper/sc...
File tools/privacy_whitepaper/screenshot_generator.py (right):

https://codereview.chromium.org/2008283002/diff/1/tools/privacy_whitepaper/sc...
tools/privacy_whitepaper/screenshot_generator.py:41: logging.log(SCRIPT_DEBUG,
"action: Click %s" % selector)
nit:
since it's python and you're using same pattern in many places (log+wait for
element), you can write decorator:
def LogAndWait(f):
  from functools import wraps
  @wraps(f)
  def wrapper(self, selector):
    logging.log(SCRIPT_DEBUG, "action: %s %s" % (f.__name__, selector))
    element = self.WaitUntilDisplayed(selector)
    return f(self, element)
  return wrapper

And then
@LogAndWait
def Click(self, element)

Powered by Google App Engine
This is Rietveld 408576698