| 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 95730322d89642164b6e392d11665c1b21e4ea22..85caa36be176d6c29dcc9007b60e282cf9b24737 100644
|
| --- a/tools/telemetry/telemetry/core/tab_unittest.py
|
| +++ b/tools/telemetry/telemetry/core/tab_unittest.py
|
| @@ -21,6 +21,7 @@ def _IsDocumentVisible(tab):
|
|
|
|
|
| class FakePlatformBackend(object):
|
| +
|
| def __init__(self):
|
| self.platform = FakePlatform()
|
|
|
| @@ -32,6 +33,7 @@ class FakePlatformBackend(object):
|
|
|
|
|
| class FakePlatform(object):
|
| +
|
| def __init__(self):
|
| self._is_video_capture_running = False
|
|
|
| @@ -49,6 +51,7 @@ class FakePlatform(object):
|
|
|
|
|
| class TabTest(tab_test_case.TabTestCase):
|
| +
|
| def testNavigateAndWaitForCompleteState(self):
|
| self._tab.Navigate(self.UrlOfUnittestFile('blank.html'))
|
| self._tab.WaitForDocumentReadyStateToBeComplete()
|
| @@ -170,6 +173,7 @@ class TabTest(tab_test_case.TabTestCase):
|
|
|
|
|
| class GpuTabTest(tab_test_case.TabTestCase):
|
| +
|
| @classmethod
|
| def CustomizeBrowserOptions(cls, options):
|
| options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
|
| @@ -186,9 +190,10 @@ class GpuTabTest(tab_test_case.TabTestCase):
|
|
|
| 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)
|
| + self.assertTrue(bitmap.ColorsAreEqual(
|
| + screenshot.image[0 * pixel_ratio][0 * pixel_ratio], (0, 255, 0), 2))
|
| + self.assertTrue(bitmap.ColorsAreEqual(
|
| + screenshot.image[31 * pixel_ratio][31 * pixel_ratio], (0, 255, 0), 2))
|
| + self.assertTrue(bitmap.ColorsAreEqual(
|
| + screenshot.image[32 * pixel_ratio][32 * pixel_ratio],
|
| + (255, 255, 255), 2))
|
|
|