chrome/android/java/src/PRESUBMIT_test.py
def testFalsePositives(self):
    """Examples of when Notification.Builder should not be flagged."""
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile(
            'chrome/android/java/src/org/chromium/chrome/browser/notifications/'
            'ChromeNotificationWrapperBuilder.java',
            ['new Notification.Builder()']),
        MockFile(
            'chrome/android/java/src/org/chromium/chrome/browser/notifications/'
            'ChromeNotificationWrapperCompatBuilder.java',
            ['new NotificationCompat.Builder()']),
        MockFile('path/One.java', ['Notification.Builder']),
        MockFile('path/Two.java', ['// do not: new Notification.Builder()']),
        MockFile('path/Three.java',
                 ['/** NotificationWrapperBuilder',
                  ' * replaces: new Notification.Builder()']),
        MockFile('path/PRESUBMIT.py', ['new Notification.Builder()']),
        MockFile('path/Four.java', ['new NotificationCompat.Builder()'],
                 action='D'),
    ]
    errors = PRESUBMIT._CheckNotificationConstructors(
        mock_input, MockOutputApi())
    self.assertEqual(0, len(errors))
Examples of when Notification.Builder should not be flagged.
Examples of when Notification.Builder should not be flagged.
Examples of when Notification . Builder should not be flagged .
def testFalsePositives(self):
    mock_input = MockInputApi()
    mock_input.files = [
        MockFile(
            'chrome/android/java/src/org/chromium/chrome/browser/notifications/'
            'ChromeNotificationWrapperBuilder.java',
            ['new Notification.Builder()']),
        MockFile(
            'chrome/android/java/src/org/chromium/chrome/browser/notifications/'
            'ChromeNotificationWrapperCompatBuilder.java',
            ['new NotificationCompat.Builder()']),
        MockFile('path/One.java', ['Notification.Builder']),
        MockFile('path/Two.java', ['// do not: new Notification.Builder()']),
        MockFile('path/Three.java',
                 ['/** NotificationWrapperBuilder',
                  ' * replaces: new Notification.Builder()']),
        MockFile('path/PRESUBMIT.py', ['new Notification.Builder()']),
        MockFile('path/Four.java', ['new NotificationCompat.Builder()'],
                 action='D'),
    ]
    errors = PRESUBMIT._CheckNotificationConstructors(
        mock_input, MockOutputApi())
    self.assertEqual(0, len(errors))
def testFalsePositives ( self ) : mock_input = MockInputApi ( ) mock_input . files = [ MockFile ( 'chrome/android/java/src/org/chromium/chrome/browser/notifications/' 'ChromeNotificationWrapperBuilder.java' , [ 'new Notification.Builder()' ] ) , MockFile ( 'chrome/android/java/src/org/chromium/chrome/browser/notifications/' 'ChromeNotificationWrapperCompatBuilder.java' , [ 'new NotificationCompat.Builder()' ] ) , MockFile ( 'path/One.java' , [ 'Notification.Builder' ] ) , MockFile ( 'path/Two.java' , [ '// do not: new Notification.Builder()' ] ) , MockFile ( 'path/Three.java' , [ '/** NotificationWrapperBuilder' , ' * replaces: new Notification.Builder()' ] ) , MockFile ( 'path/PRESUBMIT.py' , [ 'new Notification.Builder()' ] ) , MockFile ( 'path/Four.java' , [ 'new NotificationCompat.Builder()' ] , action = 'D' ) , ] errors = PRESUBMIT . _CheckNotificationConstructors ( mock_input , MockOutputApi ( ) ) self . assertEqual ( 0 , len ( errors ) )
Examples of when Notification.Builder should not be flagged.
Examples of when Notification . Builder should not be flagged .
"""Examples of when Notification.Builder should not be flagged."""
self