{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments/76101033","id":76101033,"diff_hunk":"@@ -0,0 +1,161 @@\n+function runTest(config)\n+{\n+    var testname = config.keysystem + ', keystatuses';\n+\n+    var configuration = getSimpleConfigurationForContent( config.content );\n+\n+    if ( config.initDataType && config.initData ) configuration.initDataTypes = [ config.initDataType ];\n+\n+    async_test(function(test)\n+    {\n+        var mediaKeySession;\n+        var initDataType;\n+        var initData;\n+        var closed = false;\n+\n+        // Even though key ids are uint8, using printable values so that\n+        // they can be verified easily.\n+        var key1 = new Uint8Array( config.content.keys[ 0 ].kid ),\n+            key2 = new Uint8Array( config.content.keys[ 1 ].kid ),\n+            key1String = arrayBufferAsString(key1),\n+            key2String = arrayBufferAsString(key2);\n+\n+        function onFailure(error) {\n+            forceTestFailureFromPromise(test, error);\n+        }\n+\n+        function processMessage(event)\n+        {\n+            // No keys added yet.\n+            assert_equals(mediaKeySession.keyStatuses.size, 0);\n+\n+            waitForEventAndRunStep('keystatuseschange', mediaKeySession, processKeyStatusesChange, test);\n+\n+            // Add keys to session\n+            config.messagehandler( event.messageType, event.message ).then( function( response ) {\n+                event.target.update( response ).catch(onFailure);\n+            });\n+        }\n+\n+        function checkKeyStatusFor2Keys()\n+        {\n+            // Two keys added, so both should show up in |keyStatuses|.\n+            assert_equals(mediaKeySession.keyStatuses.size, 2);\n+\n+            // Check |keyStatuses| for 2 entries.\n+            var result = [];\n+            for (let item of mediaKeySession.keyStatuses) {\n+                result.push({ key: arrayBufferAsString(item[0]), value: item[1] });\n+            }\n+            function lexicographical( a, b ) { return a < b ? -1 : a === b ? 0 : +1; }\n+            function lexicographicalkey( a, b ) { return lexicographical( a.key, b.key ); }\n+            var expected = [{ key: key1String, value: 'usable'}, { key: key2String, value: 'usable'}].sort( lexicographicalkey );\n+            assert_object_equals(result,\n+                                 expected,\n+                                 'keyStatuses fails');\n+\n+            // |keyStatuses| must contain both keys.\n+            result = [];\n+            for (var key of mediaKeySession.keyStatuses.keys()) {\n+                result.push(arrayBufferAsString(key));\n+            }\n+            assert_array_equals(result,\n+                                [key1String, key2String].sort( lexicographical ),\n+                                'keyStatuses.keys() fails');\n+\n+            // Both values in |mediaKeySession| should be 'usable'.\n+            result = [];\n+            for (var value of mediaKeySession.keyStatuses.values()) {\n+                result.push(value);\n+            }\n+            assert_array_equals(result,\n+                                ['usable', 'usable'],\n+                                'keyStatuses.values() fails');\n+\n+            // Check |keyStatuses.entries()|.\n+            result = [];\n+            for (var entry of mediaKeySession.keyStatuses.entries()) {\n+                result.push({ key: arrayBufferAsString(entry[0]), value: entry[1] });\n+            }\n+            assert_object_equals(result,\n+                                 expected,\n+                                 'keyStatuses.entries() fails');","path":"encrypted-media/scripts/keystatuses.js","position":82,"original_position":82,"commit_id":"712ea2073e046218b54b0c016cf14de4a820ef5f","original_commit_id":"712ea2073e046218b54b0c016cf14de4a820ef5f","user":{"login":"jdsmith3000","id":8323871,"avatar_url":"https://avatars.githubusercontent.com/u/8323871?v=3","gravatar_id":"","url":"https://api.github.com/users/jdsmith3000","html_url":"https://github.com/jdsmith3000","followers_url":"https://api.github.com/users/jdsmith3000/followers","following_url":"https://api.github.com/users/jdsmith3000/following{/other_user}","gists_url":"https://api.github.com/users/jdsmith3000/gists{/gist_id}","starred_url":"https://api.github.com/users/jdsmith3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdsmith3000/subscriptions","organizations_url":"https://api.github.com/users/jdsmith3000/orgs","repos_url":"https://api.github.com/users/jdsmith3000/repos","events_url":"https://api.github.com/users/jdsmith3000/events{/privacy}","received_events_url":"https://api.github.com/users/jdsmith3000/received_events","type":"User","site_admin":false},"body":"Can the assert text here be made more explicit?","created_at":"2016-08-24T17:25:27Z","updated_at":"2016-08-24T17:25:27Z","html_url":"https://github.com/w3c/web-platform-tests/pull/3490#discussion_r76101033","pull_request_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490","_links":{"self":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments/76101033"},"html":{"href":"https://github.com/w3c/web-platform-tests/pull/3490#discussion_r76101033"},"pull_request":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490"}}},"pull_request":{"url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490","id":81847460,"html_url":"https://github.com/w3c/web-platform-tests/pull/3490","diff_url":"https://github.com/w3c/web-platform-tests/pull/3490.diff","patch_url":"https://github.com/w3c/web-platform-tests/pull/3490.patch","issue_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/3490","number":3490,"state":"open","locked":false,"title":"[eme] Keystatuses test","user":{"login":"mwatson2","id":7593867,"avatar_url":"https://avatars.githubusercontent.com/u/7593867?v=3","gravatar_id":"","url":"https://api.github.com/users/mwatson2","html_url":"https://github.com/mwatson2","followers_url":"https://api.github.com/users/mwatson2/followers","following_url":"https://api.github.com/users/mwatson2/following{/other_user}","gists_url":"https://api.github.com/users/mwatson2/gists{/gist_id}","starred_url":"https://api.github.com/users/mwatson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwatson2/subscriptions","organizations_url":"https://api.github.com/users/mwatson2/orgs","repos_url":"https://api.github.com/users/mwatson2/repos","events_url":"https://api.github.com/users/mwatson2/events{/privacy}","received_events_url":"https://api.github.com/users/mwatson2/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-18T16:32:01Z","updated_at":"2016-08-24T17:25:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4396c3634b214716317858d252153678c91775e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490/commits","review_comments_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490/comments","review_comment_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/3490/comments","statuses_url":"https://api.github.com/repos/w3c/web-platform-tests/statuses/712ea2073e046218b54b0c016cf14de4a820ef5f","head":{"label":"mwatson2:emetests-16","ref":"emetests-16","sha":"712ea2073e046218b54b0c016cf14de4a820ef5f","user":{"login":"mwatson2","id":7593867,"avatar_url":"https://avatars.githubusercontent.com/u/7593867?v=3","gravatar_id":"","url":"https://api.github.com/users/mwatson2","html_url":"https://github.com/mwatson2","followers_url":"https://api.github.com/users/mwatson2/followers","following_url":"https://api.github.com/users/mwatson2/following{/other_user}","gists_url":"https://api.github.com/users/mwatson2/gists{/gist_id}","starred_url":"https://api.github.com/users/mwatson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwatson2/subscriptions","organizations_url":"https://api.github.com/users/mwatson2/orgs","repos_url":"https://api.github.com/users/mwatson2/repos","events_url":"https://api.github.com/users/mwatson2/events{/privacy}","received_events_url":"https://api.github.com/users/mwatson2/received_events","type":"User","site_admin":false},"repo":{"id":60865965,"name":"web-platform-tests","full_name":"mwatson2/web-platform-tests","owner":{"login":"mwatson2","id":7593867,"avatar_url":"https://avatars.githubusercontent.com/u/7593867?v=3","gravatar_id":"","url":"https://api.github.com/users/mwatson2","html_url":"https://github.com/mwatson2","followers_url":"https://api.github.com/users/mwatson2/followers","following_url":"https://api.github.com/users/mwatson2/following{/other_user}","gists_url":"https://api.github.com/users/mwatson2/gists{/gist_id}","starred_url":"https://api.github.com/users/mwatson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwatson2/subscriptions","organizations_url":"https://api.github.com/users/mwatson2/orgs","repos_url":"https://api.github.com/users/mwatson2/repos","events_url":"https://api.github.com/users/mwatson2/events{/privacy}","received_events_url":"https://api.github.com/users/mwatson2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwatson2/web-platform-tests","description":"Test Suites for Web Platform specifications—including WHATWG, W3C and others","fork":true,"url":"https://api.github.com/repos/mwatson2/web-platform-tests","forks_url":"https://api.github.com/repos/mwatson2/web-platform-tests/forks","keys_url":"https://api.github.com/repos/mwatson2/web-platform-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwatson2/web-platform-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwatson2/web-platform-tests/teams","hooks_url":"https://api.github.com/repos/mwatson2/web-platform-tests/hooks","issue_events_url":"https://api.github.com/repos/mwatson2/web-platform-tests/issues/events{/number}","events_url":"https://api.github.com/repos/mwatson2/web-platform-tests/events","assignees_url":"https://api.github.com/repos/mwatson2/web-platform-tests/assignees{/user}","branches_url":"https://api.github.com/repos/mwatson2/web-platform-tests/branches{/branch}","tags_url":"https://api.github.com/repos/mwatson2/web-platform-tests/tags","blobs_url":"https://api.github.com/repos/mwatson2/web-platform-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwatson2/web-platform-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwatson2/web-platform-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwatson2/web-platform-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwatson2/web-platform-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/mwatson2/web-platform-tests/languages","stargazers_url":"https://api.github.com/repos/mwatson2/web-platform-tests/stargazers","contributors_url":"https://api.github.com/repos/mwatson2/web-platform-tests/contributors","subscribers_url":"https://api.github.com/repos/mwatson2/web-platform-tests/subscribers","subscription_url":"https://api.github.com/repos/mwatson2/web-platform-tests/subscription","commits_url":"https://api.github.com/repos/mwatson2/web-platform-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwatson2/web-platform-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwatson2/web-platform-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwatson2/web-platform-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwatson2/web-platform-tests/contents/{+path}","compare_url":"https://api.github.com/repos/mwatson2/web-platform-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwatson2/web-platform-tests/merges","archive_url":"https://api.github.com/repos/mwatson2/web-platform-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwatson2/web-platform-tests/downloads","issues_url":"https://api.github.com/repos/mwatson2/web-platform-tests/issues{/number}","pulls_url":"https://api.github.com/repos/mwatson2/web-platform-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/mwatson2/web-platform-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/mwatson2/web-platform-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwatson2/web-platform-tests/labels{/name}","releases_url":"https://api.github.com/repos/mwatson2/web-platform-tests/releases{/id}","deployments_url":"https://api.github.com/repos/mwatson2/web-platform-tests/deployments","created_at":"2016-06-10T17:39:19Z","updated_at":"2016-06-10T17:39:46Z","pushed_at":"2016-08-22T22:07:56Z","git_url":"git://github.com/mwatson2/web-platform-tests.git","ssh_url":"git@github.com:mwatson2/web-platform-tests.git","clone_url":"https://github.com/mwatson2/web-platform-tests.git","svn_url":"https://github.com/mwatson2/web-platform-tests","homepage":"http://irc.w3.org/?channels=testing","size":163617,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"w3c:master","ref":"master","sha":"41ac1ae4d3be3549c45da368bfc755c3cfc523a4","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":3618133,"name":"web-platform-tests","full_name":"w3c/web-platform-tests","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/web-platform-tests","description":"Test Suites for Web Platform specifications—including WHATWG, W3C and others","fork":false,"url":"https://api.github.com/repos/w3c/web-platform-tests","forks_url":"https://api.github.com/repos/w3c/web-platform-tests/forks","keys_url":"https://api.github.com/repos/w3c/web-platform-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/web-platform-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/web-platform-tests/teams","hooks_url":"https://api.github.com/repos/w3c/web-platform-tests/hooks","issue_events_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/web-platform-tests/events","assignees_url":"https://api.github.com/repos/w3c/web-platform-tests/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/web-platform-tests/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/web-platform-tests/tags","blobs_url":"https://api.github.com/repos/w3c/web-platform-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/web-platform-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/web-platform-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/web-platform-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/web-platform-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/web-platform-tests/languages","stargazers_url":"https://api.github.com/repos/w3c/web-platform-tests/stargazers","contributors_url":"https://api.github.com/repos/w3c/web-platform-tests/contributors","subscribers_url":"https://api.github.com/repos/w3c/web-platform-tests/subscribers","subscription_url":"https://api.github.com/repos/w3c/web-platform-tests/subscription","commits_url":"https://api.github.com/repos/w3c/web-platform-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/web-platform-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/web-platform-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/web-platform-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/web-platform-tests/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/web-platform-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/web-platform-tests/merges","archive_url":"https://api.github.com/repos/w3c/web-platform-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/web-platform-tests/downloads","issues_url":"https://api.github.com/repos/w3c/web-platform-tests/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/web-platform-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/web-platform-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/web-platform-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/web-platform-tests/labels{/name}","releases_url":"https://api.github.com/repos/w3c/web-platform-tests/releases{/id}","deployments_url":"https://api.github.com/repos/w3c/web-platform-tests/deployments","created_at":"2012-03-04T12:58:11Z","updated_at":"2016-08-24T16:15:20Z","pushed_at":"2016-08-24T16:26:23Z","git_url":"git://github.com/w3c/web-platform-tests.git","ssh_url":"git@github.com:w3c/web-platform-tests.git","clone_url":"https://github.com/w3c/web-platform-tests.git","svn_url":"https://github.com/w3c/web-platform-tests","homepage":"http://irc.w3.org/?channels=testing","size":330880,"stargazers_count":814,"watchers_count":814,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":907,"mirror_url":null,"open_issues_count":393,"forks":907,"open_issues":393,"watchers":814,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490"},"html":{"href":"https://github.com/w3c/web-platform-tests/pull/3490"},"issue":{"href":"https://api.github.com/repos/w3c/web-platform-tests/issues/3490"},"comments":{"href":"https://api.github.com/repos/w3c/web-platform-tests/issues/3490/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/w3c/web-platform-tests/pulls/3490/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/web-platform-tests/statuses/712ea2073e046218b54b0c016cf14de4a820ef5f"}}}}
{"actor":{"display_login":"jdsmith3000"}}