Skip to content

Commit f4e584e

Browse files
authored
feat(rpc): align class names with api docs (#3164)
1 parent d0b758a commit f4e584e

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

src/rpc/client/coverage.ts renamed to src/rpc/client/chromiumCoverage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import * as types from '../../types';
1818
import { PageChannel } from '../channels';
1919

20-
export class Coverage {
20+
export class ChromiumCoverage {
2121
private _channel: PageChannel;
2222

2323
constructor(channel: PageChannel) {

src/rpc/client/connection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import { ChromiumBrowserContext } from './chromiumBrowserContext';
3939
import { Selectors } from './selectors';
4040
import { Stream } from './stream';
4141
import { createScheme, Validator, ValidationError } from '../validator';
42+
import { WebKitBrowser } from './webkitBrowser';
43+
import { FirefoxBrowser } from './firefoxBrowser';
4244

4345
class Root extends ChannelOwner<Channel, {}> {
4446
constructor(connection: Connection) {
@@ -126,6 +128,10 @@ export class Connection {
126128
case 'Browser':
127129
if ((parent as BrowserType).name() === 'chromium')
128130
result = new ChromiumBrowser(parent, type, guid, initializer);
131+
else if ((parent as BrowserType).name() === 'webkit')
132+
result = new WebKitBrowser(parent, type, guid, initializer);
133+
else if ((parent as BrowserType).name() === 'firefox')
134+
result = new FirefoxBrowser(parent, type, guid, initializer);
129135
else
130136
result = new Browser(parent, type, guid, initializer);
131137
break;

src/rpc/client/firefoxBrowser.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { Browser } from './browser';
18+
19+
export class FirefoxBrowser extends Browser {
20+
}

src/rpc/client/page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { Func1, FuncOn, SmartHandle, serializeArgument, parseResult } from './js
3535
import { Request, Response, Route, RouteHandler } from './network';
3636
import { FileChooser } from './fileChooser';
3737
import { Buffer } from 'buffer';
38-
import { Coverage } from './coverage';
38+
import { ChromiumCoverage } from './chromiumCoverage';
3939
import { Waiter } from './waiter';
4040

4141
import * as fs from 'fs';
@@ -57,7 +57,7 @@ export class Page extends ChannelOwner<PageChannel, PageInitializer> {
5757
readonly accessibility: Accessibility;
5858
readonly keyboard: Keyboard;
5959
readonly mouse: Mouse;
60-
coverage: Coverage | null = null;
60+
coverage: ChromiumCoverage | null = null;
6161
pdf?: (options?: types.PDFOptions) => Promise<Buffer>;
6262

6363
readonly _bindings = new Map<string, FunctionWithSource>();
@@ -109,7 +109,7 @@ export class Page extends ChannelOwner<PageChannel, PageInitializer> {
109109
this._channel.on('worker', ({ worker }) => this._onWorker(Worker.from(worker)));
110110

111111
if (this._browserContext._browserName === 'chromium') {
112-
this.coverage = new Coverage(this._channel);
112+
this.coverage = new ChromiumCoverage(this._channel);
113113
this.pdf = options => this._pdf(options);
114114
}
115115
}

src/rpc/client/webkitBrowser.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { Browser } from './browser';
18+
19+
export class WebKitBrowser extends Browser {
20+
}

0 commit comments

Comments
 (0)