OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var QueryString = function() { | 5 var QueryString = function() { |
6 // Allows access to query parameters on the URL; e.g., given a URL like: | 6 // Allows access to query parameters on the URL; e.g., given a URL like: |
7 // http://<server>/my.html?test=123&bob=123 | 7 // http://<server>/my.html?test=123&bob=123 |
8 // Parameters can then be accessed via QueryString.test or QueryString.bob. | 8 // Parameters can then be accessed via QueryString.test or QueryString.bob. |
9 var params = {}; | 9 var params = {}; |
10 // RegEx to split out values by &. | 10 // RegEx to split out values by &. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 catch(error) { | 110 catch(error) { |
111 setDocTitle("GenerateKeyRequestException"); | 111 setDocTitle("GenerateKeyRequestException"); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 function onKeyAdded(e) { | 115 function onKeyAdded(e) { |
116 e.target.receivedKeyAdded = true; | 116 e.target.receivedKeyAdded = true; |
117 } | 117 } |
118 | 118 |
119 function onKeyMessage(e) { | 119 function onKeyMessage(e) { |
120 // TODO(ddorwin): Enable after fixing http://crbug.com/166204. | 120 if (!e.keySystem) { |
121 if (!e.keySystem && false) { | |
122 failTest('keymessage without a keySystem: ' + e.keySystem); | 121 failTest('keymessage without a keySystem: ' + e.keySystem); |
123 return; | 122 return; |
124 } | 123 } |
125 | 124 |
126 if (!e.sessionId) { | 125 if (!e.sessionId) { |
127 failTest('keymessage without a sessionId: ' + e.sessionId); | 126 failTest('keymessage without a sessionId: ' + e.sessionId); |
128 return; | 127 return; |
129 } | 128 } |
130 | 129 |
131 if (!e.message) { | 130 if (!e.message) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 mediaSource.addEventListener('webkitsourceopen', onSourceOpen); | 168 mediaSource.addEventListener('webkitsourceopen', onSourceOpen); |
170 video.addEventListener('webkitneedkey', onNeedKey); | 169 video.addEventListener('webkitneedkey', onNeedKey); |
171 video.addEventListener('webkitkeymessage', onKeyMessage); | 170 video.addEventListener('webkitkeymessage', onKeyMessage); |
172 video.addEventListener('webkitkeyerror', failTest); | 171 video.addEventListener('webkitkeyerror', failTest); |
173 video.addEventListener('webkitkeyadded', onKeyAdded); | 172 video.addEventListener('webkitkeyadded', onKeyAdded); |
174 installTitleEventHandler(video, 'error'); | 173 installTitleEventHandler(video, 'error'); |
175 | 174 |
176 video.src = window.URL.createObjectURL(mediaSource); | 175 video.src = window.URL.createObjectURL(mediaSource); |
177 return mediaSource; | 176 return mediaSource; |
178 } | 177 } |
OLD | NEW |