dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.07k stars 1.56k forks source link

notification_permission_test requires human intervention #32002

Open floitschG opened 6 years ago

floitschG commented 6 years ago

At the moment the html/notification_permission_test requires human intervention since there is a popup that the user needs to click. The test therefore times out.

/cc @terrylucas

alan-knight commented 6 years ago

I'm not sure how that test got added. It seems to have been in an unrelated commit, or at least one where I don't see the relationship. https://dart-review.googlesource.com/c/sdk/+/29020

It doesn't look like there was ever a test like this in html, that it was added directly in lib_2/html. Or else my git is insufficient to find it. But as far as I know, there's really no way to test requesting permission without it being interactive - see comments in notification_test.dart.

terrylucas commented 6 years ago

This test can be run 3 ways:

  1. Normal Chrome will require allowing or blocking notifications for the URL via UI.
  2. Running Chrome in incognito mode will not bring up the UI (notifications are blocked)

/usr/bin/google-chrome --incognito

  1. Adding the URL http://120.0.0.1 to the chrome://settings/content/notifications block or allow list will not bring the UI (the UI adds the URL to the one of these lists). I'm didn't see the value in PREFERENCES however, its somewhere I have a request out to find out where.

Not sure if #2 or #3 will work for bot testing . Bill do we have a PREFERENCES file for chrome that is deployed on the bots?

/cc @whesse

eernstg commented 6 years ago

During gardening, I noted that there was no time out in some cases with dart2js; adjusted the lib_2_dart2js.status file to 'Timeout, Pass' in this CL.