{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments/27074075","id":27074075,"diff_hunk":"@@ -5,28 +5,41 @@\n from marionette import MarionetteTestCase\n \n from firefox_puppeteer import Puppeteer\n+from firefox_puppeteer.ui.windows import BrowserWindow\n \n \n class FirefoxTestCase(MarionetteTestCase, Puppeteer):\n-    \"\"\"\n-    Test case that inherits from a Puppeteer object so Firefox specific\n-    libraries are exposed to test scope.\n+    \"\"\"Base testcase class for Firefox Desktop tests.\n+\n+    It enhances the Marionette testcase by inserting the Puppeteer mixin class,\n+    so Firefox specific API modules are exposed to test scope.\n     \"\"\"\n     def __init__(self, *args, **kwargs):\n         MarionetteTestCase.__init__(self, *args, **kwargs)\n \n+    def restart(self, flags=None):\n+        \"\"\"Restart Firefox and re-initialize data.\n+\n+        :param flags: Specific restart flags for Firefox\n+        \"\"\"\n+        self.marionette.restart(in_app=True)\n+\n+        # Marionette doesn't keep the former context, so restore to chrome\n+        self.marionette.set_context('chrome')\n+\n+        # Ensure that we always have a valid browser instance available\n+        self.browser = self.windows.switch_to(lambda win: type(win) is BrowserWindow)\n+\n     def setUp(self, *args, **kwargs):\n         MarionetteTestCase.setUp(self, *args, **kwargs)\n         Puppeteer.set_marionette(self, self.marionette)\n \n-        self._start_handle_count = len(self.marionette.window_handles)\n         self.marionette.set_context('chrome')\n \n-        self.browser = self.windows.current\n-        self.browser.focus()\n-        with self.marionette.using_context(self.marionette.CONTEXT_CONTENT):\n-            # Ensure that we have a default page opened\n-            self.marionette.navigate(self.prefs.get_pref('browser.newtab.url'))\n+        # Ensure that we always have a valid browser instance available\n+        self.browser = self.windows.switch_to(lambda win: type(win) is BrowserWindow)","path":"firefox_ui_harness/testcase.py","position":45,"original_position":45,"commit_id":"73e66b8755155dcc604bc710b26d50235bace9aa","original_commit_id":"73e66b8755155dcc604bc710b26d50235bace9aa","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"body":"Sorry, that was a rebase I had to do and it clearly went wrong. It clashed with one of my latest landed PRs. I will fix that so we have the behavior from master.","created_at":"2015-03-24T21:16:14Z","updated_at":"2015-03-24T21:16:14Z","html_url":"https://github.com/mozilla/firefox-ui-tests/pull/122#discussion_r27074075","pull_request_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122","_links":{"self":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments/27074075"},"html":{"href":"https://github.com/mozilla/firefox-ui-tests/pull/122#discussion_r27074075"},"pull_request":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122","id":30765639,"html_url":"https://github.com/mozilla/firefox-ui-tests/pull/122","diff_url":"https://github.com/mozilla/firefox-ui-tests/pull/122.diff","patch_url":"https://github.com/mozilla/firefox-ui-tests/pull/122.patch","issue_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/122","number":122,"state":"open","locked":false,"title":"Bug 1129843 - Convert update tests to Marionette","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"body":"Currently a WIP which will get frequent updates over the next days. Nothing to review yet.","created_at":"2015-03-09T14:38:50Z","updated_at":"2015-03-24T21:16:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d631754cf2ef0897b86d400e9f67d0fed4d5d3a","assignee":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122/commits","review_comments_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122/comments","review_comment_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/122/comments","statuses_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/statuses/73e66b8755155dcc604bc710b26d50235bace9aa","head":{"label":"whimboo:update_tests","ref":"update_tests","sha":"73e66b8755155dcc604bc710b26d50235bace9aa","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"repo":{"id":27267720,"name":"firefox-ui-tests","full_name":"whimboo/firefox-ui-tests","owner":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whimboo/firefox-ui-tests","description":"","fork":true,"url":"https://api.github.com/repos/whimboo/firefox-ui-tests","forks_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/forks","keys_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/teams","hooks_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/hooks","issue_events_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/issues/events{/number}","events_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/events","assignees_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/assignees{/user}","branches_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/branches{/branch}","tags_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/tags","blobs_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/languages","stargazers_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/stargazers","contributors_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/contributors","subscribers_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/subscribers","subscription_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/subscription","commits_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/contents/{+path}","compare_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/merges","archive_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/downloads","issues_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/issues{/number}","pulls_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/labels{/name}","releases_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/releases{/id}","created_at":"2014-11-28T13:17:46Z","updated_at":"2015-03-06T16:13:41Z","pushed_at":"2015-03-24T17:01:21Z","git_url":"git://github.com/whimboo/firefox-ui-tests.git","ssh_url":"git@github.com:whimboo/firefox-ui-tests.git","clone_url":"https://github.com/whimboo/firefox-ui-tests.git","svn_url":"https://github.com/whimboo/firefox-ui-tests","homepage":null,"size":1019,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"f8050f8de317f94fec953bf96618ae242f6324f5","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":25004372,"name":"firefox-ui-tests","full_name":"mozilla/firefox-ui-tests","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/firefox-ui-tests","description":"","fork":false,"url":"https://api.github.com/repos/mozilla/firefox-ui-tests","forks_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/forks","keys_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/teams","hooks_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/hooks","issue_events_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/events","assignees_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/tags","blobs_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/languages","stargazers_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/stargazers","contributors_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/contributors","subscribers_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/subscribers","subscription_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/subscription","commits_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/merges","archive_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/downloads","issues_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/releases{/id}","created_at":"2014-10-09T19:09:05Z","updated_at":"2015-03-24T06:38:07Z","pushed_at":"2015-03-24T17:01:22Z","git_url":"git://github.com/mozilla/firefox-ui-tests.git","ssh_url":"git@github.com:mozilla/firefox-ui-tests.git","clone_url":"https://github.com/mozilla/firefox-ui-tests.git","svn_url":"https://github.com/mozilla/firefox-ui-tests","homepage":null,"size":2427,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":12,"forks":23,"open_issues":12,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122"},"html":{"href":"https://github.com/mozilla/firefox-ui-tests/pull/122"},"issue":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/122"},"comments":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/statuses/73e66b8755155dcc604bc710b26d50235bace9aa"}}}}