Skip to content

Commit ce1725c

Browse files
committed
[js] Remove setLoggingPrefs from firefox.Option and safari.Options
Both of these methods were no-op holdovers from the legacy WebDriver implementations that are no longer supported.
1 parent 1d0ad21 commit ce1725c

File tree

4 files changed

+7
-49
lines changed

4 files changed

+7
-49
lines changed

javascript/node/selenium-webdriver/CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ mode.
6767
- setDefaultFlow
6868
- when (use Promise.resolve)
6969
* Renamed `WebDriver#schedule()` to `WebDriver#execute()`
70+
* Changes to `firefox.Options`
71+
- Removed setLoggingPreferences (was a no-op)
72+
* Changes to `safari.Options`
73+
- Removed setLoggingPreferences (was a no-op)
7074
* Changes to `lib/webdriver.Window` (`driver.manage().window()`):
7175
- Added
7276
- getRect

javascript/node/selenium-webdriver/firefox/index.js

-18
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ const io = require('../io');
130130
const exec = require('../io/exec');
131131
const capabilities = require('../lib/capabilities');
132132
const command = require('../lib/command');
133-
const logging = require('../lib/logging');
134133
const webdriver = require('../lib/webdriver');
135134
const net = require('../net');
136135
const portprober = require('../net/portprober');
@@ -151,9 +150,6 @@ class Options {
151150
/** @private {!Array<string>} */
152151
this.args_ = [];
153152

154-
/** @private {logging.Preferences} */
155-
this.logPrefs_ = null;
156-
157153
/** @private {?capabilities.ProxyConfig} */
158154
this.proxy_ = null;
159155
}
@@ -231,16 +227,6 @@ class Options {
231227
throw TypeError('binary must be a string path or Channel object');
232228
}
233229

234-
/**
235-
* Sets the logging preferences for the new session.
236-
* @param {logging.Preferences} prefs The logging preferences.
237-
* @return {!Options} A self reference.
238-
*/
239-
setLoggingPreferences(prefs) {
240-
this.logPrefs_ = prefs;
241-
return this;
242-
}
243-
244230
/**
245231
* Sets the proxy to use.
246232
*
@@ -262,10 +248,6 @@ class Options {
262248
let firefoxOptions = {};
263249
caps.set('moz:firefoxOptions', firefoxOptions);
264250

265-
if (this.logPrefs_) {
266-
caps.set(capabilities.Capability.LOGGING_PREFS, this.logPrefs_);
267-
}
268-
269251
if (this.proxy_) {
270252
caps.set(capabilities.Capability.PROXY, this.proxy_);
271253
}

javascript/node/selenium-webdriver/safari.js

-21
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const io = require('./io');
2626
const {Capabilities, Capability} = require('./lib/capabilities');
2727
const command = require('./lib/command');
2828
const error = require('./lib/error');
29-
const logging = require('./lib/logging');
3029
const promise = require('./lib/promise');
3130
const Symbols = require('./lib/symbols');
3231
const webdriver = require('./lib/webdriver');
@@ -78,9 +77,6 @@ class Options {
7877
/** @private {Object<string, *>} */
7978
this.options_ = null;
8079

81-
/** @private {./lib/logging.Preferences} */
82-
this.logPrefs_ = null;
83-
8480
/** @private {?./lib/capabilities.ProxyConfig} */
8581
this.proxy_ = null;
8682
}
@@ -106,10 +102,6 @@ class Options {
106102
options.setProxy(capabilities.get(Capability.PROXY));
107103
}
108104

109-
if (capabilities.has(Capability.LOGGING_PREFS)) {
110-
options.setLoggingPrefs(capabilities.get(Capability.LOGGING_PREFS));
111-
}
112-
113105
return options;
114106
}
115107

@@ -128,16 +120,6 @@ class Options {
128120
return this;
129121
}
130122

131-
/**
132-
* Sets the logging preferences for the new session.
133-
* @param {!./lib/logging.Preferences} prefs The logging preferences.
134-
* @return {!Options} A self reference.
135-
*/
136-
setLoggingPrefs(prefs) {
137-
this.logPrefs_ = prefs;
138-
return this;
139-
}
140-
141123
/**
142124
* Sets the proxy to use.
143125
*
@@ -173,9 +155,6 @@ class Options {
173155
*/
174156
toCapabilities(opt_capabilities) {
175157
var caps = opt_capabilities || Capabilities.safari();
176-
if (this.logPrefs_) {
177-
caps.set(Capability.LOGGING_PREFS, this.logPrefs_);
178-
}
179158
if (this.proxy_) {
180159
caps.set(Capability.PROXY, this.proxy_);
181160
}

javascript/node/selenium-webdriver/test/safari_test.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,11 @@ describe('safari.Options', function() {
4040

4141
it('extracts supported WebDriver capabilities', function() {
4242
let proxyPrefs = proxy.direct(),
43-
logPrefs = {},
4443
caps = webdriver.Capabilities.chrome()
45-
.set(webdriver.Capability.PROXY, proxyPrefs)
46-
.set(webdriver.Capability.LOGGING_PREFS, logPrefs);
44+
.set(webdriver.Capability.PROXY, proxyPrefs);
4745

4846
let options = safari.Options.fromCapabilities(caps);
4947
assert(options.proxy_).equalTo(proxyPrefs);
50-
assert(options.logPrefs_).equalTo(logPrefs);
5148
});
5249
});
5350

@@ -73,16 +70,12 @@ describe('safari.Options', function() {
7370
});
7471

7572
it('sets generic driver capabilities', function() {
76-
let proxyPrefs = proxy.direct(),
77-
loggingPrefs = {};
73+
let proxyPrefs = proxy.direct();
7874

79-
options
80-
.setLoggingPrefs(loggingPrefs)
81-
.setProxy(proxyPrefs);
75+
options.setProxy(proxyPrefs);
8276

8377
let caps = options.toCapabilities();
8478
assert(caps.get('proxy')).equalTo(proxyPrefs);
85-
assert(caps.get('loggingPrefs')).equalTo(loggingPrefs);
8679
});
8780
});
8881
});

0 commit comments

Comments
 (0)