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

Unified Diff: tools/telemetry/telemetry/inspector_page_unittest.py

Issue 11360172: Added Tab.SnapshotContent and MapsGL example to telemetry (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with master Created 8 years, 1 month 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/inspector_page.py ('k') | tools/telemetry/telemetry/inspector_runtime.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/inspector_page_unittest.py
diff --git a/tools/telemetry/telemetry/inspector_page_unittest.py b/tools/telemetry/telemetry/inspector_page_unittest.py
index 8bb9b99f730acd5df9e485cabc0cc27cba94cc74..1d214ab5c6455b71871db55bf85dc21837aeb7f4 100644
--- a/tools/telemetry/telemetry/inspector_page_unittest.py
+++ b/tools/telemetry/telemetry/inspector_page_unittest.py
@@ -43,3 +43,24 @@ class InspectorPageTest(tab_test_case.TabTestCase):
self.assertTrue(custom_action_called[0])
self.assertEquals(self._tab.runtime.Evaluate('document.location.pathname;'),
'/blank.html')
+
+class GpuInspectorPageTest(tab_test_case.TabTestCase):
+ def setUp(self):
+ self._extra_browser_args = ['--enable-gpu-benchmarking']
+ super(GpuInspectorPageTest, self).setUp()
+
+ def testScreenshot(self):
+ unittest_data_dir = os.path.join(os.path.dirname(__file__),
+ '..', 'unittest_data')
+ self._browser.SetHTTPServerDirectory(unittest_data_dir)
+ self._tab.page.Navigate(
+ self._browser.http_server.UrlOf('green_rect.html'))
+ self._tab.WaitForDocumentReadyStateToBeComplete()
+
+ # Skip this test if running against a browser without screenshot support
+ if self._tab.page.screenshot_supported:
+ screenshot = self._tab.page.Screenshot(5)
+ assert screenshot
+ screenshot.GetPixelColor(0, 0).AssertIsRGB(0, 255, 0)
+ screenshot.GetPixelColor(31, 31).AssertIsRGB(0, 255, 0)
+ screenshot.GetPixelColor(32, 32).AssertIsRGB(255, 255, 255)
« no previous file with comments | « tools/telemetry/telemetry/inspector_page.py ('k') | tools/telemetry/telemetry/inspector_runtime.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698