Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rpc): align class names with api docs #3164

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import * as types from '../../types';
import { PageChannel } from '../channels';

export class Coverage {
export class ChromiumCoverage {
private _channel: PageChannel;

constructor(channel: PageChannel) {
Expand Down
6 changes: 6 additions & 0 deletions src/rpc/client/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import { ChromiumBrowserContext } from './chromiumBrowserContext';
import { Selectors } from './selectors';
import { Stream } from './stream';
import { createScheme, Validator, ValidationError } from '../validator';
import { WebKitBrowser } from './webkitBrowser';
import { FirefoxBrowser } from './firefoxBrowser';

class Root extends ChannelOwner<Channel, {}> {
constructor(connection: Connection) {
Expand Down Expand Up @@ -126,6 +128,10 @@ export class Connection {
case 'Browser':
if ((parent as BrowserType).name() === 'chromium')
result = new ChromiumBrowser(parent, type, guid, initializer);
else if ((parent as BrowserType).name() === 'webkit')
result = new WebKitBrowser(parent, type, guid, initializer);
else if ((parent as BrowserType).name() === 'firefox')
result = new FirefoxBrowser(parent, type, guid, initializer);
else
result = new Browser(parent, type, guid, initializer);
break;
Expand Down
20 changes: 20 additions & 0 deletions src/rpc/client/firefoxBrowser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed 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.
*/

import { Browser } from './browser';

export class FirefoxBrowser extends Browser {
}
6 changes: 3 additions & 3 deletions src/rpc/client/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { Func1, FuncOn, SmartHandle, serializeArgument, parseResult } from './js
import { Request, Response, Route, RouteHandler } from './network';
import { FileChooser } from './fileChooser';
import { Buffer } from 'buffer';
import { Coverage } from './coverage';
import { ChromiumCoverage } from './chromiumCoverage';
import { Waiter } from './waiter';

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

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

if (this._browserContext._browserName === 'chromium') {
this.coverage = new Coverage(this._channel);
this.coverage = new ChromiumCoverage(this._channel);
this.pdf = options => this._pdf(options);
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/rpc/client/webkitBrowser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed 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.
*/

import { Browser } from './browser';

export class WebKitBrowser extends Browser {
}