| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Tests for jni_generator.py. | 6 """Tests for jni_generator.py. |
| 7 | 7 |
| 8 This test suite contains various tests for the JNI generator. | 8 This test suite contains various tests for the JNI generator. |
| 9 It exercises the low-level parser all the way up to the | 9 It exercises the low-level parser all the way up to the |
| 10 code generator and ensures the output matches a golden | 10 code generator and ensures the output matches a golden |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 return null; | 395 return null; |
| 396 } | 396 } |
| 397 @CalledByNative | 397 @CalledByNative |
| 398 private void activateHardwareAcceleration(final boolean activated, | 398 private void activateHardwareAcceleration(final boolean activated, |
| 399 final int iPid, final int iType, | 399 final int iPid, final int iType, |
| 400 final int iPrimaryID, final int iSecondaryID) { | 400 final int iPrimaryID, final int iSecondaryID) { |
| 401 if (!activated) { | 401 if (!activated) { |
| 402 return | 402 return |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 @CalledByNative |
| 406 public static @Status int updateStatus(@Status int status) { |
| 407 return getAndUpdateStatus(status); |
| 408 } |
| 405 @CalledByNativeUnchecked | 409 @CalledByNativeUnchecked |
| 406 private void uncheckedCall(int iParam); | 410 private void uncheckedCall(int iParam); |
| 407 | 411 |
| 408 @CalledByNative | 412 @CalledByNative |
| 409 public byte[] returnByteArray(); | 413 public byte[] returnByteArray(); |
| 410 | 414 |
| 411 @CalledByNative | 415 @CalledByNative |
| 412 public boolean[] returnBooleanArray(); | 416 public boolean[] returnBooleanArray(); |
| 413 | 417 |
| 414 @CalledByNative | 418 @CalledByNative |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 params=[Param(datatype='boolean', name='activated'), | 521 params=[Param(datatype='boolean', name='activated'), |
| 518 Param(datatype='int', name='iPid'), | 522 Param(datatype='int', name='iPid'), |
| 519 Param(datatype='int', name='iType'), | 523 Param(datatype='int', name='iType'), |
| 520 Param(datatype='int', name='iPrimaryID'), | 524 Param(datatype='int', name='iPrimaryID'), |
| 521 Param(datatype='int', name='iSecondaryID'), | 525 Param(datatype='int', name='iSecondaryID'), |
| 522 ], | 526 ], |
| 523 env_call=('Void', ''), | 527 env_call=('Void', ''), |
| 524 unchecked=False, | 528 unchecked=False, |
| 525 ), | 529 ), |
| 526 CalledByNative( | 530 CalledByNative( |
| 531 return_type='int', |
| 532 system_class=False, |
| 533 static=True, |
| 534 name='updateStatus', |
| 535 method_id_var_name='updateStatus', |
| 536 java_class_name='', |
| 537 params=[Param(datatype='int', name='status')], |
| 538 env_call=('Integer', ''), |
| 539 unchecked=False, |
| 540 ), |
| 541 CalledByNative( |
| 527 return_type='void', | 542 return_type='void', |
| 528 system_class=False, | 543 system_class=False, |
| 529 static=False, | 544 static=False, |
| 530 name='uncheckedCall', | 545 name='uncheckedCall', |
| 531 method_id_var_name='uncheckedCall', | 546 method_id_var_name='uncheckedCall', |
| 532 java_class_name='', | 547 java_class_name='', |
| 533 params=[Param(datatype='int', name='iParam')], | 548 params=[Param(datatype='int', name='iParam')], |
| 534 env_call=('Void', ''), | 549 env_call=('Void', ''), |
| 535 unchecked=True, | 550 unchecked=True, |
| 536 ), | 551 ), |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 test_result = unittest.main(argv=argv[0:1], exit=False) | 1060 test_result = unittest.main(argv=argv[0:1], exit=False) |
| 1046 | 1061 |
| 1047 if test_result.result.wasSuccessful() and options.stamp: | 1062 if test_result.result.wasSuccessful() and options.stamp: |
| 1048 TouchStamp(options.stamp) | 1063 TouchStamp(options.stamp) |
| 1049 | 1064 |
| 1050 return not test_result.result.wasSuccessful() | 1065 return not test_result.result.wasSuccessful() |
| 1051 | 1066 |
| 1052 | 1067 |
| 1053 if __name__ == '__main__': | 1068 if __name__ == '__main__': |
| 1054 sys.exit(main(sys.argv)) | 1069 sys.exit(main(sys.argv)) |
| OLD | NEW |