| Index: build/android/gyp/java_cpp_enum_tests.py
|
| diff --git a/build/android/gyp/java_cpp_enum_tests.py b/build/android/gyp/java_cpp_enum_tests.py
|
| index 3444cfa254affb6369f18017e5b56d379cecc020..643a410d510c50082e54248726313dbfbe935d63 100755
|
| --- a/build/android/gyp/java_cpp_enum_tests.py
|
| +++ b/build/android/gyp/java_cpp_enum_tests.py
|
| @@ -26,7 +26,13 @@ class TestPreprocess(unittest.TestCase):
|
| def testOutput(self):
|
| definition = EnumDefinition(original_enum_name='ClassName',
|
| enum_package='some.package',
|
| - entries=[('E1', 1), ('E2', '2 << 2')])
|
| + entries=[('E1', 1), ('E2', '2 << 2')],
|
| + comments=[('E2', 'This is a comment.'),
|
| + ('E1', 'This is a multiple line '
|
| + 'comment that is really long. '
|
| + 'This is a multiple line '
|
| + 'comment that is really '
|
| + 'really long.')])
|
| output = GenerateOutput('path/to/file', definition)
|
| expected = """
|
| // Copyright %d The Chromium Authors. All rights reserved.
|
| @@ -51,11 +57,22 @@ public class ClassName {
|
| })
|
| @Retention(RetentionPolicy.SOURCE)
|
| public @interface ClassNameEnum {}
|
| + /**
|
| + * %s
|
| + * really really long.
|
| + */
|
| public static final int E1 = 1;
|
| + /**
|
| + * This is a comment.
|
| + */
|
| public static final int E2 = 2 << 2;
|
| }
|
| """
|
| - self.assertEqual(expected % (date.today().year, GetScriptName()), output)
|
| + long_comment = ('This is a multiple line comment that is really long. '
|
| + 'This is a multiple line comment that is')
|
| + self.assertEqual(
|
| + expected % (date.today().year, GetScriptName(), long_comment),
|
| + output)
|
|
|
| def testParseSimpleEnum(self):
|
| test_data = """
|
| @@ -134,6 +151,8 @@ public class ClassName {
|
| // GENERATED_JAVA_PREFIX_TO_STRIP: P_
|
| enum EnumTwo {
|
| P_A,
|
| + // This comment spans
|
| + // two lines.
|
| P_B
|
| };
|
| """.split('\n')
|
| @@ -145,10 +164,13 @@ public class ClassName {
|
| self.assertEqual(collections.OrderedDict([('A', '1'),
|
| ('B', 'A')]),
|
| definition.entries)
|
| -
|
| + self.assertEqual(collections.OrderedDict([('ENUM_ONE_B', 'Comment there')]),
|
| + definition.comments)
|
| definition = definitions[1]
|
| self.assertEqual('EnumTwo', definition.class_name)
|
| self.assertEqual('other.package', definition.enum_package)
|
| + self.assertEqual(collections.OrderedDict(
|
| + [('P_B', 'This comment spans two lines.')]), definition.comments)
|
| self.assertEqual(collections.OrderedDict([('A', 0),
|
| ('B', 1)]),
|
| definition.entries)
|
|
|