Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: third_party/grpc/src/python/grpcio/tests/unit/framework/common/test_constants.py

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/python/grpcio/tests/unit/framework/common/test_constants.py
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/echo-with-no-extension_wsh.py b/third_party/grpc/src/python/grpcio/tests/unit/framework/common/test_constants.py
similarity index 60%
copy from third_party/WebKit/LayoutTests/http/tests/websocket/echo-with-no-extension_wsh.py
copy to third_party/grpc/src/python/grpcio/tests/unit/framework/common/test_constants.py
index 4206831cb5135d5e03928bf9d995b2bf9e156018..9f1fb8471ca31905adf6b3b69e6114704c86e70c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/echo-with-no-extension_wsh.py
+++ b/third_party/grpc/src/python/grpcio/tests/unit/framework/common/test_constants.py
@@ -1,4 +1,4 @@
-# Copyright 2012, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -27,22 +27,30 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+"""Constants shared among tests throughout RPC Framework."""
-_GOODBYE_MESSAGE = u'Goodbye'
+# Value for maximum duration in seconds that a test is allowed for its actual
+# behavioral logic, excluding all time spent deliberately waiting in the test.
+TIME_ALLOWANCE = 10
+# Value for maximum duration in seconds of RPCs that may time out as part of a
+# test.
+SHORT_TIMEOUT = 4
+# Absurdly large value for maximum duration in seconds for should-not-time-out
+# RPCs made during tests.
+LONG_TIMEOUT = 3000
+# Values to supply on construction of an object that will service RPCs; these
+# should not be used as the actual timeout values of any RPCs made during tests.
+DEFAULT_TIMEOUT = 300
+MAXIMUM_TIMEOUT = 3600
+# The number of payloads to transmit in streaming tests.
+STREAM_LENGTH = 200
-def web_socket_do_extra_handshake(request):
- request.ws_extension_processors = []
+# The size of payloads to transmit in tests.
+PAYLOAD_SIZE = 256 * 1024 + 17
+# The parallelism to use in tests of parallel RPCs.
+PARALLELISM = 200
-def web_socket_transfer_data(request):
- while True:
- line = request.ws_stream.receive_message()
- if line is None:
- return
- if isinstance(line, unicode):
- request.ws_stream.send_message(line, binary=False)
- if line == _GOODBYE_MESSAGE:
- return
- else:
- request.ws_stream.send_message(line, binary=True)
+# The size of thread pools to use in tests.
+POOL_SIZE = 10

Powered by Google App Engine
This is Rietveld 408576698