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

Unified Diff: mojo/dart/test/bindings_generation_test.dart

Issue 1414483010: Dart: Use a RawReceivePort to receive events for Mojo handles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/dart/embedder/test/run_dart_tests.cc ('k') | mojo/dart/test/compile_all_interfaces_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/test/bindings_generation_test.dart
diff --git a/mojo/dart/test/bindings_generation_test.dart b/mojo/dart/test/bindings_generation_test.dart
index 71559f2be991f92847b8f07e28e7778b7ba4203c..293ea98598e10ffd00c5baf9395595d4fcb54f4b 100644
--- a/mojo/dart/test/bindings_generation_test.dart
+++ b/mojo/dart/test/bindings_generation_test.dart
@@ -14,8 +14,10 @@ import 'package:mojom/sample/sample_interfaces.mojom.dart' as sample;
import 'package:mojom/mojo/test/test_structs.mojom.dart' as structs;
import 'package:mojom/mojo/test/test_unions.mojom.dart' as unions;
import 'package:mojom/mojo/test/rect.mojom.dart' as rect;
-import 'package:mojom/mojo/test/serialization_test_structs.mojom.dart' as serialization;
-import 'package:mojom/regression_tests/regression_tests.mojom.dart' as regression;
+import 'package:mojom/mojo/test/serialization_test_structs.mojom.dart'
+ as serialization;
+import 'package:mojom/regression_tests/regression_tests.mojom.dart'
+ as regression;
class ProviderImpl implements sample.Provider {
sample.ProviderStub _stub;
@@ -126,8 +128,8 @@ testSerializeToJSON() {
testSerializeHandleToJSON() {
var s = new serialization.Struct2();
- Expect.throws(() => JSON.encode(s),
- (e) => e.cause is bindings.MojoCodecError);
+ Expect.throws(
+ () => JSON.encode(s), (e) => e.cause is bindings.MojoCodecError);
}
testSerializeStructs() {
@@ -138,8 +140,7 @@ testSerializeStructs() {
}
testSerializePodUnions() {
- var s = new unions.WrapperStruct()
- ..podUnion = new unions.PodUnion();
+ var s = new unions.WrapperStruct()..podUnion = new unions.PodUnion();
s.podUnion.fUint32 = 32;
Expect.equals(unions.PodUnionTag.fUint32, s.podUnion.tag);
@@ -152,10 +153,8 @@ testSerializePodUnions() {
}
testSerializeStructInUnion() {
- var s = new unions.WrapperStruct()
- ..objectUnion = new unions.ObjectUnion();
- s.objectUnion.fDummy = new unions.DummyStruct()
- ..fInt8 = 8;
+ var s = new unions.WrapperStruct()..objectUnion = new unions.ObjectUnion();
+ s.objectUnion.fDummy = new unions.DummyStruct()..fInt8 = 8;
var message = messageOfStruct(s);
var s2 = unions.WrapperStruct.deserialize(message.payload);
@@ -164,8 +163,7 @@ testSerializeStructInUnion() {
}
testSerializeArrayInUnion() {
- var s = new unions.WrapperStruct()
- ..objectUnion = new unions.ObjectUnion();
+ var s = new unions.WrapperStruct()..objectUnion = new unions.ObjectUnion();
s.objectUnion.fArrayInt8 = [1, 2, 3];
var message = messageOfStruct(s);
@@ -175,12 +173,8 @@ testSerializeArrayInUnion() {
}
testSerializeMapInUnion() {
- var s = new unions.WrapperStruct()
- ..objectUnion = new unions.ObjectUnion();
- s.objectUnion.fMapInt8 = {
- "one": 1,
- "two": 2,
- };
+ var s = new unions.WrapperStruct()..objectUnion = new unions.ObjectUnion();
+ s.objectUnion.fMapInt8 = {"one": 1, "two": 2,};
var message = messageOfStruct(s);
var s2 = unions.WrapperStruct.deserialize(message.payload);
@@ -192,10 +186,8 @@ testSerializeMapInUnion() {
testSerializeUnionInArray() {
var s = new unions.SmallStruct()
..podUnionArray = [
- new unions.PodUnion()
- ..fUint16 = 16,
- new unions.PodUnion()
- ..fUint32 = 32,
+ new unions.PodUnion()..fUint16 = 16,
+ new unions.PodUnion()..fUint32 = 32,
];
var message = messageOfStruct(s);
@@ -209,10 +201,8 @@ testSerializeUnionInArray() {
testSerializeUnionInMap() {
var s = new unions.SmallStruct()
..podUnionMap = {
- 'one': new unions.PodUnion()
- ..fUint16 = 16,
- 'two': new unions.PodUnion()
- ..fUint32 = 32,
+ 'one': new unions.PodUnion()..fUint16 = 16,
+ 'two': new unions.PodUnion()..fUint32 = 32,
};
var message = messageOfStruct(s);
@@ -224,10 +214,8 @@ testSerializeUnionInMap() {
}
testSerializeUnionInUnion() {
- var s = new unions.WrapperStruct()
- ..objectUnion = new unions.ObjectUnion();
- s.objectUnion.fPodUnion = new unions.PodUnion()
- ..fUint32 = 32;
+ var s = new unions.WrapperStruct()..objectUnion = new unions.ObjectUnion();
+ s.objectUnion.fPodUnion = new unions.PodUnion()..fUint32 = 32;
var message = messageOfStruct(s);
var s2 = unions.WrapperStruct.deserialize(message.payload);
@@ -303,7 +291,7 @@ Future<bool> runOnClosedTest() {
var testCompleter = new Completer();
var pipe = new core.MojoMessagePipe();
var proxy = new sample.ProviderProxy.fromEndpoint(pipe.endpoints[0]);
- proxy.impl.onError = () => testCompleter.complete(true);
+ proxy.impl.onError = (_) => testCompleter.complete(true);
Isolate.spawn(closingProviderIsolate, pipe.endpoints[1]);
return testCompleter.future.then((b) {
Expect.isTrue(b);
« no previous file with comments | « mojo/dart/embedder/test/run_dart_tests.cc ('k') | mojo/dart/test/compile_all_interfaces_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698