{"action":"created","comment":{"url":"https://api.github.com/repos/webrtc/adapter/pulls/comments/31208124","id":31208124,"diff_hunk":"@@ -1,11 +1,103 @@\n+'use strict';\n // This is a basic test file for use with testling.\n // The test script language comes from tape.\n+/* jshint node: true */\n var test = require('tape');\n \n-m = require('../adapter.js');\n+var m = require('../adapter.js');\n \n test('Browser identified', function(t) {\n   t.plan(2);\n   t.ok(m.webrtcDetectedBrowser, 'Browser detected');\n   t.ok(m.webrtcDetectedVersion, 'Browser version detected');\n });\n+\n+test('basic connection establishment', function(t) {\n+  var pc1 = new m.RTCPeerConnection(null);\n+  var pc2 = new m.RTCPeerConnection(null);\n+  var ended = false;\n+\n+  pc1.createDataChannel('somechannel');\n+  pc1.oniceconnectionstatechange = function() {\n+    if (pc1.iceConnectionState === 'connected' ||\n+        pc1.iceConnectionState === 'completed') {\n+      t.pass('P2P connection established');\n+      if (!ended) {\n+        ended = true;\n+        t.end();\n+      }\n+    }\n+  };\n+\n+  var addCandidate = function(pc, event) {\n+    if (event.candidate) {\n+      var cand = new RTCIceCandidate(event.candidate);\n+      pc.addIceCandidate(cand,\n+        function() {\n+        },\n+        function(err) {\n+          t.fail('addIceCandidate ' + err.toString());\n+        }\n+      );\n+    }\n+  };\n+  pc1.onicecandidate = function(event) {\n+    addCandidate(pc2, event);\n+  };\n+  pc2.onicecandidate = function(event) {\n+    addCandidate(pc1, event);\n+  };\n+\n+  pc1.createOffer(\n+    function(offer) {\n+      pc1.setLocalDescription(offer,\n+        function() {","path":"test/test.js","position":55,"original_position":55,"commit_id":"06c58fe94717baa581eec14859a4ad0a7f338e0f","original_commit_id":"06c58fe94717baa581eec14859a4ad0a7f338e0f","user":{"login":"phoglund","id":7911315,"avatar_url":"https://avatars.githubusercontent.com/u/7911315?v=3","gravatar_id":"","url":"https://api.github.com/users/phoglund","html_url":"https://github.com/phoglund","followers_url":"https://api.github.com/users/phoglund/followers","following_url":"https://api.github.com/users/phoglund/following{/other_user}","gists_url":"https://api.github.com/users/phoglund/gists{/gist_id}","starred_url":"https://api.github.com/users/phoglund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoglund/subscriptions","organizations_url":"https://api.github.com/users/phoglund/orgs","repos_url":"https://api.github.com/users/phoglund/repos","events_url":"https://api.github.com/users/phoglund/events{/privacy}","received_events_url":"https://api.github.com/users/phoglund/received_events","type":"User","site_admin":false},"body":"Nit: We usually indent 4 on any line breaks, like in the middle of a function invocation like here. Indent 2 should be after {.","created_at":"2015-05-28T07:13:15Z","updated_at":"2015-05-28T07:13:15Z","html_url":"https://github.com/webrtc/adapter/pull/28#discussion_r31208124","pull_request_url":"https://api.github.com/repos/webrtc/adapter/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/comments/31208124"},"html":{"href":"https://github.com/webrtc/adapter/pull/28#discussion_r31208124"},"pull_request":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/webrtc/adapter/pulls/28","id":36228187,"html_url":"https://github.com/webrtc/adapter/pull/28","diff_url":"https://github.com/webrtc/adapter/pull/28.diff","patch_url":"https://github.com/webrtc/adapter/pull/28.patch","issue_url":"https://api.github.com/repos/webrtc/adapter/issues/28","number":28,"state":"closed","locked":false,"title":"add basic p2p test","user":{"login":"fippo","id":289731,"avatar_url":"https://avatars.githubusercontent.com/u/289731?v=3","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"body":"very basic test, if that works all the RTCSessionDescription, RTCIceCandidate shimming for Mozilla works.\r\n\r\nI really wonder why adapter doesn't put RTCPeerConnection on window as well...","created_at":"2015-05-26T17:54:09Z","updated_at":"2015-05-28T07:13:15Z","closed_at":"2015-05-27T20:31:26Z","merged_at":"2015-05-27T20:31:26Z","merge_commit_sha":"de5ca99e56b4bccbbe133f0fe76217190eca51cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/webrtc/adapter/pulls/28/commits","review_comments_url":"https://api.github.com/repos/webrtc/adapter/pulls/28/comments","review_comment_url":"https://api.github.com/repos/webrtc/adapter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webrtc/adapter/issues/28/comments","statuses_url":"https://api.github.com/repos/webrtc/adapter/statuses/06c58fe94717baa581eec14859a4ad0a7f338e0f","head":{"label":"fippo:basic-test","ref":"basic-test","sha":"06c58fe94717baa581eec14859a4ad0a7f338e0f","user":{"login":"fippo","id":289731,"avatar_url":"https://avatars.githubusercontent.com/u/289731?v=3","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"repo":{"id":30330866,"name":"adapter","full_name":"fippo/adapter","owner":{"login":"fippo","id":289731,"avatar_url":"https://avatars.githubusercontent.com/u/289731?v=3","gravatar_id":"","url":"https://api.github.com/users/fippo","html_url":"https://github.com/fippo","followers_url":"https://api.github.com/users/fippo/followers","following_url":"https://api.github.com/users/fippo/following{/other_user}","gists_url":"https://api.github.com/users/fippo/gists{/gist_id}","starred_url":"https://api.github.com/users/fippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fippo/subscriptions","organizations_url":"https://api.github.com/users/fippo/orgs","repos_url":"https://api.github.com/users/fippo/repos","events_url":"https://api.github.com/users/fippo/events{/privacy}","received_events_url":"https://api.github.com/users/fippo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fippo/adapter","description":"Shim to insulate apps from spec changes and prefix differences.","fork":true,"url":"https://api.github.com/repos/fippo/adapter","forks_url":"https://api.github.com/repos/fippo/adapter/forks","keys_url":"https://api.github.com/repos/fippo/adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fippo/adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fippo/adapter/teams","hooks_url":"https://api.github.com/repos/fippo/adapter/hooks","issue_events_url":"https://api.github.com/repos/fippo/adapter/issues/events{/number}","events_url":"https://api.github.com/repos/fippo/adapter/events","assignees_url":"https://api.github.com/repos/fippo/adapter/assignees{/user}","branches_url":"https://api.github.com/repos/fippo/adapter/branches{/branch}","tags_url":"https://api.github.com/repos/fippo/adapter/tags","blobs_url":"https://api.github.com/repos/fippo/adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fippo/adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fippo/adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/fippo/adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fippo/adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/fippo/adapter/languages","stargazers_url":"https://api.github.com/repos/fippo/adapter/stargazers","contributors_url":"https://api.github.com/repos/fippo/adapter/contributors","subscribers_url":"https://api.github.com/repos/fippo/adapter/subscribers","subscription_url":"https://api.github.com/repos/fippo/adapter/subscription","commits_url":"https://api.github.com/repos/fippo/adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/fippo/adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/fippo/adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/fippo/adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/fippo/adapter/contents/{+path}","compare_url":"https://api.github.com/repos/fippo/adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fippo/adapter/merges","archive_url":"https://api.github.com/repos/fippo/adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fippo/adapter/downloads","issues_url":"https://api.github.com/repos/fippo/adapter/issues{/number}","pulls_url":"https://api.github.com/repos/fippo/adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/fippo/adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/fippo/adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fippo/adapter/labels{/name}","releases_url":"https://api.github.com/repos/fippo/adapter/releases{/id}","created_at":"2015-02-05T01:20:35Z","updated_at":"2015-02-05T01:20:39Z","pushed_at":"2015-05-28T05:22:44Z","git_url":"git://github.com/fippo/adapter.git","ssh_url":"git@github.com:fippo/adapter.git","clone_url":"https://github.com/fippo/adapter.git","svn_url":"https://github.com/fippo/adapter","homepage":null,"size":2928,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"webrtc:master","ref":"master","sha":"6ca68cf06cc5a5316d50bbb6ae8e9f731830aa69","user":{"login":"webrtc","id":10526312,"avatar_url":"https://avatars.githubusercontent.com/u/10526312?v=3","gravatar_id":"","url":"https://api.github.com/users/webrtc","html_url":"https://github.com/webrtc","followers_url":"https://api.github.com/users/webrtc/followers","following_url":"https://api.github.com/users/webrtc/following{/other_user}","gists_url":"https://api.github.com/users/webrtc/gists{/gist_id}","starred_url":"https://api.github.com/users/webrtc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webrtc/subscriptions","organizations_url":"https://api.github.com/users/webrtc/orgs","repos_url":"https://api.github.com/users/webrtc/repos","events_url":"https://api.github.com/users/webrtc/events{/privacy}","received_events_url":"https://api.github.com/users/webrtc/received_events","type":"Organization","site_admin":false},"repo":{"id":30027163,"name":"adapter","full_name":"webrtc/adapter","owner":{"login":"webrtc","id":10526312,"avatar_url":"https://avatars.githubusercontent.com/u/10526312?v=3","gravatar_id":"","url":"https://api.github.com/users/webrtc","html_url":"https://github.com/webrtc","followers_url":"https://api.github.com/users/webrtc/followers","following_url":"https://api.github.com/users/webrtc/following{/other_user}","gists_url":"https://api.github.com/users/webrtc/gists{/gist_id}","starred_url":"https://api.github.com/users/webrtc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webrtc/subscriptions","organizations_url":"https://api.github.com/users/webrtc/orgs","repos_url":"https://api.github.com/users/webrtc/repos","events_url":"https://api.github.com/users/webrtc/events{/privacy}","received_events_url":"https://api.github.com/users/webrtc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webrtc/adapter","description":"Shim to insulate apps from spec changes and prefix differences.","fork":false,"url":"https://api.github.com/repos/webrtc/adapter","forks_url":"https://api.github.com/repos/webrtc/adapter/forks","keys_url":"https://api.github.com/repos/webrtc/adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webrtc/adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webrtc/adapter/teams","hooks_url":"https://api.github.com/repos/webrtc/adapter/hooks","issue_events_url":"https://api.github.com/repos/webrtc/adapter/issues/events{/number}","events_url":"https://api.github.com/repos/webrtc/adapter/events","assignees_url":"https://api.github.com/repos/webrtc/adapter/assignees{/user}","branches_url":"https://api.github.com/repos/webrtc/adapter/branches{/branch}","tags_url":"https://api.github.com/repos/webrtc/adapter/tags","blobs_url":"https://api.github.com/repos/webrtc/adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webrtc/adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webrtc/adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/webrtc/adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webrtc/adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/webrtc/adapter/languages","stargazers_url":"https://api.github.com/repos/webrtc/adapter/stargazers","contributors_url":"https://api.github.com/repos/webrtc/adapter/contributors","subscribers_url":"https://api.github.com/repos/webrtc/adapter/subscribers","subscription_url":"https://api.github.com/repos/webrtc/adapter/subscription","commits_url":"https://api.github.com/repos/webrtc/adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/webrtc/adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/webrtc/adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/webrtc/adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/webrtc/adapter/contents/{+path}","compare_url":"https://api.github.com/repos/webrtc/adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webrtc/adapter/merges","archive_url":"https://api.github.com/repos/webrtc/adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webrtc/adapter/downloads","issues_url":"https://api.github.com/repos/webrtc/adapter/issues{/number}","pulls_url":"https://api.github.com/repos/webrtc/adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/webrtc/adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/webrtc/adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webrtc/adapter/labels{/name}","releases_url":"https://api.github.com/repos/webrtc/adapter/releases{/id}","created_at":"2015-01-29T15:41:40Z","updated_at":"2015-05-24T18:31:29Z","pushed_at":"2015-05-28T05:22:44Z","git_url":"git://github.com/webrtc/adapter.git","ssh_url":"git@github.com:webrtc/adapter.git","clone_url":"https://github.com/webrtc/adapter.git","svn_url":"https://github.com/webrtc/adapter","homepage":null,"size":3262,"stargazers_count":51,"watchers_count":51,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":20,"mirror_url":null,"open_issues_count":11,"forks":20,"open_issues":11,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/28"},"html":{"href":"https://github.com/webrtc/adapter/pull/28"},"issue":{"href":"https://api.github.com/repos/webrtc/adapter/issues/28"},"comments":{"href":"https://api.github.com/repos/webrtc/adapter/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webrtc/adapter/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/webrtc/adapter/statuses/06c58fe94717baa581eec14859a4ad0a7f338e0f"}}}}