| OLD | NEW |
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 import tempfile | 6 import tempfile |
| 7 | 7 |
| 8 from telemetry.core import exceptions |
| 9 from telemetry.core.platform import tracing_category_filter |
| 10 from telemetry.core.platform import tracing_options |
| 11 from telemetry.core import util |
| 12 from telemetry.core import video |
| 8 from telemetry import decorators | 13 from telemetry import decorators |
| 9 from telemetry.image_processing import image_util | 14 from telemetry.image_processing import image_util |
| 10 from telemetry.image_processing import rgba_color | 15 from telemetry.image_processing import rgba_color |
| 11 from telemetry.core import exceptions | |
| 12 from telemetry.core import util | |
| 13 from telemetry.core import video | |
| 14 from telemetry.core.platform import tracing_category_filter | |
| 15 from telemetry.core.platform import tracing_options | |
| 16 from telemetry.timeline import model | 16 from telemetry.timeline import model |
| 17 from telemetry.unittest_util import tab_test_case | 17 from telemetry.unittest_util import tab_test_case |
| 18 | 18 |
| 19 | 19 |
| 20 def _IsDocumentVisible(tab): | 20 def _IsDocumentVisible(tab): |
| 21 return not tab.EvaluateJavaScript('document.hidden || document.webkitHidden') | 21 return not tab.EvaluateJavaScript('document.hidden || document.webkitHidden') |
| 22 | 22 |
| 23 | 23 |
| 24 class FakePlatformBackend(object): | 24 class FakePlatformBackend(object): |
| 25 def __init__(self): | 25 def __init__(self): |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 assert screenshot is not None | 195 assert screenshot is not None |
| 196 image_util.GetPixelColor( | 196 image_util.GetPixelColor( |
| 197 screenshot, 0 * pixel_ratio, 0 * pixel_ratio).AssertIsRGB( | 197 screenshot, 0 * pixel_ratio, 0 * pixel_ratio).AssertIsRGB( |
| 198 0, 255, 0, tolerance=2) | 198 0, 255, 0, tolerance=2) |
| 199 image_util.GetPixelColor( | 199 image_util.GetPixelColor( |
| 200 screenshot, 31 * pixel_ratio, 31 * pixel_ratio).AssertIsRGB( | 200 screenshot, 31 * pixel_ratio, 31 * pixel_ratio).AssertIsRGB( |
| 201 0, 255, 0, tolerance=2) | 201 0, 255, 0, tolerance=2) |
| 202 image_util.GetPixelColor( | 202 image_util.GetPixelColor( |
| 203 screenshot, 32 * pixel_ratio, 32 * pixel_ratio).AssertIsRGB( | 203 screenshot, 32 * pixel_ratio, 32 * pixel_ratio).AssertIsRGB( |
| 204 255, 255, 255, tolerance=2) | 204 255, 255, 255, tolerance=2) |
| OLD | NEW |