-
Notifications
You must be signed in to change notification settings - Fork 3
/
base.js
60 lines (52 loc) · 1.3 KB
/
base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*! @license
* WebDriver Installer
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Throw an error if the subclass doesn't override an abstract method.
*/
function unimplemented(object, callee) {
throw new Error(
`Unimplemented: ${callee.name} in ${object.constructor.name}`);
}
/**
* An abstract base class for WebDriver installers.
*/
class WebDriverInstallerBase {
/** @return {string} */
getBrowserName() {
unimplemented(this, arguments.callee);
}
/** @return {string} */
getDriverName() {
unimplemented(this, arguments.callee);
}
/** @return {!Promise<?string>} */
async getInstalledBrowserVersion() {
unimplemented(this, arguments.callee);
}
/**
* @param {string} outputDirectory
* @return {!Promise<?string>}
*/
async getInstalledDriverVersion(outputDirectory) {
unimplemented(this, arguments.callee);
}
/**
* @param {string} browserVersion
* @return {!Promise<string>}
*/
async getBestDriverVersion(browserVersion) {
unimplemented(this, arguments.callee);
}
/**
* @param {string} driverVersion
* @param {string} outputDirectory
* @return {!Promise}
*/
async install(driverVersion, outputDirectory) {
unimplemented(this, arguments.callee);
}
}
module.exports = {WebDriverInstallerBase};