diff options
author | Patrik Höglund <phoglund@webrtc.org> | 2020-03-27 09:11:30 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-27 08:47:44 +0000 |
commit | e4ae1ced9d561dc31b563a1388327b33adc17ed0 (patch) | |
tree | 2a1173e6372dad3d940d8c1ce684dfb1dbe0a6e7 /audio | |
parent | ef60c2b0adcbda349193e87c8e6523536fc1fa08 (diff) | |
download | webrtc-e4ae1ced9d561dc31b563a1388327b33adc17ed0.tar.gz |
Reland: Add in missing protobuf code.
Turns out the import of histogram_pb2 failed not on the stub itself
(which I thought for a long, long time), but because of the protobuf
support code it includes in turn. This is a drawback of catching
the ImportError in histogram_proto.py.
This has a decent chance of fixing the problem.
Tbr: mbonadei@webrtc.org
Bug: chromium:1029452
Change-Id: If7ae2439b01ad1b3129d8cc8b158385101082e6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171867
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30917}
Diffstat (limited to 'audio')
-rw-r--r-- | audio/BUILD.gn | 10 | ||||
-rwxr-xr-x | audio/test/low_bandwidth_audio_test.py | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/audio/BUILD.gn b/audio/BUILD.gn index 739016e9be..d4ccd42fb5 100644 --- a/audio/BUILD.gn +++ b/audio/BUILD.gn @@ -215,16 +215,18 @@ if (rtc_include_tests) { group("low_bandwidth_audio_perf_test") { testonly = true - deps = [ ":low_bandwidth_audio_test" ] + deps = [ + ":low_bandwidth_audio_test", + "//third_party/catapult/tracing/tracing/proto:histogram_proto", + "//third_party/protobuf:py_proto_runtime", + ] data = [ "test/low_bandwidth_audio_test.py", "../resources/voice_engine/audio_tiny16.wav", "../resources/voice_engine/audio_tiny48.wav", + "${root_out_dir}/pyproto/tracing/tracing/proto/histogram_pb2.py", ] - deps += [ "//third_party/catapult/tracing/tracing/proto:histogram_proto" ] - data += - [ "${root_out_dir}/pyproto/tracing/tracing/proto/histogram_pb2.py" ] # TODO(http://crbug.com/1029452): Create a cleaner target with just the # tracing python code. We don't need Polymer for instance. diff --git a/audio/test/low_bandwidth_audio_test.py b/audio/test/low_bandwidth_audio_test.py index c995cd6547..4e219691e2 100755 --- a/audio/test/low_bandwidth_audio_test.py +++ b/audio/test/low_bandwidth_audio_test.py @@ -234,8 +234,10 @@ def _ConfigurePythonPath(args): sys.path.insert(0, histogram_proto_path) # Fail early in case the proto hasn't been built. - from tracing.proto import histogram_proto - if not histogram_proto.HAS_PROTO: + try: + import histogram_pb2 + except ImportError as e: + logging.exception(e) raise ImportError('Could not find histogram_pb2. You need to build the ' 'low_bandwidth_audio_perf_test target before invoking ' 'this script. Expected to find ' @@ -245,6 +247,7 @@ def _ConfigurePythonPath(args): def main(): # pylint: disable=W0101 logging.basicConfig(level=logging.INFO) + logging.info('Invoked with %s', str(sys.argv)) args = _ParseArgs() |