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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/controllers/repaint_overlay_unittest.py

Issue 303223008: Overlay expected and actual repaint rects for LayoutTests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add several small features Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import optparse
6 import webkitpy.thirdparty.unittest2 as unittest
7
8 from webkitpy.layout_tests.controllers import repaint_overlay
9
10
11 EXPECTED_TEXT = """
12 (GraphicsLayer
13 (bounds 800.00 600.00)
14 (children 1
15 (GraphicsLayer
16 (bounds 800.00 600.00)
17 (contentsOpaque 1)
18 (drawsContent 1)
19 (repaint rects
20 (rect 8.00 108.00 100.00 100.00)
21 (rect 0.00 216.00 800.00 100.00)
22 )
23 )
24 )
25 )
26 """
27
28 ACTUAL_TEXT = """
29 (GraphicsLayer
30 (bounds 800.00 600.00)
31 (children 1
32 (GraphicsLayer
33 (bounds 800.00 600.00)
34 (contentsOpaque 1)
35 (drawsContent 1)
36 (repaint rects
37 (rect 0.00 216.00 800.00 100.00)
38 )
39 )
40 )
41 )
42 """
43
44
45 class TestRepaintOverlay(unittest.TestCase):
46 def test_result_contains_repaint_rects(self):
47 self.assertTrue(repaint_overlay.result_contains_repaint_rects(EXPECTED_T EXT))
48 self.assertTrue(repaint_overlay.result_contains_repaint_rects(ACTUAL_TEX T))
49 self.assertFalse(repaint_overlay.result_contains_repaint_rects('ABCD'))
50
51 def test_generate_repaint_overlay_html(self):
52 html = repaint_overlay.generate_repaint_overlay_html('test', ACTUAL_TEXT , EXPECTED_TEXT)
53 self.assertNotEqual(-1, html.find('expected_rects = [[8.00,108.00,100.00 ,100.00],[0.00,216.00,800.00,100.00]];'))
54 self.assertNotEqual(-1, html.find('actual_rects = [[0.00,216.00,800.00,1 00.00]];'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698