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

Unified Diff: mojo/dart/embedder/test/dart_to_cpp_tests.dart

Issue 959993002: Dart: Removes name conflicts from generated bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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: 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..6dd8a72320fdf24c645df5bd5eaff41c80c08bbf 100644
--- a/mojo/dart/embedder/test/dart_to_cpp_tests.dart
+++ b/mojo/dart/embedder/test/dart_to_cpp_tests.dart
@@ -9,19 +9,22 @@ 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;
+ 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 +45,16 @@ class DartSideImpl extends DartSide {
});
}
- void setClient(CppSideProxy proxy) {
+ void setClient(bindings.Proxy proxy) {
assert(cppSide == null);
- cppSide = proxy;
+ cppSide = new CppSideProxy(proxy);
cppSide.startTest();
}
void ping() {
cppSide.pingResponse();
_completer.complete(null);
- cppSide.close();
+ CppSideProxyClose(cppSide);
}
void echo(int numIterations, EchoArgs arg) {
@@ -100,7 +103,7 @@ class DartSideImpl extends DartSide {
}
cppSide.testFinished();
_completer.complete(null);
- cppSide.close();
+ CppSideProxyClose(cppSide);
}
Future<bool> get future => _completer.future;
@@ -113,7 +116,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');
});

Powered by Google App Engine
This is Rietveld 408576698