2020-01-07 10:22:35 +08:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2019-12-06 03:29:16 +08:00
|
|
|
|
2020-04-29 08:06:01 +08:00
|
|
|
const { Playwright } = require('./lib/server/playwright');
|
2020-08-24 04:46:40 +08:00
|
|
|
const { Electron } = require('./lib/server/electron/electron');
|
2020-08-11 05:18:58 +08:00
|
|
|
const { setupInProcess } = require('./lib/rpc/inprocess');
|
2020-05-12 00:38:09 +08:00
|
|
|
const path = require('path');
|
2019-12-21 07:31:20 +08:00
|
|
|
|
2020-05-22 04:18:15 +08:00
|
|
|
const playwright = new Playwright(__dirname, require(path.join(__dirname, 'browsers.json'))['browsers']);
|
2020-05-12 09:00:33 +08:00
|
|
|
playwright.electron = new Electron();
|
2020-08-11 11:49:53 +08:00
|
|
|
if (process.env.PWCHANNEL === 'none') {
|
|
|
|
playwright._toImpl = x => x;
|
|
|
|
module.exports = playwright;
|
|
|
|
} else {
|
|
|
|
module.exports = setupInProcess(playwright);
|
|
|
|
}
|