| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Base class for linker-specific test cases. | 5 """Base class for linker-specific test cases. |
| 6 | 6 |
| 7 The custom dynamic linker can only be tested through a custom test case | 7 The custom dynamic linker can only be tested through a custom test case |
| 8 for various technical reasons: | 8 for various technical reasons: |
| 9 | 9 |
| 10 - It's an 'invisible feature', i.e. it doesn't expose a new API or | 10 - It's an 'invisible feature', i.e. it doesn't expose a new API or |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 from pylib.base import base_test_result | 48 from pylib.base import base_test_result |
| 49 | 49 |
| 50 ResultType = base_test_result.ResultType | 50 ResultType = base_test_result.ResultType |
| 51 | 51 |
| 52 _PACKAGE_NAME='org.chromium.content_linker_test_apk' | 52 _PACKAGE_NAME='org.chromium.content_linker_test_apk' |
| 53 _ACTIVITY_NAME='.ContentLinkerTestActivity' | 53 _ACTIVITY_NAME='.ContentLinkerTestActivity' |
| 54 _COMMAND_LINE_FILE='/data/local/tmp/content-linker-test-command-line' | 54 _COMMAND_LINE_FILE='/data/local/tmp/content-linker-test-command-line' |
| 55 | 55 |
| 56 # Path to the Linker.java source file. | 56 # Path to the Linker.java source file. |
| 57 _LINKER_JAVA_SOURCE_PATH = \ | 57 _LINKER_JAVA_SOURCE_PATH = \ |
| 58 'content/public/android/java/src/org/chromium/content/app/Linker.java' | 58 'content/public/android/java/src/' + \ |
| 59 'org/chromium/content_public/app/Linker.java' |
| 59 | 60 |
| 60 # A regular expression used to extract the browser shared RELRO configuration | 61 # A regular expression used to extract the browser shared RELRO configuration |
| 61 # from the Java source file above. | 62 # from the Java source file above. |
| 62 _RE_LINKER_BROWSER_CONFIG = \ | 63 _RE_LINKER_BROWSER_CONFIG = \ |
| 63 re.compile(r'.*BROWSER_SHARED_RELRO_CONFIG\s+=\s+' + \ | 64 re.compile(r'.*BROWSER_SHARED_RELRO_CONFIG\s+=\s+' + \ |
| 64 'BROWSER_SHARED_RELRO_CONFIG_(\S+)\s*;.*', | 65 'BROWSER_SHARED_RELRO_CONFIG_(\S+)\s*;.*', |
| 65 re.MULTILINE | re.DOTALL) | 66 re.MULTILINE | re.DOTALL) |
| 66 | 67 |
| 67 # Logcat filters used during each test. Only the 'chromium' one is really | 68 # Logcat filters used during each test. Only the 'chromium' one is really |
| 68 # needed, but the logs are added to the TestResult in case of error, and | 69 # needed, but the logs are added to the TestResult in case of error, and |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 # Note that this behaviour doesn't seem to happen when starting an | 548 # Note that this behaviour doesn't seem to happen when starting an |
| 548 # application 'normally', i.e. when using the application launcher to | 549 # application 'normally', i.e. when using the application launcher to |
| 549 # start the activity. | 550 # start the activity. |
| 550 logging.info('Ignoring system\'s low randomization of browser libraries' + | 551 logging.info('Ignoring system\'s low randomization of browser libraries' + |
| 551 ' for regular devices') | 552 ' for regular devices') |
| 552 | 553 |
| 553 if not renderer_status: | 554 if not renderer_status: |
| 554 return ResultType.FAIL, renderer_logs | 555 return ResultType.FAIL, renderer_logs |
| 555 | 556 |
| 556 return ResultType.PASS, logs | 557 return ResultType.PASS, logs |
| OLD | NEW |