Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: chrome/test/functional/media/media_test_matrix.py

Issue 7003131: Adding HTML5 track(caption) test case in PyAuto media functional tests. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: adding title for video and set default track file. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import csv 6 import csv
7 import os 7 import os
8 import random 8 import random
9 9
10 NOT_AVAILABLE_STRING = 'not available' 10 NOT_AVAILABLE_STRING = 'not available'
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 """ 191 """
192 media_infos = [] 192 media_infos = []
193 for i in range(0, len(self._video_titles)-1): 193 for i in range(0, len(self._video_titles)-1):
194 name = self._video_titles[i] 194 name = self._video_titles[i]
195 for sub_type in range(len(self._exts)): 195 for sub_type in range(len(self._exts)):
196 (info, url, link, tag, is_video, nickname) = ( 196 (info, url, link, tag, is_video, nickname) = (
197 self._GenerateMediaInfo(sub_type, name, media_matrix_home_url)) 197 self._GenerateMediaInfo(sub_type, name, media_matrix_home_url))
198 tag = ['audio', 'video'][is_video] 198 tag = ['audio', 'video'][is_video]
199 if ((not NOT_AVAILABLE_STRING in info) and 199 if ((not NOT_AVAILABLE_STRING in info) and
200 ((not video_only) or (video_only and is_video))): 200 ((not video_only) or (video_only and is_video))):
201 media_infos.append([tag, url, nickname]) 201 media_infos.append([tag, url, nickname, name])
202 return media_infos 202 return media_infos
203 203
204 @staticmethod 204 @staticmethod
205 def LookForMediaInfoInCompactFormByNickName(compact_list, target): 205 def LookForMediaInfoInCompactFormByNickName(compact_list, target):
206 """Look for video by its nickname in the compact_list. 206 """Look for video by its nickname in the compact_list.
207 207
208 Args: 208 Args:
209 compact_list: a list generated by GenerateAllMediaInfosInCompactForm. 209 compact_list: a list generated by GenerateAllMediaInfosInCompactForm.
210 target: a target nickname string to look for. 210 target: a target nickname string to look for.
211 211
212 Returns: 212 Returns:
213 A tuple (url, nickname, tag) where nickname is a target string. 213 A tuple (url, nickname, tag) where nickname is a target string.
214 url: URL of the video/audio. 214 url: URL of the video/audio.
215 nickname: nickname of the video/audio for presentation 215 nickname: nickname of the video/audio for presentation
216 (such as bear.webm). 216 (such as bear.webm).
217 tag: HTML5 tag for the video/audio. 217 tag: HTML5 tag for the video/audio.
218 """ 218 """
219 for tag, url, nickname in compact_list: 219 for tag, url, nickname, title in compact_list:
220 if target == nickname: 220 if target == nickname:
221 return (tag, url, nickname) 221 return (tag, url, nickname, title)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698