Clean up ChunkedUpdateDrawingAreaProxy
[WebKit-https.git] / Tools / Scripts / webkitpy / layout_tests / port / webkit_unittest.py
1 #!/usr/bin/env python
2 # Copyright (C) 2010 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>, University of Szeged
3 #
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 #    notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 #    notice, this list of conditions and the following disclaimer in the
13 #    documentation and/or other materials provided with the distribution.
14 #
15 # THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
16 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
19 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27 import unittest
28
29 from webkitpy.layout_tests.port.webkit import WebKitPort
30
31
32 class TestWebKitPort(WebKitPort):
33     def __init__(self, symbol_list=None, feature_list=None):
34         self.symbol_list = symbol_list
35         self.feature_list = feature_list
36
37     def _runtime_feature_list(self):
38         return self.feature_list
39
40     def _supported_symbol_list(self):
41         return self.symbol_list
42
43     def _tests_for_other_platforms(self):
44         return ["media", ]
45
46     def _tests_for_disabled_features(self):
47         return ["accessibility", ]
48
49     def _skipped_file_paths(self):
50         return []
51
52 class WebKitPortTest(unittest.TestCase):
53
54     def test_skipped_directories_for_symbols(self):
55         supported_symbols = ["GraphicsLayer", "WebCoreHas3DRendering", "isXHTMLMPDocument", "fooSymbol"]
56         expected_directories = set(["mathml", "fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl", "http/tests/wml", "fast/wml", "wml", "fast/wcss"])
57         result_directories = set(TestWebKitPort(supported_symbols, None)._skipped_tests_for_unsupported_features())
58         self.assertEqual(result_directories, expected_directories)
59
60     def test_skipped_directories_for_features(self):
61         supported_features = ["Accelerated Compositing", "Foo Feature"]
62         expected_directories = set(["animations/3d", "transforms/3d"])
63         result_directories = set(TestWebKitPort(None, supported_features)._skipped_tests_for_unsupported_features())
64         self.assertEqual(result_directories, expected_directories)
65
66     def test_skipped_layout_tests(self):
67         self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(),
68                          set(["media", "accessibility"]))