@@ -18,13 +18,6 @@ const String _kLuciEnvName = 'LUCI_CONTEXT';
1818const String _skiaGoldHost = 'https://flutter-engine-gold.skia.org' ;
1919const String _instance = 'flutter-engine' ;
2020
21- /// Whether the Skia Gold client is available and can be used in this
22- /// environment.
23- bool get isSkiaGoldClientAvailable => SkiaGoldClient .isAvailable ();
24-
25- /// Returns true if the current environment is a LUCI builder.
26- bool get isLuciEnv => io.Platform .environment.containsKey (_kLuciEnvName);
27-
2821/// A client for uploading image tests and making baseline requests to the
2922/// Flutter Gold Dashboard.
3023interface class SkiaGoldClient {
@@ -463,32 +456,28 @@ interface class SkiaGoldClient {
463456 Future <String ?> getExpectationForTest (String testName) async {
464457 late String ? expectation;
465458 final String traceID = getTraceID (testName);
466- await io.HttpOverrides .runWithHttpOverrides <Future <void >>(() async {
467- final Uri requestForExpectations = Uri .parse (
468- '$_skiaGoldHost /json/v2/latestpositivedigest/$traceID '
469- );
470- late String rawResponse;
471- try {
472- final io.HttpClientRequest request = await httpClient.getUrl (requestForExpectations);
473- final io.HttpClientResponse response = await request.close ();
474- rawResponse = await utf8.decodeStream (response);
475- final dynamic jsonResponse = json.decode (rawResponse);
476- if (jsonResponse is ! Map <String , dynamic >) {
477- throw const FormatException ('Skia gold expectations do not match expected format.' );
478- }
479- expectation = jsonResponse['digest' ] as String ? ;
480- } on FormatException catch (error) {
481- _stderr.writeln (
482- 'Formatting error detected requesting expectations from Flutter Gold.\n '
483- 'error: $error \n '
484- 'url: $requestForExpectations \n '
485- 'response: $rawResponse '
486- );
487- rethrow ;
488- }
489- },
490- SkiaGoldHttpOverrides (),
459+ final Uri requestForExpectations = Uri .parse (
460+ '$_skiaGoldHost /json/v2/latestpositivedigest/$traceID '
491461 );
462+ late String rawResponse;
463+ try {
464+ final io.HttpClientRequest request = await httpClient.getUrl (requestForExpectations);
465+ final io.HttpClientResponse response = await request.close ();
466+ rawResponse = await utf8.decodeStream (response);
467+ final dynamic jsonResponse = json.decode (rawResponse);
468+ if (jsonResponse is ! Map <String , dynamic >) {
469+ throw const FormatException ('Skia gold expectations do not match expected format.' );
470+ }
471+ expectation = jsonResponse['digest' ] as String ? ;
472+ } on FormatException catch (error) {
473+ _stderr.writeln (
474+ 'Formatting error detected requesting expectations from Flutter Gold.\n '
475+ 'error: $error \n '
476+ 'url: $requestForExpectations \n '
477+ 'response: $rawResponse '
478+ );
479+ rethrow ;
480+ }
492481 return expectation;
493482 }
494483
@@ -561,6 +550,3 @@ interface class SkiaGoldClient {
561550 return md5Sum;
562551 }
563552}
564-
565- /// Used to make HttpRequests during testing.
566- class SkiaGoldHttpOverrides extends io.HttpOverrides { }
0 commit comments