chrome/android/java/src/PRESUBMIT_test.py
def testTruePositives(self):
    """Examples of when AlertDialog.Builder use is correctly flagged."""
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile('path/One.java', ['new AlertDialog.Builder()']),
        MockFile('path/Two.java', ['new AlertDialog.Builder(context);']),
    ]
    errors = PRESUBMIT._CheckAlertDialogBuilder(mock_input, MockOutputApi())
    self.assertEqual(1, len(errors))
    self.assertEqual(2, len(errors[0].items))
    self.assertIn('One.java', errors[0].items[0])
    self.assertIn('Two.java', errors[0].items[1])
Examples of when AlertDialog.Builder use is correctly flagged.
Examples of when AlertDialog.Builder use is correctly flagged.
Examples of when AlertDialog . Builder use is correctly flagged .
def testTruePositives(self):
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile('path/One.java', ['new AlertDialog.Builder()']),
        MockFile('path/Two.java', ['new AlertDialog.Builder(context);']),
    ]
    errors = PRESUBMIT._CheckAlertDialogBuilder(mock_input, MockOutputApi())
    self.assertEqual(1, len(errors))
    self.assertEqual(2, len(errors[0].items))
    self.assertIn('One.java', errors[0].items[0])
    self.assertIn('Two.java', errors[0].items[1])
def testTruePositives ( self ) : mock_input = MockInputApi ( ) mock_input . files = [ MockFile ( 'path/One.java' , [ 'new AlertDialog.Builder()' ] ) , MockFile ( 'path/Two.java' , [ 'new AlertDialog.Builder(context);' ] ) , ] errors = PRESUBMIT . _CheckAlertDialogBuilder ( mock_input , MockOutputApi ( ) ) self . assertEqual ( 1 , len ( errors ) ) self . assertEqual ( 2 , len ( errors [ 0 ] . items ) ) self . assertIn ( 'One.java' , errors [ 0 ] . items [ 0 ] ) self . assertIn ( 'Two.java' , errors [ 0 ] . items [ 1 ] )
Examples of when AlertDialog.Builder use is correctly flagged.
Examples of when AlertDialog . Builder use is correctly flagged .
"""Examples of when AlertDialog.Builder use is correctly flagged."""
self