Index: mojo/dart/embedder/test/dart_to_cpp_tests.dart |
diff --git a/mojo/dart/embedder/test/dart_to_cpp_tests.dart b/mojo/dart/embedder/test/dart_to_cpp_tests.dart |
index df169578fba14e28a40fd430540ef7432cd8bace..be1aaea66ac06bbff76026612cf2b77f4992733e 100644 |
--- a/mojo/dart/embedder/test/dart_to_cpp_tests.dart |
+++ b/mojo/dart/embedder/test/dart_to_cpp_tests.dart |
@@ -9,19 +9,23 @@ import 'mojo:core' as core; |
import 'package:mojo/dart/embedder/test/dart_to_cpp.mojom.dart'; |
-class DartSideImpl extends DartSide { |
+class DartSideImpl implements DartSide { |
static const int BAD_VALUE = 13; |
static const int ELEMENT_BYTES = 1; |
static const int CAPACITY_BYTES = 64; |
- CppSideProxy cppSide; |
+ DartSideStub _stub; |
+ CppSideProxy cppSideProxy; |
+ CppSide cppSide; |
Uint8List _sampleData; |
Uint8List _sampleMessage; |
Completer _completer; |
- DartSideImpl(core.MojoMessagePipeEndpoint endpoint) : super(endpoint) { |
- super.delegate = this; |
+ DartSideImpl(core.MojoMessagePipeEndpoint endpoint) { |
+ _stub = new DartSideStub.fromEndpoint(endpoint) |
+ ..delegate = this |
+ ..listen(); |
_sampleData = new Uint8List(CAPACITY_BYTES); |
for (int i = 0; i < _sampleData.length; ++i) { |
_sampleData[i] = i; |
@@ -42,16 +46,17 @@ class DartSideImpl extends DartSide { |
}); |
} |
- void setClient(CppSideProxy proxy) { |
+ void setClient(bindings.ProxyBase proxy) { |
assert(cppSide == null); |
- cppSide = proxy; |
+ cppSideProxy = proxy; |
+ cppSide = cppSideProxy.interface; |
cppSide.startTest(); |
} |
void ping() { |
cppSide.pingResponse(); |
_completer.complete(null); |
- cppSide.close(); |
+ cppSideProxy.impl.close(); |
} |
void echo(int numIterations, EchoArgs arg) { |
@@ -100,7 +105,7 @@ class DartSideImpl extends DartSide { |
} |
cppSide.testFinished(); |
_completer.complete(null); |
- cppSide.close(); |
+ cppSideProxy.impl.close(); |
} |
Future<bool> get future => _completer.future; |
@@ -113,7 +118,6 @@ main(List args) { |
var rawHandle = new core.MojoHandle(mojoHandle); |
var endpoint = new core.MojoMessagePipeEndpoint(rawHandle); |
var dartSide = new DartSideImpl(endpoint); |
- dartSide.listen(); |
dartSide.future.then((_) { |
print('Success'); |
}); |