diff --git a/DeviceDescriptors.js b/DeviceDescriptors.js deleted file mode 100644 index 9b5345d4bdb36..0000000000000 --- a/DeviceDescriptors.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright 2019 Google Inc. All rights reserved. - * - * 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. - */ - -module.exports = require('./lib/common/DeviceDescriptors'); diff --git a/Errors.js b/Errors.js deleted file mode 100644 index e4bdabb1e948f..0000000000000 --- a/Errors.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright 2018 Google Inc. All rights reserved. - * - * 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. - */ - -module.exports = require('./lib/common/Errors'); diff --git a/docs/api.md b/docs/api.md index c78608732b064..cb1742482011a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -514,8 +514,6 @@ const iPhone = puppeteer.devices['iPhone 6']; })(); ``` -> **NOTE** The old way (Puppeteer versions <= v1.14.0) devices can be obtained with `require('puppeteer/DeviceDescriptors')`. - #### puppeteer.errors - returns: <[Object]> - `TimeoutError` <[function]> A class of [TimeoutError]. diff --git a/examples/screenshot-fullpage.js b/examples/screenshot-fullpage.js index e6ca765760073..8844cbcfee5b0 100644 --- a/examples/screenshot-fullpage.js +++ b/examples/screenshot-fullpage.js @@ -17,12 +17,11 @@ 'use strict'; const puppeteer = require('puppeteer'); -const devices = require('puppeteer/DeviceDescriptors'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); - await page.emulate(devices['iPhone 6']); + await page.emulate(puppeteer.devices['iPhone 6']); await page.goto('https://www.nytimes.com/'); await page.screenshot({ path: 'full.png', fullPage: true }); await browser.close(); diff --git a/package.json b/package.json index ba0d15dbe314d..ab58f3a46e95d 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,6 @@ }, "files": [ "lib/", - "Errors.js", - "DeviceDescriptors.js", "index.js", "install.js", "typescript-if-required.js" diff --git a/test/launcher.spec.js b/test/launcher.spec.js index 7c031f5c9fa4b..b20e0f52b97b3 100644 --- a/test/launcher.spec.js +++ b/test/launcher.spec.js @@ -592,22 +592,6 @@ describe('Launcher specs', function () { }); }); - describe('Top-level requires', function () { - it('should require top-level Errors', async () => { - const { puppeteer, puppeteerPath } = getTestState(); - const Errors = require(path.join(puppeteerPath, '/Errors')); - expect(Errors.TimeoutError).toBe(puppeteer.errors.TimeoutError); - }); - it('should require top-level DeviceDescriptors', async () => { - const { puppeteer, puppeteerPath } = getTestState(); - const { devicesMap } = require(path.join( - puppeteerPath, - '/DeviceDescriptors' - )); - expect(devicesMap['iPhone 6']).toBe(puppeteer.devices['iPhone 6']); - }); - }); - describe('Browser target events', function () { itFailsFirefox('should work', async () => { const { server, puppeteer, defaultBrowserOptions } = getTestState();