@@ -13,7 +13,7 @@ public class FireEventTests
1313 public async Task InvokeFunctionOnLoadEventShouldFireDelayed ( )
1414 {
1515 var service = new JsScriptingService ( ) ;
16- var cfg = Configuration . Default . With ( service ) ;
16+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
1717 var html = "<!doctype html><div id=result></div><script>document.addEventListener('load', function () { document.querySelector('#result').textContent = 'done'; }, false);</script>" ;
1818 var document = await BrowsingContext . New ( cfg ) . OpenAsync ( m => m . Content ( html ) )
1919 . WhenStable ( ) ;
@@ -25,7 +25,7 @@ public async Task InvokeFunctionOnLoadEventShouldFireDelayed()
2525 public async Task InvokeFunctionOnCustomEvent ( )
2626 {
2727 var service = new JsScriptingService ( ) ;
28- var cfg = Configuration . Default . With ( service ) ;
28+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
2929 var html = "<!doctype html><div id=result>0</div><script>var i = 0; document.addEventListener('hello', function () { i++; document.querySelector('#result').textContent = i.toString(); }, false);</script>" ;
3030 var document = await BrowsingContext . New ( cfg ) . OpenAsync ( m => m . Content ( html ) ) ;
3131 var div = document . QuerySelector ( "#result" ) ;
@@ -39,7 +39,7 @@ public async Task InvokeFunctionOnCustomEvent()
3939 public async Task InvokeLoadEventFromJsAndCustomEventFromJsAndCs ( )
4040 {
4141 var service = new JsScriptingService ( ) ;
42- var cfg = Configuration . Default . With ( service ) ;
42+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
4343 var html = @"<!doctype html>
4444<html>
4545<body>
@@ -73,7 +73,7 @@ public async Task InvokeLoadEventFromJsAndCustomEventFromJsAndCs()
7373 public async Task AddClickHandlerClassicallyWillExecute ( )
7474 {
7575 var service = new JsScriptingService ( ) ;
76- var cfg = Configuration . Default . With ( service ) ;
76+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
7777 var html = @"<!doctype html>
7878<html>
7979<body>
@@ -94,7 +94,7 @@ public async Task AddClickHandlerClassicallyWillExecute()
9494 public async Task AddAndRemoveClickHandlerWontExecute ( )
9595 {
9696 var service = new JsScriptingService ( ) ;
97- var cfg = Configuration . Default . With ( service ) ;
97+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
9898 var html = @"<!doctype html>
9999<html>
100100<body>
@@ -116,7 +116,7 @@ public async Task AddAndRemoveClickHandlerWontExecute()
116116 public async Task AddAndInvokeClickHandlerWillChangeCapturedValue ( )
117117 {
118118 var service = new JsScriptingService ( ) ;
119- var cfg = Configuration . Default . With ( service ) ;
119+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
120120 var html = @"<!doctype html>
121121<html>
122122<body>
@@ -137,7 +137,7 @@ public async Task AddAndInvokeClickHandlerWillChangeCapturedValue()
137137 public async Task AddAndInvokeClickHandlerWithStringFunctionWontWork ( )
138138 {
139139 var service = new JsScriptingService ( ) ;
140- var cfg = Configuration . Default . With ( service ) ;
140+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
141141 var html = @"<!doctype html>
142142<html>
143143<body>
@@ -155,7 +155,7 @@ public async Task AddAndInvokeClickHandlerWithStringFunctionWontWork()
155155 [ Test ]
156156 public async Task BodyOnloadWorksWhenSetAsAttributeInitially ( )
157157 {
158- var cfg = Configuration . Default . WithJs ( ) ;
158+ var cfg = Configuration . Default . WithJs ( ) . WithEventLoop ( ) ;
159159 var html = @"<!doctype html>
160160<html>
161161<body onload='window.foo = 2+3'>
@@ -173,7 +173,7 @@ public async Task BodyOnloadWorksWhenSetAsAttributeInitially()
173173 [ Test ]
174174 public async Task BodyOnloadWorksWhenSetAsAttributeLater ( )
175175 {
176- var cfg = Configuration . Default . WithJs ( ) ;
176+ var cfg = Configuration . Default . WithJs ( ) . WithEventLoop ( ) ;
177177 var html = @"<!doctype html>
178178<html>
179179<body>
@@ -192,7 +192,7 @@ public async Task BodyOnloadWorksWhenSetAsAttributeLater()
192192 public async Task SetTimeoutWithNormalFunction ( )
193193 {
194194 var service = new JsScriptingService ( ) ;
195- var cfg = Configuration . Default . With ( service ) ;
195+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
196196 var html = @"<!doctype html>
197197<html>
198198<body>
@@ -214,7 +214,7 @@ public async Task DomContentLoadedEventIsFired_Issue50()
214214 {
215215 //TODO Check this as well on the window level - currently works
216216 //only against document (se AngleSharp#789)
217- var cfg = Configuration . Default . WithJs ( ) ;
217+ var cfg = Configuration . Default . WithJs ( ) . WithEventLoop ( ) ;
218218 var html = @"<!doctype html>
219219<html>
220220<body>
@@ -236,7 +236,7 @@ public async Task DomContentLoadedEventIsFired_Issue50()
236236 [ Test ]
237237 public async Task DocumentLoadEventIsFired_Issue42 ( )
238238 {
239- var cfg = Configuration . Default . WithJs ( ) ;
239+ var cfg = Configuration . Default . WithJs ( ) . WithEventLoop ( ) ;
240240 var html = @"<!doctype html>
241241<html>
242242<body>
@@ -260,7 +260,7 @@ public async Task DocumentLoadEventIsFired_Issue42()
260260 public async Task SetTimeoutWithStringAsFunction ( )
261261 {
262262 var service = new JsScriptingService ( ) ;
263- var cfg = Configuration . Default . With ( service ) ;
263+ var cfg = Configuration . Default . With ( service ) . WithEventLoop ( ) ;
264264 var html = @"<!doctype html>
265265<html>
266266<body>
0 commit comments