Commit 37785fb
[Gardener] Use
The issue is:
* We stub out `setTimeout`, it turns from `trackingSetTimeout` to `stubbedTestTimeout`.
* The test restores it, so it turns to `trackingSetTimeout`.
* On `restoreAll`, `window['setTimeout']` returns to `originalSetTimeout`.
* Calling `sinon.restore()` makes `window['setTimeout']` return to `trackingSetTimeout`.
Then, when we stub out `setTimeout` in `startTrackingAsyncActivity`, the original
is returned as `trackingSetTimeout` whereas it should have returned as `originalSetTimeout`.
Bug: none
Change-Id: I4c0e376368507b16e57b803eff7b5a04d4e9f7f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6926730
Auto-Submit: Ergün Erdoğmuş <[email protected]>
Commit-Queue: Ergün Erdoğmuş <[email protected]>
Commit-Queue: Nikolay Vitkov <[email protected]>
Reviewed-by: Nikolay Vitkov <[email protected]>sinon.useFakeTimers instead of stubbing setTimeout
1 parent f2cfd21 commit 37785fb
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
143 | | - | |
144 | 143 | | |
145 | 144 | | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
| |||
0 commit comments