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
|
} |