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

Unified Diff: tools/telemetry/telemetry/core/tab_unittest.py

Issue 668753002: [Telemetry] Migrate bitmap.py from bitmaptools.cc to numpy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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
« no previous file with comments | « tools/telemetry/telemetry/core/bitmap_unittest.py ('k') | tools/telemetry/telemetry/core/video.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/tab_unittest.py
diff --git a/tools/telemetry/telemetry/core/tab_unittest.py b/tools/telemetry/telemetry/core/tab_unittest.py
index 44931cbcfc1e254dcb80abf9c0fcfde7d815fdd3..b7bd1901a09d95391fea4f96c6997d81557ac7fe 100644
--- a/tools/telemetry/telemetry/core/tab_unittest.py
+++ b/tools/telemetry/telemetry/core/tab_unittest.py
@@ -6,7 +6,8 @@ import logging
import tempfile
from telemetry import decorators
-from telemetry.core import bitmap
+from telemetry.image_processing import image_util
+from telemetry.image_processing import rgba_color
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core import video
@@ -111,8 +112,8 @@ class TabTest(tab_test_case.TabTestCase):
options.enable_chrome_trace = True
self._browser.platform.tracing_controller.Start(
options, tracing_category_filter.CreateNoOverheadFilter())
- self._tab.Highlight(bitmap.WEB_PAGE_TEST_ORANGE)
- self._tab.ClearHighlight(bitmap.WEB_PAGE_TEST_ORANGE)
+ self._tab.Highlight(rgba_color.WEB_PAGE_TEST_ORANGE)
+ self._tab.ClearHighlight(rgba_color.WEB_PAGE_TEST_ORANGE)
trace_data = self._browser.platform.tracing_controller.Stop()
timeline_model = model.TimelineModel(trace_data)
renderer_thread = timeline_model.GetRendererThreadFromTabId(
@@ -187,10 +188,13 @@ class GpuTabTest(tab_test_case.TabTestCase):
pixel_ratio = self._tab.EvaluateJavaScript('window.devicePixelRatio || 1')
screenshot = self._tab.Screenshot(5)
- assert screenshot
- screenshot.GetPixelColor(0 * pixel_ratio, 0 * pixel_ratio).AssertIsRGB(
- 0, 255, 0, tolerance=2)
- screenshot.GetPixelColor(31 * pixel_ratio, 31 * pixel_ratio).AssertIsRGB(
- 0, 255, 0, tolerance=2)
- screenshot.GetPixelColor(32 * pixel_ratio, 32 * pixel_ratio).AssertIsRGB(
- 255, 255, 255, tolerance=2)
+ assert screenshot is not None
+ image_util.GetPixelColor(
+ screenshot, 0 * pixel_ratio, 0 * pixel_ratio).AssertIsRGB(
+ 0, 255, 0, tolerance=2)
+ image_util.GetPixelColor(
+ screenshot, 31 * pixel_ratio, 31 * pixel_ratio).AssertIsRGB(
+ 0, 255, 0, tolerance=2)
+ image_util.GetPixelColor(
+ screenshot, 32 * pixel_ratio, 32 * pixel_ratio).AssertIsRGB(
+ 255, 255, 255, tolerance=2)
« no previous file with comments | « tools/telemetry/telemetry/core/bitmap_unittest.py ('k') | tools/telemetry/telemetry/core/video.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698