chrome/android/java/src/PRESUBMIT_test.py
def testSuccess_WrongBuilderCheck(self):
    """Use of OS-dependent AlertDialog should not be flagged."""
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile('path/One.java',
                 ['import android.app.AlertDialog;',
                  'new AlertDialog.Builder()']),
        MockFile('path/Two.java',
                 ['import android.app.AlertDialog;',
                  'new AlertDialog.Builder(context);']),
    ]
    errors = PRESUBMIT._CheckAlertDialogBuilder(mock_input, MockOutputApi())
    self.assertEqual(1, len(errors))
    self.assertEqual(2, len(errors[0].items))
Use of OS-dependent AlertDialog should not be flagged.
Use of OS-dependent AlertDialog should not be flagged.
Use of OS - dependent AlertDialog should not be flagged .
def testSuccess_WrongBuilderCheck(self):
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile('path/One.java',
                 ['import android.app.AlertDialog;',
                  'new AlertDialog.Builder()']),
        MockFile('path/Two.java',
                 ['import android.app.AlertDialog;',
                  'new AlertDialog.Builder(context);']),
    ]
    errors = PRESUBMIT._CheckAlertDialogBuilder(mock_input, MockOutputApi())
    self.assertEqual(1, len(errors))
    self.assertEqual(2, len(errors[0].items))
def testSuccess_WrongBuilderCheck ( self ) : mock_input = MockInputApi ( ) mock_input . files = [ MockFile ( 'path/One.java' , [ 'import android.app.AlertDialog;' , 'new AlertDialog.Builder()' ] ) , MockFile ( 'path/Two.java' , [ 'import android.app.AlertDialog;' , 'new AlertDialog.Builder(context);' ] ) , ] errors = PRESUBMIT . _CheckAlertDialogBuilder ( mock_input , MockOutputApi ( ) ) self . assertEqual ( 1 , len ( errors ) ) self . assertEqual ( 2 , len ( errors [ 0 ] . items ) )
Use of OS-dependent AlertDialog should not be flagged.
Use of OS - dependent AlertDialog should not be flagged .
"""Use of OS-dependent AlertDialog should not be flagged."""
self