From 05a53dae0d4f4594ca58b11e47d755b4691f6aff Mon Sep 17 00:00:00 2001 From: Sigmund Cherem Date: Mon, 22 Jan 2024 18:54:04 +0000 Subject: [PATCH] [tests] delete html/async_test. This test was written to validate correctness of the web implementation of `dart:isolates`, back when it was supported. Today, this API is unsupported in both dart2js and DDC. The test was consistently failing in DDC and skipped in dart2js. We don't believe it's valuable to continue running this test at this moment. Change-Id: I578533b09c4172daf3f49fcc528ccb2cebebb53d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347642 Reviewed-by: Nicholas Shahan Commit-Queue: Sigmund Cherem --- tests/lib/html/async_cancellingisolate.dart | 35 --------------- tests/lib/html/async_oneshot.dart | 14 ------ tests/lib/html/async_periodictimer.dart | 28 ------------ tests/lib/html/async_test.dart | 49 --------------------- tests/lib/lib_dart2js.status | 1 - 5 files changed, 127 deletions(-) delete mode 100644 tests/lib/html/async_cancellingisolate.dart delete mode 100644 tests/lib/html/async_oneshot.dart delete mode 100644 tests/lib/html/async_periodictimer.dart delete mode 100644 tests/lib/html/async_test.dart diff --git a/tests/lib/html/async_cancellingisolate.dart b/tests/lib/html/async_cancellingisolate.dart deleted file mode 100644 index b04c5b1754d..00000000000 --- a/tests/lib/html/async_cancellingisolate.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library async_cancellingisolate; - -import 'dart:async'; -import 'package:expect/minitest.dart'; - -main(message, replyTo) { - var command = message.first; - expect(command, 'START'); - var shot = false; - var oneshot; - var periodic; - periodic = new Timer.periodic(const Duration(milliseconds: 10), (timer) { - expect(shot, isFalse); - shot = true; - expect(timer, same(periodic)); - periodic.cancel(); - oneshot.cancel(); - // Wait some more time to be sure callbacks won't be invoked any - // more. - new Timer(const Duration(milliseconds: 50), () { - replyTo.send('DONE'); - }); - }); - // We launch the oneshot timer after the periodic timer. Otherwise a - // (very long) context switch could make this test flaky: assume the - // oneshot timer is created first and then there is a 30ms context switch. - // when the periodic timer is scheduled it would execute after the oneshot. - oneshot = new Timer(const Duration(milliseconds: 30), () { - fail('Should never be invoked'); - }); -} diff --git a/tests/lib/html/async_oneshot.dart b/tests/lib/html/async_oneshot.dart deleted file mode 100644 index 475efe3a4b6..00000000000 --- a/tests/lib/html/async_oneshot.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; -import 'package:expect/minitest.dart'; - -main(message, replyTo) { - var command = message.first; - expect(command, 'START'); - new Timer(const Duration(milliseconds: 10), () { - replyTo.send('DONE'); - }); -} diff --git a/tests/lib/html/async_periodictimer.dart b/tests/lib/html/async_periodictimer.dart deleted file mode 100644 index 9837ae5a615..00000000000 --- a/tests/lib/html/async_periodictimer.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library async_periodictimer; - -import 'dart:async'; -import 'package:expect/minitest.dart'; - -main(message, replyTo) { - var command = message.first; - expect(command, 'START'); - int counter = 0; - new Timer.periodic(const Duration(milliseconds: 10), (timer) { - if (counter == 3) { - counter = 1024; - timer.cancel(); - // Wait some more time to be sure callback won't be invoked any - // more. - new Timer(const Duration(milliseconds: 30), () { - replyTo.send('DONE'); - }); - return; - } - assert(counter < 3); - counter++; - }); -} diff --git a/tests/lib/html/async_test.dart b/tests/lib/html/async_test.dart deleted file mode 100644 index 7720d5a1895..00000000000 --- a/tests/lib/html/async_test.dart +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library async_test; - -import 'package:async_helper/async_minitest.dart'; - -import 'dart:async'; -import 'dart:isolate'; -import 'dart:html'; - -import 'async_oneshot.dart' as oneshot_test show main; -import 'async_periodictimer.dart' as periodictimer_test show main; -import 'async_cancellingisolate.dart' as cancelling_test show main; - -oneshot(message) => oneshot_test.main(message.first, message.last); -periodicTimerIsolate(message) => - periodictimer_test.main(message.first, message.last); -cancellingIsolate(message) => cancelling_test.main(message.first, message.last); - -main() { - test('one shot timer in pure isolate', () { - var response = new ReceivePort(); - var remote = Isolate.spawn(oneshot, [ - ['START'], - response.sendPort - ]); - expect(remote.then((_) => response.first), completion('DONE')); - }); - - test('periodic timer in pure isolate', () { - var response = new ReceivePort(); - var remote = Isolate.spawn(periodicTimerIsolate, [ - ['START'], - response.sendPort - ]); - expect(remote.then((_) => response.first), completion('DONE')); - }); - - test('cancellation in pure isolate', () { - var response = new ReceivePort(); - var remote = Isolate.spawn(cancellingIsolate, [ - ['START'], - response.sendPort - ]); - expect(remote.then((_) => response.first), completion('DONE')); - }); -} diff --git a/tests/lib/lib_dart2js.status b/tests/lib/lib_dart2js.status index 953c14869fe..52bd162c874 100644 --- a/tests/lib/lib_dart2js.status +++ b/tests/lib/lib_dart2js.status @@ -7,7 +7,6 @@ convert/chunked_conversion_utf88_test: Slow, Pass convert/utf85_test: Slow, Pass developer/metrics_num_test: Skip # Because of an int / double type test. developer/timeline_test: Skip # Not supported -html/async_test: SkipByDesign html/custom/document_register_basic_test: Slow, Pass html/custom/document_register_type_extensions_test/construction: Slow, Pass html/custom/document_register_type_extensions_test/registration: Slow, Pass