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.
6 import webkitpy.thirdparty.unittest2 as unittest
8 from webkitpy.layout_tests.controllers import repaint_overlay
13 (bounds 800.00 600.00)
16 (bounds 800.00 600.00)
20 (rect 8.00 108.00 100.00 100.00)
21 (rect 0.00 216.00 800.00 100.00)
30 (bounds 800.00 600.00)
33 (bounds 800.00 600.00)
37 (rect 0.00 216.00 800.00 100.00)
45 class TestRepaintOverlay(unittest.TestCase):
46 def test_result_contains_repaint_rects(self):
47 self.assertTrue(repaint_overlay.result_contains_repaint_rects(EXPECTED_TEXT))
48 self.assertTrue(repaint_overlay.result_contains_repaint_rects(ACTUAL_TEXT))
49 self.assertFalse(repaint_overlay.result_contains_repaint_rects('ABCD'))
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,100.00]];'))