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

Unified Diff: mojo/public/python/mojo/bindings/reflection.py

Issue 761553003: Add validation tests to python bindings. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 6 years, 1 month 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
« no previous file with comments | « mojo/public/python/mojo/bindings/descriptor.py ('k') | mojo/public/python/mojo/bindings/serialization.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/python/mojo/bindings/reflection.py
diff --git a/mojo/public/python/mojo/bindings/reflection.py b/mojo/public/python/mojo/bindings/reflection.py
index 5ca38bfa2410bd4eca5e4eae78b9159105edb68d..9668c2a38d8938494af66ee87645cb6de934e3bb 100644
--- a/mojo/public/python/mojo/bindings/reflection.py
+++ b/mojo/public/python/mojo/bindings/reflection.py
@@ -117,10 +117,10 @@ class MojoStructType(type):
return self._fields
dictionary['AsDict'] = AsDict
- def Deserialize(cls, data, handles):
+ def Deserialize(cls, context):
result = cls.__new__(cls)
fields = {}
- serialization_object.Deserialize(fields, data, handles)
+ serialization_object.Deserialize(fields, context)
result._fields = fields
return result
dictionary['Deserialize'] = classmethod(Deserialize)
@@ -476,8 +476,9 @@ def _ProxyMethodCall(method):
try:
assert message.header.message_type == method.ordinal
payload = message.payload
- response = method.response_struct.Deserialize(payload.data,
- payload.handles)
+ response = method.response_struct.Deserialize(
+ serialization.RootDeserializationContext(payload.data,
+ payload.handles))
as_dict = response.AsDict()
if len(as_dict) == 1:
value = as_dict.values()[0]
@@ -533,7 +534,8 @@ def _StubAccept(methods):
method = methods_by_ordinal[header.message_type]
payload = message.payload
parameters = method.parameters_struct.Deserialize(
- payload.data, payload.handles).AsDict()
+ serialization.RootDeserializationContext(
+ payload.data, payload.handles)).AsDict()
response = getattr(self.impl, method.name)(**parameters)
if header.expects_response:
def SendResponse(response):
« no previous file with comments | « mojo/public/python/mojo/bindings/descriptor.py ('k') | mojo/public/python/mojo/bindings/serialization.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698