| 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.
|
|
|