From 2bf88fd178ccc88cf571a416cab72f348e07acdd Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Fri, 31 Jan 2020 08:57:47 -0800 Subject: [PATCH] test: start adding capability smoke tests (#784) --- test/assets/wasm/table2.html | 9 +++++++++ test/assets/wasm/table2.wasm | Bin 0 -> 58 bytes test/capabilities.spec.js | 31 +++++++++++++++++++++++++++++++ test/playwright.spec.js | 1 + 4 files changed, 41 insertions(+) create mode 100644 test/assets/wasm/table2.html create mode 100644 test/assets/wasm/table2.wasm create mode 100644 test/capabilities.spec.js diff --git a/test/assets/wasm/table2.html b/test/assets/wasm/table2.html new file mode 100644 index 0000000000..2cac6e5210 --- /dev/null +++ b/test/assets/wasm/table2.html @@ -0,0 +1,9 @@ + diff --git a/test/assets/wasm/table2.wasm b/test/assets/wasm/table2.wasm new file mode 100644 index 0000000000000000000000000000000000000000..292be2c1756f34b8b48b716932261e26ed1cc3b1 GIT binary patch literal 58 zcmV~$!3{t_6h+bd-k1b`D$&L71WO^2jJ+Z?-QiX@EY L=7C(Ik{|H{-}eUZ literal 0 HcmV?d00001 diff --git a/test/capabilities.spec.js b/test/capabilities.spec.js new file mode 100644 index 0000000000..388083af38 --- /dev/null +++ b/test/capabilities.spec.js @@ -0,0 +1,31 @@ +/** + * Copyright Microsoft Corporation. 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. + */ + +const utils = require('./utils'); +const { waitEvent } = utils; + +module.exports.describe = function({testRunner, expect}) { + const {describe, xdescribe, fdescribe} = testRunner; + const {it, fit, xit, dit} = testRunner; + const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; + + describe('Capabilities', function() { + it('Web Assembly should work', async function({page, server}) { + await page.goto(server.PREFIX + '/wasm/table2.html'); + expect(await page.evaluate(() => loadTable())).toBe('42, 83'); + }); + }); +}; diff --git a/test/playwright.spec.js b/test/playwright.spec.js index 385e5a492b..d049fdb0c6 100644 --- a/test/playwright.spec.js +++ b/test/playwright.spec.js @@ -171,6 +171,7 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => { testRunner.loadTests(require('./interception.spec.js'), testOptions); testRunner.loadTests(require('./geolocation.spec.js'), testOptions); testRunner.loadTests(require('./workers.spec.js'), testOptions); + testRunner.loadTests(require('./capabilities.spec.js'), testOptions); if (CHROMIUM) { testRunner.loadTests(require('./chromium/chromium.spec.js'), testOptions);