Refactor internet connection check into utility function
The internet connectivity check will be required by multiple test
classes. Refactor it into a standalone utility function and port the
code to Kotlin at the same time.
Also, instead of asserting, make use of junit.Assume. This way when ther
is no internet connection the test won't fail but it will just be
reported as skipped
Test: atest CtsCronetTestCases
Change-Id: I170aa19e23a9532d84da72cbcec567b65519bb0b
diff --git a/Cronet/tests/cts/Android.bp b/Cronet/tests/cts/Android.bp
index 68e3cf1..2c28b8d 100644
--- a/Cronet/tests/cts/Android.bp
+++ b/Cronet/tests/cts/Android.bp
@@ -59,6 +59,7 @@
"ctstestrunner-axt",
"ctstestserver",
"junit",
+ "hamcrest-library",
],
libs: [
"android.test.runner",