-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding type-safe options .NET for recently added Chrome capabilities
Adding type-safe capabilities for `mobileEmulation`, `perfLoggingPrefs`, and `windowTypes` to ChromeOptions class.
- Loading branch information
Showing
4 changed files
with
411 additions
and
1 deletion.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
dotnet/src/webdriver/Chrome/ChromeMobileEmulationDeviceSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// <copyright file="ChromeMobileEmulationDeviceSettings.cs" company="WebDriver Committers"> | ||
// Licensed to the Software Freedom Conservancy (SFC) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The SFC licenses this file | ||
// to you under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace OpenQA.Selenium.Chrome | ||
{ | ||
/// <summary> | ||
/// Represents the type-safe options for setting settings for emulating a | ||
/// mobile device in the Chrome browser. | ||
/// </summary> | ||
public class ChromeMobileEmulationDeviceSettings | ||
{ | ||
private string userAgent = string.Empty; | ||
private long width; | ||
private long height; | ||
private double pixelRatio; | ||
private bool enableTouchEvents = true; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChromeMobileEmulationDeviceSettings"/> class. | ||
/// </summary> | ||
public ChromeMobileEmulationDeviceSettings() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChromeMobileEmulationDeviceSettings"/> class. | ||
/// </summary> | ||
/// <param name="userAgent">The user agent string to be used by the browser when emulating | ||
/// a mobile device.</param> | ||
public ChromeMobileEmulationDeviceSettings(string userAgent) | ||
{ | ||
this.userAgent = userAgent; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the user agent string to be used by the browser when emulating | ||
/// a mobile device. | ||
/// </summary> | ||
public string UserAgent | ||
{ | ||
get { return this.userAgent; } | ||
set { this.userAgent = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the width in pixels to be used by the browser when emulating | ||
/// a mobile device. | ||
/// </summary> | ||
public long Width | ||
{ | ||
get { return this.width; } | ||
set { this.width = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the height in pixels to be used by the browser when emulating | ||
/// a mobile device. | ||
/// </summary> | ||
public long Height | ||
{ | ||
get { return this.height; } | ||
set { this.height = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the pixel ratio to be used by the browser when emulating | ||
/// a mobile device. | ||
/// </summary> | ||
public double PixelRatio | ||
{ | ||
get { return this.pixelRatio; } | ||
set { this.pixelRatio = value; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether touch events should be enabled by | ||
/// the browser when emulating a mobile device. Defaults to <see langword="true"/>. | ||
/// </summary> | ||
public bool EnableTouchEvents | ||
{ | ||
get { return this.enableTouchEvents; } | ||
set { this.enableTouchEvents = value; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.