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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/bindings/generate_idl_diff_test.py

Issue 2169673003: Move bindings tooling scripts to Tools/Scripts/webkitpy/bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change-test
Patch Set: Move test Created 4 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import generate_idl_diff
7 import os 6 import os
8 import sys
9 import unittest 7 import unittest
10 8
11 from generate_idl_diff import DIFF_TAG 9 from webkitpy.bindings import generate_idl_diff
12 from generate_idl_diff import DIFF_TAG_DELETED 10 from webkitpy.bindings.generate_idl_diff import DIFF_TAG
13 from generate_idl_diff import DIFF_TAG_ADDED 11 from webkitpy.bindings.generate_idl_diff import DIFF_TAG_DELETED
12 from webkitpy.bindings.generate_idl_diff import DIFF_TAG_ADDED
14 13
15 14
16 testdata_path = os.path.join( 15 testdata_path = os.path.join(
17 os.path.dirname(os.path.realpath(__file__)), 'testdata') 16 os.path.dirname(os.path.realpath(__file__)), 'testdata')
18 old_data_path = os.path.join(testdata_path, 'old_chrome.json') 17 old_data_path = os.path.join(testdata_path, 'old_blink_idls.json')
19 new_data_path = os.path.join(testdata_path, 'new_chrome.json') 18 new_data_path = os.path.join(testdata_path, 'new_blink_idls.json')
20 19
21 20
22 class TestGenerateIDLDiff(unittest.TestCase): 21 class TestGenerateIDLDiff(unittest.TestCase):
23 22
24 def setUp(self): 23 def setUp(self):
25 old = generate_idl_diff.load_json_file('old_chrome.json') 24 old = generate_idl_diff.load_json_file(old_data_path)
26 new = generate_idl_diff.load_json_file('new_chrome.json') 25 new = generate_idl_diff.load_json_file(new_data_path)
27 self.diff = generate_idl_diff.interfaces_diff(old, new) 26 self.diff = generate_idl_diff.interfaces_diff(old, new)
28 27
29 def test_deleted_interface(self): 28 def test_deleted_interface(self):
30 self.assertTrue('AnimationEffectReadOnly' in self.diff) 29 self.assertTrue('AnimationEffectReadOnly' in self.diff)
31 deleted_interface = self.diff.get('AnimationEffectReadOnly') 30 deleted_interface = self.diff.get('AnimationEffectReadOnly')
32 self.assertIsNotNone(deleted_interface) 31 self.assertIsNotNone(deleted_interface)
33 self.assertEqual(deleted_interface.get(DIFF_TAG), DIFF_TAG_DELETED) 32 self.assertEqual(deleted_interface.get(DIFF_TAG), DIFF_TAG_DELETED)
34 33
35 def test_added_interface(self): 34 def test_added_interface(self):
36 self.assertTrue('AnimationEvent' in self.diff) 35 self.assertTrue('AnimationEvent' in self.diff)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 self.assertEqual(added['ExtAttributes'], []) 96 self.assertEqual(added['ExtAttributes'], [])
98 self.assertEqual(added['Arguments'], added_arguments) 97 self.assertEqual(added['Arguments'], added_arguments)
99 self.assertEqual(unchanged['Name'], 'drawArraysInstancedANGLE') 98 self.assertEqual(unchanged['Name'], 'drawArraysInstancedANGLE')
100 self.assertEqual(unchanged['Type'], 'void') 99 self.assertEqual(unchanged['Type'], 'void')
101 self.assertEqual(unchanged['ExtAttributes'], []) 100 self.assertEqual(unchanged['ExtAttributes'], [])
102 self.assertEqual(unchanged['Arguments'], unchanged_arguments) 101 self.assertEqual(unchanged['Arguments'], unchanged_arguments)
103 102
104 103
105 if __name__ == '__main__': 104 if __name__ == '__main__':
106 unittest.main() 105 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698