Tests invalid and valid syntaxes. Test calling functions with too few parameters. TEST(video.webkitGenerateKeyRequest()) THROWS("TypeError: Not enough arguments") FAIL TEST(video.webkitAddKey()) THROWS("TypeError: Not enough arguments") FAIL TEST(video.webkitAddKey('webkit-org.w3.clearkey')) THROWS("TypeError: Not enough arguments") FAIL TEST(video.webkitCancelKeyRequest()) THROWS("TypeError: Not enough arguments") FAIL Verify invalid key system parameter is caught before checking whether loading has started. EXPECTED (video.networkState == '0') OK EXPECTED (video.currentSrc == '') OK TEST(video.webkitGenerateKeyRequest('')) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitGenerateKeyRequest(null)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitGenerateKeyRequest(undefined)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitAddKey('', key)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitAddKey(null, key)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitAddKey(undefined, key)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitCancelKeyRequest('')) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitCancelKeyRequest(null)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitCancelKeyRequest(undefined)) THROWS(DOMException.SYNTAX_ERR) FAIL null key is caught before load state is checked. TEST(video.webkitAddKey('webkit-org.w3.clearkey', '')) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitAddKey('webkit-org.w3.clearkey', null)) THROWS(DOMException.SYNTAX_ERR) FAIL TEST(video.webkitAddKey('webkit-org.w3.clearkey', undefined)) THROWS(DOMException.SYNTAX_ERR) FAIL 0-length key is caught before load state is checked. TEST(video.webkitAddKey('webkit-org.w3.clearkey', new Uint8Array())) THROWS(DOMException.TYPE_MISMATCH_ERR) FAIL Key system validity is not checked before loading. TEST(video.webkitGenerateKeyRequest('com.example.invalid')) THROWS(DOMException.INVALID_STATE_ERR) FAIL TEST(video.webkitAddKey('com.example.invalid', key)) THROWS(DOMException.INVALID_STATE_ERR) FAIL TEST(video.webkitCancelKeyRequest('com.example.invalid')) THROWS(DOMException.INVALID_STATE_ERR) FAIL EVENT(loadstart) Verify valid syntaxes do not throw. EXPECTED (video.networkState == '2') OK EXPECTED (video.currentSrc != '') OK RUN(video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')) TypeError: video.webkitGenerateKeyRequest is not a function. (In 'video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')', 'video.webkitGenerateKeyRequest' is undefined) RUN(video.webkitGenerateKeyRequest('webkit-org.w3.clearkey', initData)) TypeError: video.webkitGenerateKeyRequest is not a function. (In 'video.webkitGenerateKeyRequest('webkit-org.w3.clearkey', initData)', 'video.webkitGenerateKeyRequest' is undefined) RUN(video.webkitAddKey('webkit-org.w3.clearkey', key)) TypeError: video.webkitAddKey is not a function. (In 'video.webkitAddKey('webkit-org.w3.clearkey', key)', 'video.webkitAddKey' is undefined) RUN(video.webkitAddKey('webkit-org.w3.clearkey', key, 'session')) TypeError: video.webkitAddKey is not a function. (In 'video.webkitAddKey('webkit-org.w3.clearkey', key, 'session')', 'video.webkitAddKey' is undefined) RUN(video.webkitAddKey('webkit-org.w3.clearkey', key, initData)) TypeError: video.webkitAddKey is not a function. (In 'video.webkitAddKey('webkit-org.w3.clearkey', key, initData)', 'video.webkitAddKey' is undefined) RUN(video.webkitAddKey('webkit-org.w3.clearkey', key, initData, 'session')) TypeError: video.webkitAddKey is not a function. (In 'video.webkitAddKey('webkit-org.w3.clearkey', key, initData, 'session')', 'video.webkitAddKey' is undefined) RUN(video.webkitCancelKeyRequest('webkit-org.w3.clearkey')) TypeError: video.webkitCancelKeyRequest is not a function. (In 'video.webkitCancelKeyRequest('webkit-org.w3.clearkey')', 'video.webkitCancelKeyRequest' is undefined) RUN(video.webkitCancelKeyRequest('webkit-org.w3.clearkey', 'session')) TypeError: video.webkitCancelKeyRequest is not a function. (In 'video.webkitCancelKeyRequest('webkit-org.w3.clearkey', 'session')', 'video.webkitCancelKeyRequest' is undefined) Unsupported key systems result in NOT_SUPPORTED_ERR. TEST(video.webkitGenerateKeyRequest('com.example.invalid')) THROWS(DOMException.NOT_SUPPORTED_ERR) FAIL TEST(video.webkitAddKey('com.example.invalid', key)) THROWS(DOMException.NOT_SUPPORTED_ERR) FAIL TEST(video.webkitCancelKeyRequest('com.example.invalid')) THROWS(DOMException.NOT_SUPPORTED_ERR) FAIL END OF TEST