Add WebRtc logging in IpcPacketSocket when the socket is blocked or unblocked.
[chromium-blink-merge.git] / tools / json_schema_compiler / cpp_util_test.py
blobede309587f33b96322fe8c98ed55bd925fc1167f
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import cpp_util
7 import unittest
9 class CppUtilTest(unittest.TestCase):
10 def testClassname(self):
11 self.assertEquals('Permissions', cpp_util.Classname('permissions'))
12 self.assertEquals('UpdateAllTheThings',
13 cpp_util.Classname('updateAllTheThings'))
14 self.assertEquals('Aa_Bb_Cc', cpp_util.Classname('aa.bb.cc'))
16 def testNamespaceDeclaration(self):
17 self.assertEquals('namespace extensions {',
18 cpp_util.OpenNamespace('extensions').Render())
19 self.assertEquals('} // namespace extensions',
20 cpp_util.CloseNamespace('extensions').Render())
21 self.assertEquals('namespace extensions {\n'
22 'namespace gen {\n'
23 'namespace api {',
24 cpp_util.OpenNamespace('extensions::gen::api').Render())
25 self.assertEquals('} // namespace api\n'
26 '} // namespace gen\n'
27 '} // namespace extensions',
28 cpp_util.CloseNamespace('extensions::gen::api').Render())
30 if __name__ == '__main__':
31 unittest.main()