
The methodology used to generate this CL is documented in https://crbug.com/1098010#c95. No-Try: true No-Presubmit: true Bug: 1098010 Change-Id: I3a8a7b150e7bd64690534727150646081df50439 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900697 Reviewed-by: Mark Mentovai <mark@chromium.org> Auto-Submit: Avi Drissman <avi@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1047644}
24 lines
634 B
Python
Executable File
24 lines
634 B
Python
Executable File
#!/usr/bin/env python
|
|
# Copyright 2019 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
"""Script for use in test_env unittests."""
|
|
|
|
from __future__ import print_function
|
|
import signal
|
|
import sys
|
|
import time
|
|
|
|
|
|
def print_signal(sig, *_args):
|
|
print('Signal :{}'.format(sig))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
signal.signal(signal.SIGTERM, print_signal)
|
|
signal.signal(signal.SIGINT, print_signal)
|
|
if sys.platform == 'win32':
|
|
signal.signal(signal.SIGBREAK, print_signal) # pylint: disable=no-member
|
|
time.sleep(2) # gives process time to receive signal.
|