Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
996 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | /**
|
---|
3 | * @license Angular v12.0.0-next.0
|
---|
4 | * (c) 2010-2020 Google LLC. https://angular.io/
|
---|
5 | * License: MIT
|
---|
6 | */
|
---|
7 | /**
|
---|
8 | * @license
|
---|
9 | * Copyright Google LLC All Rights Reserved.
|
---|
10 | *
|
---|
11 | * Use of this source code is governed by an MIT-style license that can be
|
---|
12 | * found in the LICENSE file at https://angular.io/license
|
---|
13 | */
|
---|
14 | class SyncTestZoneSpec {
|
---|
15 | constructor(namePrefix) {
|
---|
16 | this.runZone = Zone.current;
|
---|
17 | this.name = 'syncTestZone for ' + namePrefix;
|
---|
18 | }
|
---|
19 | onScheduleTask(delegate, current, target, task) {
|
---|
20 | switch (task.type) {
|
---|
21 | case 'microTask':
|
---|
22 | case 'macroTask':
|
---|
23 | throw new Error(`Cannot call ${task.source} from within a sync test.`);
|
---|
24 | case 'eventTask':
|
---|
25 | task = delegate.scheduleTask(target, task);
|
---|
26 | break;
|
---|
27 | }
|
---|
28 | return task;
|
---|
29 | }
|
---|
30 | }
|
---|
31 | // Export the class so that new instances can be created with proper
|
---|
32 | // constructor params.
|
---|
33 | Zone['SyncTestZoneSpec'] = SyncTestZoneSpec;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.