Skip to content

Commit f255de8

Browse files
committed
Devtools Client - Extract IDevToolsClient interface for testability
Improve xml doc comments
1 parent 4782cba commit f255de8

File tree

253 files changed

+879
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+879
-339
lines changed

CefSharp.Test/DevTools/DevToolsClientFacts.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,28 @@ public async Task CanGetDevToolsProtocolVersion()
6565
}
6666
}
6767
}
68+
69+
[Fact]
70+
public async Task CanGetDevToolsProtocolGetWindowForTarget()
71+
{
72+
using (var browser = new ChromiumWebBrowser("www.google.com"))
73+
{
74+
await browser.LoadPageAsync();
75+
76+
using (var devToolsClient = browser.GetDevToolsClient())
77+
{
78+
var response = await devToolsClient.Browser.GetWindowForTargetAsync();
79+
var windowId = response.WindowId;
80+
var bounds = response.Bounds;
81+
82+
Assert.NotEqual(0, windowId);
83+
Assert.NotNull(bounds);
84+
Assert.True(bounds.Height > 0);
85+
Assert.True(bounds.Width > 0);
86+
Assert.True(bounds.WindowState.HasValue);
87+
}
88+
}
89+
}
90+
6891
}
6992
}

CefSharp/CefSharp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@
330330
<Compile Include="DevTools\HeapProfiler\SamplingHeapProfileNode.cs" />
331331
<Compile Include="DevTools\HeapProfiler\SamplingHeapProfileSample.cs" />
332332
<Compile Include="DevTools\HeapProfiler\StopSamplingResponse.cs" />
333+
<Compile Include="DevTools\IDevToolsClient.cs" />
333334
<Compile Include="DevTools\IndexedDB\DatabaseWithObjectStores.cs" />
334335
<Compile Include="DevTools\IndexedDB\DataEntry.cs" />
335336
<Compile Include="DevTools\IndexedDB\GetMetadataResponse.cs" />

CefSharp/DevTools/Accessibility/Accessibility.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace CefSharp.DevTools.Accessibility
1010
/// </summary>
1111
public partial class Accessibility : DevToolsDomainBase
1212
{
13-
public Accessibility(CefSharp.DevTools.DevToolsClient client)
13+
public Accessibility(CefSharp.DevTools.IDevToolsClient client)
1414
{
1515
_client = (client);
1616
}
1717

18-
private CefSharp.DevTools.DevToolsClient _client;
18+
private CefSharp.DevTools.IDevToolsClient _client;
1919
/// <summary>
2020
/// Disables the accessibility domain.
2121
/// </summary>
@@ -28,6 +28,8 @@ public async System.Threading.Tasks.Task<DevToolsMethodResponse> DisableAsync()
2828

2929
/// <summary>
3030
/// Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls.
31+
/// This turns on accessibility for the page, which can impact performance until accessibility is disabled.
32+
/// </summary>
3133
public async System.Threading.Tasks.Task<DevToolsMethodResponse> EnableAsync()
3234
{
3335
System.Collections.Generic.Dictionary<string, object> dict = null;

CefSharp/DevTools/Accessibility/Enums/AXPropertyName.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ namespace CefSharp.DevTools.Accessibility
55
{
66
/// <summary>
77
/// Values of AXProperty name:
8+
/// - from 'busy' to 'roledescription': states which apply to every AX node
9+
/// - from 'live' to 'root': attributes which apply to nodes in live regions
10+
/// - from 'autocomplete' to 'valuetext': attributes which apply to widgets
11+
/// - from 'checked' to 'selected': states which apply to widgets
12+
/// - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling.
13+
/// </summary>
814
public enum AXPropertyName
915
{
1016
/// <summary>

CefSharp/DevTools/Accessibility/GetPartialAXTreeResponse.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ internal System.Collections.Generic.IList<CefSharp.DevTools.Accessibility.AXNode
1717
}
1818

1919
/// <summary>
20-
/// The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and
20+
/// nodes
21+
/// </summary>
2122
public System.Collections.Generic.IList<CefSharp.DevTools.Accessibility.AXNode> Nodes
2223
{
2324
get

CefSharp/DevTools/Animation/Animation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace CefSharp.DevTools.Animation
1010
/// </summary>
1111
public partial class Animation : DevToolsDomainBase
1212
{
13-
public Animation(CefSharp.DevTools.DevToolsClient client)
13+
public Animation(CefSharp.DevTools.IDevToolsClient client)
1414
{
1515
_client = (client);
1616
}
1717

18-
private CefSharp.DevTools.DevToolsClient _client;
18+
private CefSharp.DevTools.IDevToolsClient _client;
1919
/// <summary>
2020
/// Disables animation domain notifications.
2121
/// </summary>

CefSharp/DevTools/Animation/GetCurrentTimeResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal long currentTime
1717
}
1818

1919
/// <summary>
20-
/// Current time of the page.
20+
/// currentTime
2121
/// </summary>
2222
public long CurrentTime
2323
{

CefSharp/DevTools/Animation/GetPlaybackRateResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal long playbackRate
1717
}
1818

1919
/// <summary>
20-
/// Playback rate for animations on page.
20+
/// playbackRate
2121
/// </summary>
2222
public long PlaybackRate
2323
{

CefSharp/DevTools/Animation/ResolveAnimationResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal CefSharp.DevTools.Runtime.RemoteObject remoteObject
1717
}
1818

1919
/// <summary>
20-
/// Corresponding remote object.
20+
/// remoteObject
2121
/// </summary>
2222
public CefSharp.DevTools.Runtime.RemoteObject RemoteObject
2323
{

CefSharp/DevTools/ApplicationCache/ApplicationCache.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace CefSharp.DevTools.ApplicationCache
1010
/// </summary>
1111
public partial class ApplicationCache : DevToolsDomainBase
1212
{
13-
public ApplicationCache(CefSharp.DevTools.DevToolsClient client)
13+
public ApplicationCache(CefSharp.DevTools.IDevToolsClient client)
1414
{
1515
_client = (client);
1616
}
1717

18-
private CefSharp.DevTools.DevToolsClient _client;
18+
private CefSharp.DevTools.IDevToolsClient _client;
1919
/// <summary>
2020
/// Enables application cache domain notifications.
2121
/// </summary>
@@ -39,6 +39,8 @@ public async System.Threading.Tasks.Task<GetApplicationCacheForFrameResponse> Ge
3939

4040
/// <summary>
4141
/// Returns array of frame identifiers with manifest urls for each frame containing a document
42+
/// associated with some application cache.
43+
/// </summary>
4244
public async System.Threading.Tasks.Task<GetFramesWithManifestsResponse> GetFramesWithManifestsAsync()
4345
{
4446
System.Collections.Generic.Dictionary<string, object> dict = null;

0 commit comments

Comments
 (0)