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

Unified Diff: trunk/src/tools/telemetry/telemetry/core/tab.py

Issue 127533002: Revert 243469 "[telemetry] Implement per-pixel algorithms in Bit..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/tools/telemetry/telemetry/core/tab.py
===================================================================
--- trunk/src/tools/telemetry/telemetry/core/tab.py (revision 243477)
+++ trunk/src/tools/telemetry/telemetry/core/tab.py (working copy)
@@ -135,10 +135,9 @@
bitmap is a telemetry.core.Bitmap.
"""
content_box = None
- start_time = None
for timestamp, bmp in self.browser.platform.StopVideoCapture():
if not content_box:
- content_box, pixel_count = bmp.GetBoundingBox(
+ content_box = bmp.GetBoundingBox(
bitmap.RgbaColor(*_CONTENT_FLASH_COLOR), tolerance=4)
assert content_box, 'Failed to find tab contents in first video frame.'
@@ -146,26 +145,24 @@
# We assume arbitrarily that tabs are all larger than 200x200. If this
# fails it either means that assumption has changed or something is
# awry with our bounding box calculation.
- assert content_box[2] > 200 and content_box[3] > 200, \
- 'Unexpectedly small tab contents.'
- assert pixel_count > 0.75 * bmp.width * bmp.height, \
- 'Low count of pixels in tab contents matching expected color.'
+ assert content_box.width > 200 and content_box.height > 200, \
+ 'Unexpectedly small tab contents'
# Since Telemetry doesn't know how to resize the window, we assume
# that we should always get the same content box for a tab. If this
- # fails, it means either that assumption has changed or something is
+ # fails, it meas either that assumption has changed or something is
# awry with our bounding box calculation.
if self._previous_tab_contents_bounding_box:
assert self._previous_tab_contents_bounding_box == content_box, \
'Unexpected change in tab contents box.'
self._previous_tab_contents_bounding_box = content_box
+
continue
- elif not start_time:
- start_time = timestamp
+ bmp.Crop(content_box)
+ # TODO(tonyg): Translate timestamp into navigation timing space.
+ yield timestamp, bmp
- yield timestamp - start_time, bmp.Crop(*content_box)
-
def PerformActionAndWaitForNavigate(
self, action_function, timeout=DEFAULT_TAB_TIMEOUT):
"""Executes action_function, and waits for the navigation to complete.
« no previous file with comments | « trunk/src/tools/telemetry/telemetry/core/build_extension.py ('k') | trunk/src/tools/telemetry/telemetry/core/util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698