Skip to content

Commit

Permalink
#2398. Update asyncStart/End() to correspond SDK version. Replace asy…
Browse files Browse the repository at this point in the history
…ncMultiTest (#2406)

Update asyncStart/End() to correspond SDK version. Replace asyncMultiStart by asyncStart.
  • Loading branch information
sgrekhov committed Nov 30, 2023
1 parent ad4f95c commit f1fcc6d
Show file tree
Hide file tree
Showing 53 changed files with 93 additions and 78 deletions.
3 changes: 1 addition & 2 deletions LibTest/async/Completer/completeError_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() {

var v = [1,2,3];

asyncMultiStart(2);
asyncStart(2);

var f = new Future.value(v).then((x) {
asyncEnd();
Expand All @@ -34,4 +34,3 @@ main() {

completer.completeError(f);
}

2 changes: 1 addition & 1 deletion LibTest/async/Completer/completeError_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() {

var e = new Error();

asyncMultiStart(2);
asyncStart(2);

var f = new Future.error(e).catchError((x) {
asyncEnd();
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Future/Future.microtask_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() {
var completer2 = new Completer();
Future future2 = new Future.microtask(() => completer2.future);

asyncMultiStart(2);
asyncStart(2);

future
.then((x) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Future/Future.sync_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() {
var completer2 = new Completer();
Future future2 = new Future.sync(() => completer2.future);

asyncMultiStart(2);
asyncStart(2);

future
.then((x) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Future/Future_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import "../../../Utils/expect.dart";

main() {
var value = [1, 2, 3];
asyncMultiStart(2);
asyncStart(2);
Future future = new Future(() => new Future.value(value));
Future future2 = new Future(() => new Future.error(value));

Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Future/catchError_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ main() {
f.catchError(onError1);
f.catchError(onError2);

asyncMultiStart(2);
asyncStart(2);
completer.completeError('!!!');
}
2 changes: 1 addition & 1 deletion LibTest/async/Future/catchError_A06_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ check(value) {
Completer completer = new Completer();
Future f = completer.future;

asyncMultiStart(2);
asyncStart(2);

f.catchError(
(exception) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Stream/asBroadcastStream_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ main() {
);
Stream b = controller.stream.asBroadcastStream();
Expect.isFalse(hasListener);
asyncMultiStart(2);
asyncStart(2);
b.listen(
(_) {
Expect.isTrue(hasListener);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Stream/handleError_A04_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ main() {
asyncEnd();
});

asyncMultiStart(N);
asyncStart(N);

s3.listen((_) {
Expect.fail('unexpected onData event');
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Stream/listen_A05_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main() {
}
});

asyncMultiStart(N);
asyncStart(N);

s2.listen((_) {
Expect.fail('unexpected call to onData');
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Stream/pipe_A04_t02.test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void test(CreateStreamFunction create) {
}
);

asyncMultiStart(2);
asyncStart(2);
s.pipe(c).then(
(_) {
Expect.fail("Returned future should complete with error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ check(List events) {
List expectedData = events.where((e) => !(e is num) || e >= 0).toList();
List expectedErrors = events.where((e) => e is num && e < 0).toList();

asyncMultiStart(2);
asyncStart(2);

List events1 = [], errors1 = [];
s.listen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import "../../../Utils/expect.dart";
main() {
StreamController controller = new StreamController.broadcast();
Stream stream = controller.stream;
asyncMultiStart(2);
asyncStart(2);
List log1 = [];
StreamSubscription sub1 =
stream.listen((event) => log1.add(event), onDone: () {
Expand All @@ -27,8 +27,7 @@ main() {
});

List log2 = [];
StreamSubscription sub2 =
stream.listen((event) => log2.add(event), onDone: () {
stream.listen((event) => log2.add(event), onDone: () {
Expect.listEquals([1, 2, 3, 4, 5], log2);
asyncEnd();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "../../../Utils/expect.dart";

main() {
int onCancelCallCount = 0;
asyncMultiStart(6);
asyncStart(6);
StreamController? controller;
controller = new StreamController.broadcast(
onCancel: () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import "../../../Utils/expect.dart";
main() {
bool onListenCalled = false;
bool onCancelCalled = false;
asyncMultiStart(4);
asyncStart(4);

StreamController controller = new StreamController.broadcast(
onListen: () {
Expand All @@ -44,4 +44,3 @@ main() {

controller.close();
}

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ main() {
}
);

asyncMultiStart(3);
asyncStart(3);

c.stream.transform(tr).listen(
(x) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/async/Zone/handleUncaughtError_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void test() {
} catch (e, st) {
stackTraces[count] = st;

asyncMultiStart(2);
asyncStart(2);

new Future.error(e,st);

Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Element/addEventListener_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ main() {
var x = new ButtonElement();
document.body?.append(x);

asyncMultiStart(3);
asyncStart(3);

x.addEventListener(type, (e) {
Expect.equals(type, e.type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Element/addEventListener_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ main() {
var x = new ButtonElement();
document.body?.append(x);

asyncMultiStart(2);
asyncStart(2);

// intercept on capture
document.body?.addEventListener(type, (e) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Element/addEventListener_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main() {

var n = 10;

asyncMultiStart(n);
asyncStart(n);

EventListener genHandler() => (e) {
Expect.equals(type, e.type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Element/addEventListener_A01_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main() {

var n = 10;

asyncMultiStart(n);
asyncStart(n);

EventListener genHandler() => (e) {
Expect.equals(type, e.type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Element/removeEventListener_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main() {
x.addEventListener(type, handler1);
x.addEventListener(type, handler2);

asyncMultiStart(3); // first time two handlers, second time one handler
asyncStart(3); // first time two handlers, second time one handler
var event = new Event(type);
x.dispatchEvent(event);
event = new Event(type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Element/removeEventListener_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ main() {
body?.addEventListener(type, handler1, true);
body?.addEventListener(type, handler2, true);

asyncMultiStart(3); // first time two handlers, second time one handler
asyncStart(3); // first time two handlers, second time one handler
var event = new Event(type);
x.dispatchEvent(event);
event = new Event(type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Event/currentTarget_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ main() {
asyncEnd();
});

asyncMultiStart(2);
asyncStart(2);
div.dispatchEvent(new MouseEvent('click'));
}
2 changes: 1 addition & 1 deletion LibTest/html/Event/defaultPrevented_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ main() {
asyncEnd();
});

asyncMultiStart(2);
asyncStart(2);
div.dispatchEvent(new MouseEvent('click'));
}
2 changes: 1 addition & 1 deletion LibTest/html/Event/eventPhase_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() {
asyncEnd();
});

asyncMultiStart(3);
asyncStart(3);
div.dispatchEvent(new MouseEvent('click'));
} else {
Expect.fail("Body is null");
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Event/matchingTarget_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ main() {
asyncEnd();
});

asyncMultiStart(2);
asyncStart(2);
id1.click();
class1.click();
} else {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Event/target_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() {
asyncEnd();
});

asyncMultiStart(3);
asyncStart(3);
div.dispatchEvent(new MouseEvent('click'));
} else {
Expect.fail("Body is null");
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/IFrameElement/addEventListener_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ main() {
IFrameElement x = new IFrameElement();
document.body?.append(x);

asyncMultiStart(3);
asyncStart(3);

x.addEventListener(type, (e) {
Expect.equals(type, e.type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/IFrameElement/addEventListener_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ main() {
IFrameElement x = new IFrameElement();
document.body?.append(x);

asyncMultiStart(2);
asyncStart(2);

// intercept on capture
document.body?.addEventListener(type, (e) {
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/IFrameElement/addEventListener_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main() {

var n = 10;

asyncMultiStart(n);
asyncStart(n);

EventListener genHandler() => (e) {
Expect.equals(type, e.type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/IFrameElement/addEventListener_A01_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main() {

var n = 10;

asyncMultiStart(n);
asyncStart(n);

EventListener genHandler() => (e) {
Expect.equals(type, e.type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main() {
x.addEventListener(type, handler1);
x.addEventListener(type, handler2);

asyncMultiStart(3); // first time two handlers, second time one handler
asyncStart(3); // first time two handlers, second time one handler
var event = new Event(type);
x.dispatchEvent(event);
event = new Event(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ main() {
body?.addEventListener(type, handler1, true);
body?.addEventListener(type, handler2, true);

asyncMultiStart(3); // first time two handlers, second time one handler
asyncStart(3); // first time two handlers, second time one handler
var event = new Event(type);
x.dispatchEvent(event);
event = new Event(type);
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/addEventListener_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ main() {
document,
new DocumentFragment(),
];
asyncMultiStart(targets.length);
asyncStart(targets.length);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/addEventListener_A01_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ main() {
document,
new DocumentFragment(),
];
asyncMultiStart(targets.length);
asyncStart(targets.length);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/addEventListener_A01_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ main() {
document,
new DocumentFragment(),
];
asyncMultiStart(targets.length);
asyncStart(targets.length);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/addEventListener_A01_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ main() {
document,
new DocumentFragment(),
];
asyncMultiStart(targets.length);
asyncStart(targets.length);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/addEventListener_A01_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ main() {
document,
new DocumentFragment(),
];
asyncMultiStart(targets.length * n);
asyncStart(targets.length * n);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/dispatchEvent_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main() {
new IFrameElement(),
document,
];
asyncMultiStart(targets.length);
asyncStart(targets.length);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/on_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ main() {
new IFrameElement(),
new DocumentFragment(),
];
asyncMultiStart(targets.length);
asyncStart(targets.length);
for (Node x in targets) {
check(x);
}
Expand Down
2 changes: 1 addition & 1 deletion LibTest/html/Node/removeEventListener_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ main() {
new Comment("Comment"),
new DocumentFragment(),
];
asyncMultiStart(
asyncStart(
targets.length * 3); // first time two handlers, second time one handler
for (Node x in targets) {
check(x);
Expand Down

0 comments on commit f1fcc6d

Please sign in to comment.