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

Unified Diff: runtime/tests/vm/dart/hello_fuchsia_test.dart

Issue 2522923002: Fuchsia sockets: (Closed)
Patch Set: CL format Created 4 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 | « runtime/bin/socket_fuchsia.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tests/vm/dart/hello_fuchsia_test.dart
diff --git a/runtime/tests/vm/dart/hello_fuchsia_test.dart b/runtime/tests/vm/dart/hello_fuchsia_test.dart
index 9ed439b3e0aa1545d59c25297fdeb8f6feec53a4..100cb04cd2c32ee2e55a9e31220f5f19c9c2146c 100644
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart
@@ -5,6 +5,20 @@
import "dart:async";
import "dart:io";
+testAddressParse() async {
+ print(new InternetAddress("1.0.2.3").rawAddress);
+ print(new InternetAddress("1.0.2.3").type);
+
+ print(new InternetAddress("::1").rawAddress);
+ print(new InternetAddress("::1").type);
+
+ try {
+ print(new InternetAddress("localhost"));
+ } catch (e) {
+ print(e);
+ }
+}
+
testSimpleBind() async {
var s = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
print("port = ${s.port}");
@@ -20,6 +34,13 @@ testSimpleConnect() async {
});
var socket = await RawSocket.connect("127.0.0.1", server.port);
print("socket port = ${socket.port}");
+ if (socket.remoteAddress.address != "127.0.0.1" ||
+ socket.remoteAddress.type != InternetAddressType.IP_V4) {
+ throw "Bad remote address ${socket.remoteAddress}";
+ }
+ if (socket.remotePort is! int) {
+ throw "Bad remote port ${socket.remotePort}";
+ }
await server.close();
await socket.close();
}
@@ -197,6 +218,10 @@ Future testGoogleUrl(SecurityContext context, String outcome) async {
main() async {
print("Hello, Fuchsia!");
+ print("testAddressParse");
+ await testAddressParse();
+ print("testAddressParse done");
+
print("testSimpleBind");
await testSimpleBind();
print("testSimpleBind done");
@@ -205,13 +230,14 @@ main() async {
await testSimpleConnect();
print("testSimpleConnect done");
+ // TODO(US-81): Enable.
// print("testSimpleReadWrite");
// await testSimpleReadWrite(dropReads: false);
// print("testSimpleReadWrite done");
- // print("testGoogleUrl");
- // await testGoogleUrl(null, 'pass');
- // print("testGoogleUrl done");
+ print("testGoogleUrl");
+ await testGoogleUrl(null, 'pass');
+ print("testGoogleUrl done");
print("Goodbyte, Fuchsia!");
}
« no previous file with comments | « runtime/bin/socket_fuchsia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698