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

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: Addressing feedback, moved maps test to different CL 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
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 33c476e5d76d4de9c1aaba430aab5783bf1ebc2a..f7c1a101624d7d6a19f596affd5863da54bd526e 100644
--- a/tools/telemetry/telemetry/inspector_page_unittest.py
+++ b/tools/telemetry/telemetry/inspector_page_unittest.py
@@ -24,6 +24,18 @@ class InspectorPageTest(tab_test_case.TabTestCase):
self._tab.page.Navigate('http://23f09f0f9fsdflajsfaldfkj2f3f.com')
self._tab.WaitForDocumentReadyStateToBeComplete()
+ def testScreenshot(self):
+ unittest_data_dir = os.path.join(os.path.dirname(__file__),
nduca 2012/11/12 19:53:26 What happens if we run this on an old browser? E.g
+ '..', 'unittest_data')
+ self._browser.SetHTTPServerDirectory(unittest_data_dir)
+ self._tab.page.Navigate(
+ self._browser.http_server.UrlOf('green_page.html'))
+ self._tab.WaitForDocumentReadyStateToBeComplete()
+ screenshot = self._tab.page.Screenshot()
+ self.assertTrue(screenshot.GetPixelColor(0, 0).CheckRGB(0, 255, 0))
+ self.assertTrue(screenshot.GetPixelColor(32, 32).CheckRGB(0, 255, 0))
+ self.assertTrue(screenshot.GetPixelColor(33, 33).CheckRGB(255, 255, 255))
+
def testCustomActionToNavigate(self):
unittest_data_dir = os.path.join(os.path.dirname(__file__),
'..', 'unittest_data')

Powered by Google App Engine
This is Rietveld 408576698