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

Side by Side Diff: tools/telemetry/telemetry/core/tab_unittest.py

Issue 19114006: Remove dwm function because it is going away in windows 8.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing telemetry test Created 7 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 import logging 4 import logging
5 import os 5 import os
6 import time
6 7
7 from telemetry.core import util 8 from telemetry.core import util
8 from telemetry.core import exceptions 9 from telemetry.core import exceptions
9 from telemetry.unittest import tab_test_case 10 from telemetry.unittest import tab_test_case
10 11
11 12
12 def _IsDocumentVisible(tab): 13 def _IsDocumentVisible(tab):
13 state = tab.EvaluateJavaScript('document.webkitVisibilityState') 14 state = tab.EvaluateJavaScript('document.webkitVisibilityState')
14 # TODO(dtu): Remove when crbug.com/166243 is fixed. 15 # TODO(dtu): Remove when crbug.com/166243 is fixed.
15 tab.Disconnect() 16 tab.Disconnect()
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return 65 return
65 66
66 unittest_data_dir = os.path.join(os.path.dirname(__file__), 67 unittest_data_dir = os.path.join(os.path.dirname(__file__),
67 '..', '..', 'unittest_data') 68 '..', '..', 'unittest_data')
68 self._browser.SetHTTPServerDirectories(unittest_data_dir) 69 self._browser.SetHTTPServerDirectories(unittest_data_dir)
69 self._tab.Navigate( 70 self._tab.Navigate(
70 self._browser.http_server.UrlOf('green_rect.html')) 71 self._browser.http_server.UrlOf('green_rect.html'))
71 self._tab.WaitForDocumentReadyStateToBeComplete() 72 self._tab.WaitForDocumentReadyStateToBeComplete()
72 pixel_ratio = self._tab.EvaluateJavaScript('window.devicePixelRatio || 1') 73 pixel_ratio = self._tab.EvaluateJavaScript('window.devicePixelRatio || 1')
73 74
75 # TODO(bajones): Sleep for a bit to counter BUG 260878.
76 time.sleep(0.5)
74 screenshot = self._tab.Screenshot(5) 77 screenshot = self._tab.Screenshot(5)
75 assert screenshot 78 assert screenshot
76 screenshot.GetPixelColor(0 * pixel_ratio, 0 * pixel_ratio).AssertIsRGB( 79 screenshot.GetPixelColor(0 * pixel_ratio, 0 * pixel_ratio).AssertIsRGB(
77 0, 255, 0, tolerance=2) 80 0, 255, 0, tolerance=2)
78 screenshot.GetPixelColor(31 * pixel_ratio, 31 * pixel_ratio).AssertIsRGB( 81 screenshot.GetPixelColor(31 * pixel_ratio, 31 * pixel_ratio).AssertIsRGB(
79 0, 255, 0, tolerance=2) 82 0, 255, 0, tolerance=2)
80 screenshot.GetPixelColor(32 * pixel_ratio, 32 * pixel_ratio).AssertIsRGB( 83 screenshot.GetPixelColor(32 * pixel_ratio, 32 * pixel_ratio).AssertIsRGB(
81 255, 255, 255, tolerance=2) 84 255, 255, 255, tolerance=2)
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698