OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 | 4 |
5 import optparse | 5 import unittest |
6 import webkitpy.thirdparty.unittest2 as unittest | |
7 | 6 |
8 from webkitpy.layout_tests.controllers import repaint_overlay | 7 from webkitpy.layout_tests.controllers import repaint_overlay |
9 | 8 |
10 | 9 |
11 LAYER_TREE = """{ | 10 LAYER_TREE = """{ |
12 "bounds":[800.00,600.00], | 11 "bounds":[800.00,600.00], |
13 "children":[ | 12 "children":[ |
14 { | 13 { |
15 "position": [8.00, 80.00], | 14 "position": [8.00, 80.00], |
16 "bounds": [800.00, 600.00], | 15 "bounds": [800.00, 600.00], |
17 "contentsOpaque": true, | 16 "contentsOpaque": true, |
18 "drawsContent": true, | 17 "drawsContent": true, |
19 "repaintRects": [ | 18 "repaintRects": [ |
20 [8, 108, 100, 100], | 19 [8, 108, 100, 100], |
21 [0, 216, 800, 100] | 20 [0, 216, 800, 100] |
22 ] | 21 ] |
23 } | 22 } |
24 ] | 23 ] |
25 } | 24 } |
26 """ | 25 """ |
27 | 26 |
28 class TestRepaintOverlay(unittest.TestCase): | 27 class TestRepaintOverlay(unittest.TestCase): |
29 def test_result_contains_repaint_rects(self): | 28 def test_result_contains_repaint_rects(self): |
30 self.assertTrue(repaint_overlay.result_contains_repaint_rects(LAYER_TREE
)) | 29 self.assertTrue(repaint_overlay.result_contains_repaint_rects(LAYER_TREE
)) |
31 self.assertFalse(repaint_overlay.result_contains_repaint_rects('ABCD')) | 30 self.assertFalse(repaint_overlay.result_contains_repaint_rects('ABCD')) |
32 | 31 |
33 def test_extract_layer_tree(self): | 32 def test_extract_layer_tree(self): |
34 self.assertEquals(LAYER_TREE, repaint_overlay.extract_layer_tree(LAYER_T
REE)) | 33 self.assertEquals(LAYER_TREE, repaint_overlay.extract_layer_tree(LAYER_T
REE)) |
OLD | NEW |