@@ -40,7 +40,7 @@ public void IsSharingWith()
40
40
public void CanGetContentSetting ( )
41
41
{
42
42
var ctx = RequestContext . Configure ( )
43
- . WithCachePath ( Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "CefSharp\\ Tests\\ TempCache1 " ) )
43
+ . WithCachePath ( Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "CefSharp\\ Tests\\ TempCache2 " ) )
44
44
. Create ( ) ;
45
45
46
46
var actual = ctx . GetContentSetting ( CefExample . DefaultUrl , null , ContentSettingTypes . Autoplay ) ;
@@ -51,10 +51,18 @@ public void CanGetContentSetting()
51
51
[ Fact ]
52
52
public async Task CanSetContentSetting ( )
53
53
{
54
+ var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
55
+
54
56
var ctx = RequestContext . Configure ( )
55
- . WithCachePath ( Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "CefSharp\\ Tests\\ TempCache1" ) )
57
+ . WithCachePath ( Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "CefSharp\\ Tests\\ TempCache3" ) )
58
+ . OnInitialize ( ( ctx ) =>
59
+ {
60
+ tcs . SetResult ( true ) ;
61
+ } )
56
62
. Create ( ) ;
57
63
64
+ await tcs . Task ;
65
+
58
66
var actual = ContentSettingValues . Default ;
59
67
60
68
await CefThread . ExecuteOnUiThread ( ( ) =>
@@ -70,10 +78,18 @@ await CefThread.ExecuteOnUiThread(() =>
70
78
[ Fact ]
71
79
public async Task CanSetWebsiteSetting ( )
72
80
{
81
+ var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
82
+
73
83
var ctx = RequestContext . Configure ( )
74
- . WithCachePath ( Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "CefSharp\\ Tests\\ TempCache1" ) )
84
+ . WithCachePath ( Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "CefSharp\\ Tests\\ TempCache4" ) )
85
+ . OnInitialize ( ( ctx ) =>
86
+ {
87
+ tcs . SetResult ( true ) ;
88
+ } )
75
89
. Create ( ) ;
76
90
91
+ await tcs . Task ;
92
+
77
93
object actual = ContentSettingValues . Default ;
78
94
79
95
await CefThread . ExecuteOnUiThread ( ( ) =>
0 commit comments