| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:isolate'; | 6 import 'dart:isolate'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:_mojo_for_test_only/expect.dart'; | |
| 11 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
| 12 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
| 13 import 'package:_mojo_for_test_only/sample/sample_interfaces.mojom.dart' as samp
le; | 12 import 'package:_mojo_for_test_only/expect.dart'; |
| 14 import 'package:_mojo_for_test_only/mojo/test/test_structs.mojom.dart' as struct
s; | |
| 15 import 'package:_mojo_for_test_only/mojo/test/test_unions.mojom.dart' as unions; | |
| 16 import 'package:_mojo_for_test_only/mojo/test/rect.mojom.dart' as rect; | 13 import 'package:_mojo_for_test_only/mojo/test/rect.mojom.dart' as rect; |
| 17 import 'package:_mojo_for_test_only/mojo/test/serialization_test_structs.mojom.d
art' | 14 import 'package:_mojo_for_test_only/mojo/test/serialization_test_structs.mojom.d
art' |
| 18 as serialization; | 15 as serialization; |
| 16 import 'package:_mojo_for_test_only/mojo/test/test_structs.mojom.dart' |
| 17 as structs; |
| 18 import 'package:_mojo_for_test_only/mojo/test/test_unions.mojom.dart' |
| 19 as unions; |
| 19 import 'package:_mojo_for_test_only/regression_tests/regression_tests.mojom.dart
' | 20 import 'package:_mojo_for_test_only/regression_tests/regression_tests.mojom.dart
' |
| 20 as regression; | 21 as regression; |
| 22 import 'package:_mojo_for_test_only/sample/sample_interfaces.mojom.dart' |
| 23 as sample; |
| 21 | 24 |
| 22 class ProviderImpl implements sample.Provider { | 25 class ProviderImpl implements sample.Provider { |
| 23 sample.ProviderStub _stub; | 26 sample.ProviderStub _stub; |
| 24 | 27 |
| 25 ProviderImpl(core.MojoMessagePipeEndpoint endpoint) { | 28 ProviderImpl(core.MojoMessagePipeEndpoint endpoint) { |
| 26 _stub = new sample.ProviderStub.fromEndpoint(endpoint, this); | 29 _stub = new sample.ProviderStub.fromEndpoint(endpoint, this); |
| 27 } | 30 } |
| 28 | 31 |
| 29 echoString(String a, Function responseFactory) => | 32 echoString(String a, Function responseFactory) => |
| 30 new Future.value(responseFactory(a)); | 33 new Future.value(responseFactory(a)); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 client.ptr.serviceName_().then((response) { | 367 client.ptr.serviceName_().then((response) { |
| 365 Expect.equals(ServiceName.serviceName, response.serviceName_); | 368 Expect.equals(ServiceName.serviceName, response.serviceName_); |
| 366 client.close().then((_) { | 369 client.close().then((_) { |
| 367 c.complete(true); | 370 c.complete(true); |
| 368 }); | 371 }); |
| 369 }); | 372 }); |
| 370 }); | 373 }); |
| 371 return c.future; | 374 return c.future; |
| 372 } | 375 } |
| 373 | 376 |
| 377 |
| 378 testCamelCase() { |
| 379 var e = CamelCaseTestEnum.boolThing; |
| 380 e = CamelCaseTestEnum.doubleThing; |
| 381 e = CamelCaseTestEnum.floatThing; |
| 382 e = CamelCaseTestEnum.int8Thing; |
| 383 e = CamelCaseTestEnum.int16Thing; |
| 384 e = CamelCaseTestEnum.int32Th1Ng; |
| 385 e = CamelCaseTestEnum.int64Th1ng; |
| 386 e = CamelCaseTestEnum.uint8TH1ng; |
| 387 e = CamelCaseTestEnum.uint16tH1Ng; |
| 388 e = CamelCaseTestEnum.uint32Th1ng; |
| 389 e = CamelCaseTestEnum.uint64Th1Ng; |
| 390 } |
| 391 |
| 392 |
| 374 main() async { | 393 main() async { |
| 375 testSerializeStructs(); | 394 testSerializeStructs(); |
| 376 testUnions(); | 395 testUnions(); |
| 377 await testEnums(); | 396 await testEnums(); |
| 378 await testCallResponse(); | 397 await testCallResponse(); |
| 379 await testAwaitCallResponse(); | 398 await testAwaitCallResponse(); |
| 380 await runOnClosedTest(); | 399 await runOnClosedTest(); |
| 381 await testRegression551(); | 400 await testRegression551(); |
| 382 await testServiceName(); | 401 await testServiceName(); |
| 402 testCamelCase(); |
| 383 } | 403 } |
| OLD | NEW |