{"action":"created","comment":{"url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/comments/37889322","id":37889322,"diff_hunk":"@@ -235,12 +241,9 @@ def ad_ended(self):\n         return self.ad_state == self._yt_player_state['ENDED']\n \n     def process_ad(self):\n-        if self.attempt_ad_skip():\n-            return\n-        ad_duration = self.search_ad_duration()\n-        if not ad_duration:\n+        if self.attempt_ad_skip() or self.ad_inactive:\n             return\n-        ad_timeout = ad_duration + 5\n+        ad_timeout = (self.search_ad_duration() or 30) + 5","path":"media_utils/youtube_puppeteer.py","position":80,"original_position":80,"commit_id":"ad355bc4700fff4dc0515b39f5a42d87e0f6080a","original_commit_id":"ad355bc4700fff4dc0515b39f5a42d87e0f6080a","user":{"login":"sydvicious","id":984554,"avatar_url":"https://avatars.githubusercontent.com/u/984554?v=3","gravatar_id":"","url":"https://api.github.com/users/sydvicious","html_url":"https://github.com/sydvicious","followers_url":"https://api.github.com/users/sydvicious/followers","following_url":"https://api.github.com/users/sydvicious/following{/other_user}","gists_url":"https://api.github.com/users/sydvicious/gists{/gist_id}","starred_url":"https://api.github.com/users/sydvicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sydvicious/subscriptions","organizations_url":"https://api.github.com/users/sydvicious/orgs","repos_url":"https://api.github.com/users/sydvicious/repos","events_url":"https://api.github.com/users/sydvicious/events{/privacy}","received_events_url":"https://api.github.com/users/sydvicious/received_events","type":"User","site_admin":false},"body":"Should you use the timeout set for the video here?","created_at":"2015-08-25T16:51:05Z","updated_at":"2015-08-25T16:51:05Z","html_url":"https://github.com/mjzffr/firefox-media-tests/pull/19#discussion_r37889322","pull_request_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/comments/37889322"},"html":{"href":"https://github.com/mjzffr/firefox-media-tests/pull/19#discussion_r37889322"},"pull_request":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19","id":43215299,"html_url":"https://github.com/mjzffr/firefox-media-tests/pull/19","diff_url":"https://github.com/mjzffr/firefox-media-tests/pull/19.diff","patch_url":"https://github.com/mjzffr/firefox-media-tests/pull/19.patch","issue_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/19","number":19,"state":"open","locked":false,"title":"Bug 1197948 - Determine expected video duration","user":{"login":"mjzffr","id":6024326,"avatar_url":"https://avatars.githubusercontent.com/u/6024326?v=3","gravatar_id":"","url":"https://api.github.com/users/mjzffr","html_url":"https://github.com/mjzffr","followers_url":"https://api.github.com/users/mjzffr/followers","following_url":"https://api.github.com/users/mjzffr/following{/other_user}","gists_url":"https://api.github.com/users/mjzffr/gists{/gist_id}","starred_url":"https://api.github.com/users/mjzffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjzffr/subscriptions","organizations_url":"https://api.github.com/users/mjzffr/orgs","repos_url":"https://api.github.com/users/mjzffr/repos","events_url":"https://api.github.com/users/mjzffr/events{/privacy}","received_events_url":"https://api.github.com/users/mjzffr/received_events","type":"User","site_admin":false},"body":"* To get an accurate expected duration:\r\n  - Wait for video to start in VideoPuppeteer constructor\r\n    - This in turn affects how playback_started tests are written\r\n  - Wait for/skip initial ads in YouTubePuppeteer constructor\r\n  - Update conditions for ad-detection in reponse to changes in YouTube\r\n    JS API\r\n* Refactoring\r\n  - Move loop out of MediaTestCase.run_playback\r\n  - Differentiate between duration and expected_duration in\r\n    VideoPuppeteer\r\n\r\nThe details:\r\n* Check for that playback starts in puppeteer constructor because most accurate `expected_duration` is obtained once video is fully loaded and started\r\n  - Therefore, update `playback_started` tests to just call the puppeteer constructor\r\n* Moved `set_duration`/`_calculated_duration` logic to `expected_duration`, so that `self.duration` is always whatever video element tells us\r\n* Moved loop out of `run_playback` so we don't always have to run all videos\r\n* removed params from `run_playback` since they're all in `video` anyway; just\r\npass in `video`\r\n* set default value of `stall_wait_time` and `set_duration` to 0 to avoid \r\nrun_time errors when we're not using them (e.g. in youtube tests)\r\n* changed conditions for some ad-skipping things\r\n  * it is no longer true that `current_time` stands still while an ad is playing\r\n  * some things in youtube API seem to have changed and are more reliable (like `ad_playing`)\r\n* move initial ad_skipping into YouTubePuppeteer init, to get best chance at getting an accurate expected_duration throughout a test","created_at":"2015-08-24T20:02:57Z","updated_at":"2015-08-25T16:51:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed4a60f247aa58cb679fcc1f4edeb35420650370","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19/commits","review_comments_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19/comments","review_comment_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/19/comments","statuses_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/statuses/ad355bc4700fff4dc0515b39f5a42d87e0f6080a","head":{"label":"mjzffr:fix_video_init","ref":"fix_video_init","sha":"ad355bc4700fff4dc0515b39f5a42d87e0f6080a","user":{"login":"mjzffr","id":6024326,"avatar_url":"https://avatars.githubusercontent.com/u/6024326?v=3","gravatar_id":"","url":"https://api.github.com/users/mjzffr","html_url":"https://github.com/mjzffr","followers_url":"https://api.github.com/users/mjzffr/followers","following_url":"https://api.github.com/users/mjzffr/following{/other_user}","gists_url":"https://api.github.com/users/mjzffr/gists{/gist_id}","starred_url":"https://api.github.com/users/mjzffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjzffr/subscriptions","organizations_url":"https://api.github.com/users/mjzffr/orgs","repos_url":"https://api.github.com/users/mjzffr/repos","events_url":"https://api.github.com/users/mjzffr/events{/privacy}","received_events_url":"https://api.github.com/users/mjzffr/received_events","type":"User","site_admin":false},"repo":{"id":30950784,"name":"firefox-media-tests","full_name":"mjzffr/firefox-media-tests","owner":{"login":"mjzffr","id":6024326,"avatar_url":"https://avatars.githubusercontent.com/u/6024326?v=3","gravatar_id":"","url":"https://api.github.com/users/mjzffr","html_url":"https://github.com/mjzffr","followers_url":"https://api.github.com/users/mjzffr/followers","following_url":"https://api.github.com/users/mjzffr/following{/other_user}","gists_url":"https://api.github.com/users/mjzffr/gists{/gist_id}","starred_url":"https://api.github.com/users/mjzffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjzffr/subscriptions","organizations_url":"https://api.github.com/users/mjzffr/orgs","repos_url":"https://api.github.com/users/mjzffr/repos","events_url":"https://api.github.com/users/mjzffr/events{/privacy}","received_events_url":"https://api.github.com/users/mjzffr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjzffr/firefox-media-tests","description":"Marionette Python tests for media playback in Mozilla Firefox. ","fork":false,"url":"https://api.github.com/repos/mjzffr/firefox-media-tests","forks_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/forks","keys_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/teams","hooks_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/hooks","issue_events_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/events{/number}","events_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/events","assignees_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/assignees{/user}","branches_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/branches{/branch}","tags_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/tags","blobs_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/languages","stargazers_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/stargazers","contributors_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/contributors","subscribers_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/subscribers","subscription_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/subscription","commits_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/contents/{+path}","compare_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/merges","archive_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/downloads","issues_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues{/number}","pulls_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/labels{/name}","releases_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/releases{/id}","created_at":"2015-02-18T03:40:26Z","updated_at":"2015-08-10T20:07:54Z","pushed_at":"2015-08-24T20:50:59Z","git_url":"git://github.com/mjzffr/firefox-media-tests.git","ssh_url":"git@github.com:mjzffr/firefox-media-tests.git","clone_url":"https://github.com/mjzffr/firefox-media-tests.git","svn_url":"https://github.com/mjzffr/firefox-media-tests","homepage":"https://wiki.mozilla.org/Auto-tools/Projects/Platform_Quality/Firefox_Media_Tests","size":785,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mjzffr:master","ref":"master","sha":"b39f9e9ea6eb8ffda6523bfdc5b7caa687680a39","user":{"login":"mjzffr","id":6024326,"avatar_url":"https://avatars.githubusercontent.com/u/6024326?v=3","gravatar_id":"","url":"https://api.github.com/users/mjzffr","html_url":"https://github.com/mjzffr","followers_url":"https://api.github.com/users/mjzffr/followers","following_url":"https://api.github.com/users/mjzffr/following{/other_user}","gists_url":"https://api.github.com/users/mjzffr/gists{/gist_id}","starred_url":"https://api.github.com/users/mjzffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjzffr/subscriptions","organizations_url":"https://api.github.com/users/mjzffr/orgs","repos_url":"https://api.github.com/users/mjzffr/repos","events_url":"https://api.github.com/users/mjzffr/events{/privacy}","received_events_url":"https://api.github.com/users/mjzffr/received_events","type":"User","site_admin":false},"repo":{"id":30950784,"name":"firefox-media-tests","full_name":"mjzffr/firefox-media-tests","owner":{"login":"mjzffr","id":6024326,"avatar_url":"https://avatars.githubusercontent.com/u/6024326?v=3","gravatar_id":"","url":"https://api.github.com/users/mjzffr","html_url":"https://github.com/mjzffr","followers_url":"https://api.github.com/users/mjzffr/followers","following_url":"https://api.github.com/users/mjzffr/following{/other_user}","gists_url":"https://api.github.com/users/mjzffr/gists{/gist_id}","starred_url":"https://api.github.com/users/mjzffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjzffr/subscriptions","organizations_url":"https://api.github.com/users/mjzffr/orgs","repos_url":"https://api.github.com/users/mjzffr/repos","events_url":"https://api.github.com/users/mjzffr/events{/privacy}","received_events_url":"https://api.github.com/users/mjzffr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjzffr/firefox-media-tests","description":"Marionette Python tests for media playback in Mozilla Firefox. ","fork":false,"url":"https://api.github.com/repos/mjzffr/firefox-media-tests","forks_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/forks","keys_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/teams","hooks_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/hooks","issue_events_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/events{/number}","events_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/events","assignees_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/assignees{/user}","branches_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/branches{/branch}","tags_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/tags","blobs_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/languages","stargazers_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/stargazers","contributors_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/contributors","subscribers_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/subscribers","subscription_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/subscription","commits_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/contents/{+path}","compare_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/merges","archive_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/downloads","issues_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues{/number}","pulls_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/labels{/name}","releases_url":"https://api.github.com/repos/mjzffr/firefox-media-tests/releases{/id}","created_at":"2015-02-18T03:40:26Z","updated_at":"2015-08-10T20:07:54Z","pushed_at":"2015-08-24T20:50:59Z","git_url":"git://github.com/mjzffr/firefox-media-tests.git","ssh_url":"git@github.com:mjzffr/firefox-media-tests.git","clone_url":"https://github.com/mjzffr/firefox-media-tests.git","svn_url":"https://github.com/mjzffr/firefox-media-tests","homepage":"https://wiki.mozilla.org/Auto-tools/Projects/Platform_Quality/Firefox_Media_Tests","size":785,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19"},"html":{"href":"https://github.com/mjzffr/firefox-media-tests/pull/19"},"issue":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/19"},"comments":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/mjzffr/firefox-media-tests/statuses/ad355bc4700fff4dc0515b39f5a42d87e0f6080a"}}}}