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

Hangs in FF. running window.close() won't finish process #121

Open
naugtur opened this issue Nov 4, 2016 · 11 comments
Open

Hangs in FF. running window.close() won't finish process #121

naugtur opened this issue Nov 4, 2016 · 11 comments

Comments

@naugtur
Copy link
Contributor

naugtur commented Nov 4, 2016

FF just says

Scripts may not close windows that were not opened by script.

and wouldn't close.

Env:
linux with FF 49.0

Also noticed a tab with sessionrestore whenever I browser-run FF more than once.

@juliangruber
Copy link
Owner

Do you have a suggestion how to fix this?

@naugtur
Copy link
Contributor Author

naugtur commented Nov 7, 2016

I hoped for "oh it's ajust a minor regression"

But there might be a command line switch that would disable the security restriction on window.close

@naugtur
Copy link
Contributor Author

naugtur commented Nov 12, 2016

@juliangruber I have two fixes for this.

  1. run-browser uses tap-finished. I made a PoC a change that'd add an option to use it. Not sure what your userbase uses for testing.
  2. add an option to define that if there's no console output for a certain number of miliseconds, tests should be considered done.

I can PR both solutions, but I'd rather know which will get accepted before I do ;)

For both solutions I didn't check if browser.kill() is available in all launchers, but there must be a way to kill a process.

@juliangruber
Copy link
Owner

Ah, so you're using this through tape-run?

@naugtur
Copy link
Contributor Author

naugtur commented Nov 13, 2016

I'm piping browserify output (or webpack in other repo) to browser-run and then to tap-spec

What I'm hoping to get here is if this is the popular way browser-run is used for testing or not.
The timeout option would work with anything that produces output

@juliangruber
Copy link
Owner

I guess we can just add another timeout that will kill the browser child_process if window.close() fails

@naugtur
Copy link
Contributor Author

naugtur commented Nov 13, 2016

One more idea - if browser-run prints pid of the browser in the first line, an external tool could easily kill the browser based on the output.

@mvoss9000
Copy link

Hi - I use tape and browser-run. (I like to use the minimum amount of framework when possible). I would love to see a --close-after-tap (or similar) that shuts down the browser based on tap tests finishing as well.

@naugtur
Copy link
Contributor Author

naugtur commented Feb 5, 2017

I could implement that, but it seems like something more generic would be nice...
Maybe not just tap, but a 'safeword' anyone could use to finish by console.logging it...

I'll probably have to figure it out some time this month anyway :)

@mvoss9000
Copy link

Sounds good. look forward to it!

@naugtur
Copy link
Contributor Author

naugtur commented Feb 17, 2017

@mvoss9000 @juliangruber
I added a PR for tap-finish

I see following options to move it forward:

  • leave as is, for tap support only
  • add an additional option to kill the browser if no output was printed for configurable number of miliseconds
  • replace this with just the timeout to avoid a dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants