GitHub PullRequestReviewCommentEvent at 2014-09-26 08:37:25
Repository: gaia
Actor: crh0716
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/18078825","id":18078825,"diff_hunk":"@@ -0,0 +1,168 @@\n+/*global: MockNavigatorMozTelephony*/\n+'use strict';\n+\n+suite('Sound > ToneManager', function() {\n+  var toneManager;\n+  var realL10n, realTelephony, realMozSettings;\n+  var mockSettingsListener;\n+  var dom = document.createElement('div');\n+  var mockElements = {\n+    toneSelector: dom,\n+    alertToneSelection: dom,\n+    ringToneSelection: dom,\n+    ringer: dom,\n+    vibrationSetting: dom,\n+    manageTones: dom\n+  };\n+  var modules = [\n+    'shared_mocks/mock_navigator_moz_telephony',\n+    'unit/mock_l10n',\n+    'shared_mocks/mock_navigator_moz_settings',\n+    'shared_mocks/mock_settings_listener',\n+    'panels/sound/tone_manager'\n+  ];\n+  var maps = {\n+    '*': {\n+      'shared/settings_listener': 'shared_mocks/mock_settings_listener',\n+      'modules/settings_cache': 'unit/mock_settings_cache',\n+      'shared/omadrm/fl': 'shared_mocks/mock_omadrm_fl'\n+    }\n+  };\n+\n+  function getAsset(filename, loadCallback) {\n+    var req = new XMLHttpRequest();\n+    req.open('GET', filename, true);\n+    req.responseType = 'blob';\n+    req.onload = function() {\n+      loadCallback(req.response);\n+    };\n+    req.send();\n+  }\n+\n+  suiteSetup(function(done) {\n+    testRequire(modules, maps, function(\n+      MockNavigatorMozTelephony, MockL10n,\n+      MockNavigatorSettings, MockSettingsListener, module) {\n+        toneManager = module();\n+        mockSettingsListener = MockSettingsListener;\n+        // mock l10n\n+        realL10n = window.navigator.mozL10n;\n+        window.navigator.mozL10n = MockL10n;\n+        // mock navigator.mozTelephony\n+        realTelephony = navigator.mozTelephony;\n+        window.navigator.mozTelephony = MockNavigatorMozTelephony;\n+        // mock mozSettings\n+        realMozSettings = navigator.mozSettings;\n+        window.navigator.mozSettings = MockNavigatorSettings;\n+        done();\n+    });\n+  });\n+\n+  suiteTeardown(function() {\n+    window.navigator.mozL10n = realL10n;\n+    window.navigator.mozTelephony = realTelephony;\n+    window.navigator.mozSettings = realMozSettings;\n+  });\n+\n+  suite('initiation', function() {\n+    setup(function() {\n+      this.sinon.stub(toneManager, '_configureTones');\n+      this.sinon.stub(toneManager, '_handleTones');\n+      toneManager.init(mockElements);\n+    });\n+\n+    test('we would call _configureTones and _handleTones in init',\n+      function() {\n+        assert.ok(toneManager._configureTones.called);\n+        assert.ok(toneManager._handleTones.called);\n+    });\n+  });\n+\n+  suite('_configureTones', function() {\n+    setup(function() {\n+      this.sinon.stub(toneManager, '_handleTones');\n+    });\n+\n+    test('we would push alerttone by default in tones list', function() {\n+      navigator.mozTelephony = null;","path":"apps/settings/test/unit/panels/sound/tone_manager_test.js","position":87,"original_position":87,"commit_id":"90029ea783c39553cdc00385692dbce4d706f4ef","original_commit_id":"90029ea783c39553cdc00385692dbce4d706f4ef","user":{"login":"crh0716","id":2899280,"avatar_url":"https://avatars.githubusercontent.com/u/2899280?v=2","gravatar_id":"","url":"https://api.github.com/users/crh0716","html_url":"https://github.com/crh0716","followers_url":"https://api.github.com/users/crh0716/followers","following_url":"https://api.github.com/users/crh0716/following{/other_user}","gists_url":"https://api.github.com/users/crh0716/gists{/gist_id}","starred_url":"https://api.github.com/users/crh0716/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crh0716/subscriptions","organizations_url":"https://api.github.com/users/crh0716/orgs","repos_url":"https://api.github.com/users/crh0716/repos","events_url":"https://api.github.com/users/crh0716/events{/privacy}","received_events_url":"https://api.github.com/users/crh0716/received_events","type":"User","site_admin":false},"body":"We should always restore the value of a global object when altering it, or it may affect other tests.","created_at":"2014-09-26T08:37:25Z","updated_at":"2014-09-26T08:37:25Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/23897#discussion_r18078825","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/18078825"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/23897#discussion_r18078825"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897","id":21005357,"html_url":"https://github.com/mozilla-b2g/gaia/pull/23897","diff_url":"https://github.com/mozilla-b2g/gaia/pull/23897.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/23897.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/23897","number":23897,"state":"open","locked":false,"title":"Bug 973445 - [settings] refactor Sound panel with AMD pattern","user":{"login":"gasolin","id":748808,"avatar_url":"https://avatars.githubusercontent.com/u/748808?v=2","gravatar_id":"","url":"https://api.github.com/users/gasolin","html_url":"https://github.com/gasolin","followers_url":"https://api.github.com/users/gasolin/followers","following_url":"https://api.github.com/users/gasolin/following{/other_user}","gists_url":"https://api.github.com/users/gasolin/gists{/gist_id}","starred_url":"https://api.github.com/users/gasolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasolin/subscriptions","organizations_url":"https://api.github.com/users/gasolin/orgs","repos_url":"https://api.github.com/users/gasolin/repos","events_url":"https://api.github.com/users/gasolin/events{/privacy}","received_events_url":"https://api.github.com/users/gasolin/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-10T08:18:27Z","updated_at":"2014-09-26T08:37:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab12ce57cc9c64e62f8911fa88ba067d294b560e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/23897/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/90029ea783c39553cdc00385692dbce4d706f4ef","head":{"label":"gasolin:issue-973445-4","ref":"issue-973445-4","sha":"90029ea783c39553cdc00385692dbce4d706f4ef","user":{"login":"gasolin","id":748808,"avatar_url":"https://avatars.githubusercontent.com/u/748808?v=2","gravatar_id":"","url":"https://api.github.com/users/gasolin","html_url":"https://github.com/gasolin","followers_url":"https://api.github.com/users/gasolin/followers","following_url":"https://api.github.com/users/gasolin/following{/other_user}","gists_url":"https://api.github.com/users/gasolin/gists{/gist_id}","starred_url":"https://api.github.com/users/gasolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasolin/subscriptions","organizations_url":"https://api.github.com/users/gasolin/orgs","repos_url":"https://api.github.com/users/gasolin/repos","events_url":"https://api.github.com/users/gasolin/events{/privacy}","received_events_url":"https://api.github.com/users/gasolin/received_events","type":"User","site_admin":false},"repo":{"id":8349595,"name":"gaia","full_name":"gasolin/gaia","owner":{"login":"gasolin","id":748808,"avatar_url":"https://avatars.githubusercontent.com/u/748808?v=2","gravatar_id":"","url":"https://api.github.com/users/gasolin","html_url":"https://github.com/gasolin","followers_url":"https://api.github.com/users/gasolin/followers","following_url":"https://api.github.com/users/gasolin/following{/other_user}","gists_url":"https://api.github.com/users/gasolin/gists{/gist_id}","starred_url":"https://api.github.com/users/gasolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasolin/subscriptions","organizations_url":"https://api.github.com/users/gasolin/orgs","repos_url":"https://api.github.com/users/gasolin/repos","events_url":"https://api.github.com/users/gasolin/events{/privacy}","received_events_url":"https://api.github.com/users/gasolin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gasolin/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see https://wiki.mozilla.org/Release_Management/B2G_Landing","fork":true,"url":"https://api.github.com/repos/gasolin/gaia","forks_url":"https://api.github.com/repos/gasolin/gaia/forks","keys_url":"https://api.github.com/repos/gasolin/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gasolin/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gasolin/gaia/teams","hooks_url":"https://api.github.com/repos/gasolin/gaia/hooks","issue_events_url":"https://api.github.com/repos/gasolin/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/gasolin/gaia/events","assignees_url":"https://api.github.com/repos/gasolin/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/gasolin/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/gasolin/gaia/tags","blobs_url":"https://api.github.com/repos/gasolin/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gasolin/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gasolin/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/gasolin/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gasolin/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/gasolin/gaia/languages","stargazers_url":"https://api.github.com/repos/gasolin/gaia/stargazers","contributors_url":"https://api.github.com/repos/gasolin/gaia/contributors","subscribers_url":"https://api.github.com/repos/gasolin/gaia/subscribers","subscription_url":"https://api.github.com/repos/gasolin/gaia/subscription","commits_url":"https://api.github.com/repos/gasolin/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/gasolin/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/gasolin/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/gasolin/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/gasolin/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/gasolin/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gasolin/gaia/merges","archive_url":"https://api.github.com/repos/gasolin/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gasolin/gaia/downloads","issues_url":"https://api.github.com/repos/gasolin/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/gasolin/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/gasolin/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/gasolin/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gasolin/gaia/labels{/name}","releases_url":"https://api.github.com/repos/gasolin/gaia/releases{/id}","created_at":"2013-02-22T03:20:25Z","updated_at":"2014-09-11T05:53:12Z","pushed_at":"2014-09-26T08:16:14Z","git_url":"git://github.com/gasolin/gaia.git","ssh_url":"git@github.com:gasolin/gaia.git","clone_url":"https://github.com/gasolin/gaia.git","svn_url":"https://github.com/gasolin/gaia","homepage":"https://wiki.mozilla.org/B2G","size":857393,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"f2f1df425dc2ce7bbb2714ea46017e0ea5abf2dd","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=2","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=2","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2014-09-25T19:23:30Z","pushed_at":"2014-09-26T08:13:51Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1464714,"stargazers_count":1752,"watchers_count":1752,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1929,"mirror_url":null,"open_issues_count":2039,"forks":1929,"open_issues":2039,"watchers":1752,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/23897"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/23897"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/23897/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/23897/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/90029ea783c39553cdc00385692dbce4d706f4ef"}}}}