chrome/android/java/src/PRESUBMIT_test.py
def testFailure(self):
    """Use of CompatibleAlertDialogBuilder use is correctly flagged."""
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile('path/One.java',
                 ['import '
                  'org.chromium.ui.UiUtils.CompatibleAlertDialogBuilder;',
                  'new CompatibleAlertDialogBuilder()',
                  'A new line to make sure there is no duplicate error.']),
        MockFile('path/Two.java',
                 ['new UiUtils.CompatibleAlertDialogBuilder()']),
        MockFile('path/Three.java',
                 ['new UiUtils',
                  '.CompatibleAlertDialogBuilder(context)']),
        MockFile('path/Four.java',
                 ['new UiUtils',
                  '   .CompatibleAlertDialogBuilder()']),
    ]
    errors = PRESUBMIT._CheckCompatibleAlertDialogBuilder(
        mock_input, MockOutputApi())
    self.assertEqual(1, len(errors))
    self.assertEqual(4, len(errors[0].items))
    self.assertIn('One.java', errors[0].items[0])
    self.assertIn('Two.java', errors[0].items[1])
    self.assertIn('Three.java', errors[0].items[2])
    self.assertIn('Four.java', errors[0].items[3])
Use of CompatibleAlertDialogBuilder use is correctly flagged.
Use of CompatibleAlertDialogBuilder use is correctly flagged.
Use of CompatibleAlertDialogBuilder use is correctly flagged .
def testFailure(self):
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile('path/One.java',
                 ['import '
                  'org.chromium.ui.UiUtils.CompatibleAlertDialogBuilder;',
                  'new CompatibleAlertDialogBuilder()',
                  'A new line to make sure there is no duplicate error.']),
        MockFile('path/Two.java',
                 ['new UiUtils.CompatibleAlertDialogBuilder()']),
        MockFile('path/Three.java',
                 ['new UiUtils',
                  '.CompatibleAlertDialogBuilder(context)']),
        MockFile('path/Four.java',
                 ['new UiUtils',
                  '   .CompatibleAlertDialogBuilder()']),
    ]
    errors = PRESUBMIT._CheckCompatibleAlertDialogBuilder(
        mock_input, MockOutputApi())
    self.assertEqual(1, len(errors))
    self.assertEqual(4, len(errors[0].items))
    self.assertIn('One.java', errors[0].items[0])
    self.assertIn('Two.java', errors[0].items[1])
    self.assertIn('Three.java', errors[0].items[2])
    self.assertIn('Four.java', errors[0].items[3])
def testFailure ( self ) : mock_input = MockInputApi ( ) mock_input . files = [ MockFile ( 'path/One.java' , [ 'import ' 'org.chromium.ui.UiUtils.CompatibleAlertDialogBuilder;' , 'new CompatibleAlertDialogBuilder()' , 'A new line to make sure there is no duplicate error.' ] ) , MockFile ( 'path/Two.java' , [ 'new UiUtils.CompatibleAlertDialogBuilder()' ] ) , MockFile ( 'path/Three.java' , [ 'new UiUtils' , '.CompatibleAlertDialogBuilder(context)' ] ) , MockFile ( 'path/Four.java' , [ 'new UiUtils' , '   .CompatibleAlertDialogBuilder()' ] ) , ] errors = PRESUBMIT . _CheckCompatibleAlertDialogBuilder ( mock_input , MockOutputApi ( ) ) self . assertEqual ( 1 , len ( errors ) ) self . assertEqual ( 4 , len ( errors [ 0 ] . items ) ) self . assertIn ( 'One.java' , errors [ 0 ] . items [ 0 ] ) self . assertIn ( 'Two.java' , errors [ 0 ] . items [ 1 ] ) self . assertIn ( 'Three.java' , errors [ 0 ] . items [ 2 ] ) self . assertIn ( 'Four.java' , errors [ 0 ] . items [ 3 ] )
Use of CompatibleAlertDialogBuilder use is correctly flagged.
Use of CompatibleAlertDialogBuilder use is correctly flagged .
"""Use of CompatibleAlertDialogBuilder use is correctly flagged."""
self