@@ -48,12 +48,13 @@ void main() {
4848 testWithoutContext ('all http hosts are not available' , () async {
4949 // Run the check for all operating systems one by one
5050 for (final String os in osTested) {
51+ final Platform platform = FakePlatform (operatingSystem: os);
5152 final HttpHostValidator httpHostValidator = HttpHostValidator (
52- platform: FakePlatform (operatingSystem : os) ,
53+ platform: platform ,
5354 featureFlags: TestFeatureFlags (),
5455 httpClient: FakeHttpClient .list (< FakeRequest > [
5556 FakeRequest (Uri .parse (kgCloudHttpHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
56- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
57+ FakeRequest (Uri .parse (androidRequiredHttpHosts (platform) [0 ]), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
5758 FakeRequest (Uri .parse (kPubDevHttpHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
5859 FakeRequest (Uri .parse (macOSRequiredHttpHosts[0 ]), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
5960 ]),
@@ -70,12 +71,13 @@ void main() {
7071 testWithoutContext ('one http hosts are not available' , () async {
7172 // Run the check for all operating systems one by one
7273 for (final String os in osTested) {
74+ final Platform platform = FakePlatform (operatingSystem: os);
7375 final HttpHostValidator httpHostValidator = HttpHostValidator (
74- platform: FakePlatform (operatingSystem : os) ,
76+ platform: platform ,
7577 featureFlags: TestFeatureFlags (),
7678 httpClient: FakeHttpClient .list (< FakeRequest > [
7779 FakeRequest (Uri .parse (kgCloudHttpHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
78- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head),
80+ FakeRequest (Uri .parse (androidRequiredHttpHosts (platform) [0 ]), method: HttpMethod .head),
7981 FakeRequest (Uri .parse (kPubDevHttpHost), method: HttpMethod .head),
8082 FakeRequest (Uri .parse (macOSRequiredHttpHosts[0 ]), method: HttpMethod .head),
8183 ]),
@@ -92,12 +94,13 @@ void main() {
9294 testWithoutContext ('one http hosts are not available' , () async {
9395 // Run the check for all operating systems one by one
9496 for (final String os in osTested) {
97+ final Platform platform = FakePlatform (operatingSystem: os);
9598 final HttpHostValidator httpHostValidator = HttpHostValidator (
96- platform: FakePlatform (operatingSystem : os) ,
99+ platform: platform ,
97100 featureFlags: TestFeatureFlags (),
98101 httpClient: FakeHttpClient .list (< FakeRequest > [
99102 FakeRequest (Uri .parse (kgCloudHttpHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
100- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head),
103+ FakeRequest (Uri .parse (androidRequiredHttpHosts (platform) [0 ]), method: HttpMethod .head),
101104 FakeRequest (Uri .parse (kPubDevHttpHost), method: HttpMethod .head),
102105 FakeRequest (Uri .parse (macOSRequiredHttpHosts[0 ]), method: HttpMethod .head),
103106 ]),
@@ -135,12 +138,12 @@ void main() {
135138 testWithoutContext ('all http hosts are not available' , () async {
136139 // Run the check for all operating systems one by one
137140 for (final String os in osTested) {
141+ final Platform platform = FakePlatform (operatingSystem: os, environment: kTestEnvironment);
138142 final HttpHostValidator httpHostValidator = HttpHostValidator (
139- platform: FakePlatform (operatingSystem : os, environment : kTestEnvironment) ,
143+ platform: platform ,
140144 featureFlags: TestFeatureFlags (),
141145 httpClient: FakeHttpClient .list (< FakeRequest > [
142146 FakeRequest (Uri .parse (kTestEnvGCloudHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
143- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
144147 FakeRequest (Uri .parse (kTestEnvPubHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
145148 FakeRequest (Uri .parse (macOSRequiredHttpHosts[0 ]), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
146149 ]),
@@ -157,12 +160,12 @@ void main() {
157160 testWithoutContext ('one http hosts are not available' , () async {
158161 // Run the check for all operating systems one by one
159162 for (final String os in osTested) {
163+ final Platform platform = FakePlatform (operatingSystem: os, environment: kTestEnvironment);
160164 final HttpHostValidator httpHostValidator = HttpHostValidator (
161- platform: FakePlatform (operatingSystem : os, environment : kTestEnvironment) ,
165+ platform: platform ,
162166 featureFlags: TestFeatureFlags (),
163167 httpClient: FakeHttpClient .list (< FakeRequest > [
164168 FakeRequest (Uri .parse (kTestEnvGCloudHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
165- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head),
166169 FakeRequest (Uri .parse (kTestEnvPubHost), method: HttpMethod .head),
167170 FakeRequest (Uri .parse (macOSRequiredHttpHosts[0 ]), method: HttpMethod .head),
168171 ]),
@@ -179,12 +182,12 @@ void main() {
179182 testWithoutContext ('one http hosts are not available' , () async {
180183 // Run the check for all operating systems one by one
181184 for (final String os in osTested) {
185+ final Platform platform = FakePlatform (operatingSystem: os, environment: kTestEnvironment);
182186 final HttpHostValidator httpHostValidator = HttpHostValidator (
183- platform: FakePlatform (operatingSystem : os, environment : kTestEnvironment) ,
187+ platform: platform ,
184188 featureFlags: TestFeatureFlags (),
185189 httpClient: FakeHttpClient .list (< FakeRequest > [
186190 FakeRequest (Uri .parse (kTestEnvGCloudHost), method: HttpMethod .head, responseError: const OSError ('Name or service not known' , - 2 )),
187- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head),
188191 FakeRequest (Uri .parse (kTestEnvPubHost), method: HttpMethod .head),
189192 FakeRequest (Uri .parse (macOSRequiredHttpHosts[0 ]), method: HttpMethod .head),
190193 ]),
@@ -224,13 +227,14 @@ void main() {
224227 testWithoutContext ('all http hosts are available - iOS disabled' , () async {
225228 // Run the check for all operating systems one by one
226229 for (final String os in osTested) {
230+ final Platform platform = FakePlatform (operatingSystem: os);
227231 final HttpHostValidator httpHostValidator = HttpHostValidator (
228- platform: FakePlatform (operatingSystem : os) ,
232+ platform: platform ,
229233 featureFlags: TestFeatureFlags (isIOSEnabled: false ),
230234 httpClient: FakeHttpClient .list (< FakeRequest > [
231235 FakeRequest (Uri .parse (kgCloudHttpHost), method: HttpMethod .head),
232236 FakeRequest (Uri .parse (kPubDevHttpHost), method: HttpMethod .head),
233- FakeRequest (Uri .parse (androidRequiredHttpHosts[0 ]), method: HttpMethod .head),
237+ FakeRequest (Uri .parse (androidRequiredHttpHosts (platform) [0 ]), method: HttpMethod .head),
234238 ]),
235239 );
236240
0 commit comments