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

Unified Diff: third_party/grpc/src/python/grpcio/grpc/framework/core/_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/grpc/framework/core/_constants.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_types_unittest.py b/third_party/grpc/src/python/grpcio/grpc/framework/core/_constants.py
similarity index 52%
copy from third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_types_unittest.py
copy to third_party/grpc/src/python/grpcio/grpc/framework/core/_constants.py
index dd792e99761723cdd03d15138ca63e701f79aad3..0f47cb48e0365e3e10230ab39227a0027005ef3e 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_types_unittest.py
+++ b/third_party/grpc/src/python/grpcio/grpc/framework/core/_constants.py
@@ -1,4 +1,5 @@
-# Copyright (C) 2013 Google Inc. All rights reserved.
+# Copyright 2015, Google Inc.
+# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -26,34 +27,34 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import unittest
-
-from webkitpy.common.host_mock import MockHost
-from webkitpy.layout_tests.print_layout_test_types import main
-
-
-class PrintLayoutTestTimesTest(unittest.TestCase):
-
- def check(self, args, expected_output, files=None):
- host = MockHost()
- files = files or {}
- for path, contents in files.items():
- host.filesystem.write_binary_file(path, contents)
- orig_get = host.port_factory.get
- host.port_factory.get = lambda *args, **kwargs: orig_get('test')
- main(host, args)
- self.assertEqual(host.stdout.getvalue(), expected_output)
-
- def test_test_list(self):
- files = {'/tmp/test_list': 'passes/image.html'}
- self.check(['--test-list', '/tmp/test_list'], 'passes/image.html pixel\n', files=files)
-
- def test_type(self):
- self.check(['--type', 'audio', 'passes'], 'passes/audio.html\n')
-
- def test_basic(self):
- self.check(['failures/unexpected/missing_image.html', 'passes/image.html', 'passes/audio.html', 'passes/reftest.html'],
- 'failures/unexpected/missing_image.html text\n'
- 'passes/image.html pixel\n'
- 'passes/audio.html audio\n'
- 'passes/reftest.html ref\n')
+"""Private constants for the package."""
+
+from grpc.framework.interfaces.base import base
+from grpc.framework.interfaces.links import links
+
+TICKET_SUBSCRIPTION_FOR_BASE_SUBSCRIPTION_KIND = {
+ base.Subscription.Kind.NONE: links.Ticket.Subscription.NONE,
+ base.Subscription.Kind.TERMINATION_ONLY:
+ links.Ticket.Subscription.TERMINATION,
+ base.Subscription.Kind.FULL: links.Ticket.Subscription.FULL,
+ }
+
+# Mapping from abortive operation outcome to ticket termination to be
+# sent to the other side of the operation, or None to indicate that no
+# ticket should be sent to the other side in the event of such an
+# outcome.
+ABORTION_OUTCOME_TO_TICKET_TERMINATION = {
+ base.Outcome.Kind.CANCELLED: links.Ticket.Termination.CANCELLATION,
+ base.Outcome.Kind.EXPIRED: links.Ticket.Termination.EXPIRATION,
+ base.Outcome.Kind.LOCAL_SHUTDOWN: links.Ticket.Termination.SHUTDOWN,
+ base.Outcome.Kind.REMOTE_SHUTDOWN: None,
+ base.Outcome.Kind.RECEPTION_FAILURE:
+ links.Ticket.Termination.RECEPTION_FAILURE,
+ base.Outcome.Kind.TRANSMISSION_FAILURE: None,
+ base.Outcome.Kind.LOCAL_FAILURE: links.Ticket.Termination.LOCAL_FAILURE,
+ base.Outcome.Kind.REMOTE_FAILURE: links.Ticket.Termination.REMOTE_FAILURE,
+}
+
+INTERNAL_ERROR_LOG_MESSAGE = ':-( RPC Framework (Core) internal error! )-:'
+TERMINATION_CALLBACK_EXCEPTION_LOG_MESSAGE = (
+ 'Exception calling termination callback!')

Powered by Google App Engine
This is Rietveld 408576698