{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4040","repository_url":"https://api.github.com/repos/w3c/web-platform-tests","labels_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4040/labels{/name}","comments_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4040/comments","events_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4040/events","html_url":"https://github.com/w3c/web-platform-tests/issues/4040","id":184229288,"number":4040,"title":"PresentationConnection_onxxx tests are incorrect","user":{"login":"tidoust","id":1122927,"avatar_url":"https://avatars.githubusercontent.com/u/1122927?v=3","gravatar_id":"","url":"https://api.github.com/users/tidoust","html_url":"https://github.com/tidoust","followers_url":"https://api.github.com/users/tidoust/followers","following_url":"https://api.github.com/users/tidoust/following{/other_user}","gists_url":"https://api.github.com/users/tidoust/gists{/gist_id}","starred_url":"https://api.github.com/users/tidoust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidoust/subscriptions","organizations_url":"https://api.github.com/users/tidoust/orgs","repos_url":"https://api.github.com/users/tidoust/repos","events_url":"https://api.github.com/users/tidoust/events{/privacy}","received_events_url":"https://api.github.com/users/tidoust/received_events","type":"User","site_admin":false},"labels":[{"id":299977328,"url":"https://api.github.com/repos/w3c/web-platform-tests/labels/presentation-api","name":"presentation-api","color":"ededed","default":false},{"id":299977329,"url":"https://api.github.com/repos/w3c/web-platform-tests/labels/wg-secondscreen","name":"wg-secondscreen","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-20T13:27:12Z","updated_at":"2016-11-17T14:54:35Z","closed_at":null,"body":"The tests on the `close`, `connect` and `terminate` events are incorrect for different reasons:\n1. All 3 tests assume that the events will fire. The test will never fail if they don't (harness timeout is disabled because it is a manual test). There needs to be a call to `step_timeout` somewhere to restart the timeout and ensure the test fails if events are not fired.\n2. The test on `connect` calls `close()` right away, which will likely close the connection before it reaches the `connected` state. The test should not call `close()`.\n3. The test on `terminate` uses `onconnected` instead of `onconnect` (test files would probably benefit from being renamed with right attribute names by the way)\n\nAlso, given that the Presentation API uses Promises, these tests should probably be re-written to use `promise_test` instead of `async_test` to avoid having to write a custom `catch` handler for the Promise returned by `start`.\n"},"comment":{"url":"https://api.github.com/repos/w3c/web-platform-tests/issues/comments/261267479","html_url":"https://github.com/w3c/web-platform-tests/issues/4040#issuecomment-261267479","issue_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/4040","id":261267479,"user":{"login":"obstschale","id":1058710,"avatar_url":"https://avatars.githubusercontent.com/u/1058710?v=3","gravatar_id":"","url":"https://api.github.com/users/obstschale","html_url":"https://github.com/obstschale","followers_url":"https://api.github.com/users/obstschale/followers","following_url":"https://api.github.com/users/obstschale/following{/other_user}","gists_url":"https://api.github.com/users/obstschale/gists{/gist_id}","starred_url":"https://api.github.com/users/obstschale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obstschale/subscriptions","organizations_url":"https://api.github.com/users/obstschale/orgs","repos_url":"https://api.github.com/users/obstschale/repos","events_url":"https://api.github.com/users/obstschale/events{/privacy}","received_events_url":"https://api.github.com/users/obstschale/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T14:54:35Z","updated_at":"2016-11-17T14:54:35Z","body":"@tidoust you mention in 1. that `step_timeout` should be used. But if I rewrite these test to `promise_test` I think ne `step_*` functions are need, aren't they? Cause in [w3c/testharnees.js](https://github.com/w3c/testharness.js/blob/master/docs/api.md#promise-tests) it states:\r\n\r\n> Note that in the promise chain constructed in test_function assertions don't need to wrapped in step or step_func calls."}}
{"actor":{"display_login":"obstschale"}}