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

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

Issue 2519133005: Enable SecureSocket on Fuchsia using BoringSSL (Closed)
Patch Set: . 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
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 e29fb3ed9060d80a1e1da5afec5beb055197e1e6..e4be53d43f49253b98704d3da1a4ceb39844e65c 100644
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart
@@ -331,7 +331,7 @@ testSimpleReadWriteShutdown({bool dropReads}) async {
}
}
-Future testGoogleUrl(SecurityContext context, String outcome) async {
+Future testGoogleHttp(SecurityContext context, String outcome) async {
var client = new HttpClient(context: context);
// We need to use an external server that is backed by a
// built-in root certificate authority.
siva 2016/11/23 18:36:04 This comment here is probably not needed as you ar
rmacnak 2016/11/23 18:43:02 Done.
@@ -354,6 +354,29 @@ Future testGoogleUrl(SecurityContext context, String outcome) async {
}
}
+Future testGoogleHttps(SecurityContext context, String outcome) async {
+ var client = new HttpClient(context: context);
+ // We need to use an external server that is backed by a
+ // built-in root certificate authority.
+ try {
+ // First, check if the lookup works.
+ var address = await InternetAddress.lookup('www.google.com');
+ print(address);
+ var request = await client.getUrl(Uri.parse('https://www.google.com/'));
+ request.followRedirects = false;
+ var response = await request.close();
+ assert('pass' == outcome);
+ try { await response.drain(); } catch (e) {
+ print('drain failed: $e');
+ }
+ } catch (e) {
+ // Lookup failed or connection failed. Don't report a failure.
+ print("SocketException: $e");
+ } finally {
+ client.close();
+ }
+}
+
main() async {
print("Hello, Fuchsia!");
@@ -378,9 +401,14 @@ main() async {
// await testSimpleReadWriteShutdown(dropReads: false);
// print("testSimpleReadWriteShutdown done");
- print("testGoogleUrl");
- await testGoogleUrl(null, 'pass');
- print("testGoogleUrl done");
+ print("testGoogleHttp");
+ await testGoogleHttp(null, 'pass');
+ print("testGoogleHttp done");
+
+ print("testGoogleHttps");
+ await testGoogleHttps(null, 'pass');
+ print("testGoogleHttps done");
siva 2016/11/23 18:36:04 Should we comment out this under US-96?
rmacnak 2016/11/23 18:43:02 Done.
print("Goodbyte, Fuchsia!");
+ print(new DateTime.now());
siva 2016/11/23 18:36:04 Is this line added for debugging?
rmacnak 2016/11/23 18:43:02 Moved under testGoogleHttps with an explanation th
}

Powered by Google App Engine
This is Rietveld 408576698