Skip to content

Commit

Permalink
Modified harness.js file
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverWang13 committed Feb 7, 2023
1 parent 7b9a6e2 commit 27ff022
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/background/helpers/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const setup = async (ops) => {


if (loadExtension) {
let extensionPath = 'desktop/optmeowt/optmeowt-browser-extension/dev/chrome'
let extensionPath = 'dev/chrome'

args.push('--disable-extensions-except=' + extensionPath)
args.push('--load-extension=' + extensionPath)
Expand All @@ -46,17 +46,13 @@ const setup = async (ops) => {
// Grab a handle on the background page for the extension.
try {
const backgroundPageTarget = await browser.waitForTarget(
target => (
target.type() === 'background_page' ||
target.type() === 'service_worker'
),
target => target.type() === 'service_worker'
,
{ timeout: 4000 }
)
bgPage = backgroundPageTarget.type() === 'background_page'
? await backgroundPageTarget.page()
: await backgroundPageTarget.worker()
bgPage = await backgroundPageTarget.worker()
} catch (e) {
throw new Error(`Couldn't find background page. ${e}`)
throw new Error(`Couldn't find background page or service worker. ${e}`)
}

if (!bgPage) {
Expand Down

0 comments on commit 27ff022

Please sign in to comment.