| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <canvas id="canvas"> | 4 <canvas id="canvas"> |
| 5 </canvas> | 5 </canvas> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 function createAudioTrack() { | 8 function createAudioTrack() { |
| 9 ac = new AudioContext(); | 9 ac = new AudioContext(); |
| 10 var osc = ac.createOscillator(); | 10 var osc = ac.createOscillator(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 audio_track.contentHint = "music"; | 39 audio_track.contentHint = "music"; |
| 40 assert_equals(audio_track.contentHint, "music"); | 40 assert_equals(audio_track.contentHint, "music"); |
| 41 audio_track.contentHint = ""; | 41 audio_track.contentHint = ""; |
| 42 assert_equals(audio_track.contentHint, ""); | 42 assert_equals(audio_track.contentHint, ""); |
| 43 }, "Accepts valid audio contentHints"); | 43 }, "Accepts valid audio contentHints"); |
| 44 | 44 |
| 45 test(t => { | 45 test(t => { |
| 46 audio_track = createAudioTrack(); | 46 audio_track = createAudioTrack(); |
| 47 audio_track.contentHint = "speech"; | 47 audio_track.contentHint = "speech"; |
| 48 assert_equals(audio_track.contentHint, "speech"); | 48 assert_equals(audio_track.contentHint, "speech"); |
| 49 audio_track.contentHint = "fluid"; | 49 audio_track.contentHint = "motion"; |
| 50 assert_equals(audio_track.contentHint, "speech", | 50 assert_equals(audio_track.contentHint, "speech", |
| 51 "Audio tracks should ignore video-only contentHints."); | 51 "Audio tracks should ignore video-only contentHints."); |
| 52 audio_track.contentHint = "bogus"; | 52 audio_track.contentHint = "bogus"; |
| 53 assert_equals(audio_track.contentHint, "speech", | 53 assert_equals(audio_track.contentHint, "speech", |
| 54 "Audio tracks should ignore garbage contentHints"); | 54 "Audio tracks should ignore garbage contentHints"); |
| 55 }, "Audio tracks ignore invalid/video contentHints"); | 55 }, "Audio tracks ignore invalid/video contentHints"); |
| 56 | 56 |
| 57 test(t => { | 57 test(t => { |
| 58 video_track = createVideoTrack(); | 58 video_track = createVideoTrack(); |
| 59 video_track.contentHint = "fluid"; | 59 video_track.contentHint = "motion"; |
| 60 assert_equals(video_track.contentHint, "fluid"); | 60 assert_equals(video_track.contentHint, "motion"); |
| 61 video_track.contentHint = "detailed"; | 61 video_track.contentHint = "detail"; |
| 62 assert_equals(video_track.contentHint, "detailed"); | 62 assert_equals(video_track.contentHint, "detail"); |
| 63 video_track.contentHint = ""; | 63 video_track.contentHint = ""; |
| 64 assert_equals(video_track.contentHint, ""); | 64 assert_equals(video_track.contentHint, ""); |
| 65 }, "Accepts valid video contentHints"); | 65 }, "Accepts valid video contentHints"); |
| 66 | 66 |
| 67 test(t => { | 67 test(t => { |
| 68 video_track = createVideoTrack(); | 68 video_track = createVideoTrack(); |
| 69 video_track.contentHint = "fluid"; | 69 video_track.contentHint = "motion"; |
| 70 assert_equals(video_track.contentHint, "fluid"); | 70 assert_equals(video_track.contentHint, "motion"); |
| 71 video_track.contentHint = "speech"; | 71 video_track.contentHint = "speech"; |
| 72 assert_equals(video_track.contentHint, "fluid", | 72 assert_equals(video_track.contentHint, "motion", |
| 73 "Video tracks should ignore audio-only contentHints."); | 73 "Video tracks should ignore audio-only contentHints."); |
| 74 video_track.contentHint = "bogus"; | 74 video_track.contentHint = "bogus"; |
| 75 assert_equals(video_track.contentHint, "fluid", | 75 assert_equals(video_track.contentHint, "motion", |
| 76 "Video tracks should ignore garbage contentHints"); | 76 "Video tracks should ignore garbage contentHints"); |
| 77 }, "Video tracks ignore invalid/audio contentHints"); | 77 }, "Video tracks ignore invalid/audio contentHints"); |
| 78 | 78 |
| 79 test(t => { | 79 test(t => { |
| 80 video_track = createVideoTrack(); | 80 video_track = createVideoTrack(); |
| 81 video_track.contentHint = "fluid"; | 81 video_track.contentHint = "motion"; |
| 82 assert_equals(video_track.contentHint, "fluid"); | 82 assert_equals(video_track.contentHint, "motion"); |
| 83 | 83 |
| 84 // Cloning a track should preserve contentHint. | 84 // Cloning a track should preserve contentHint. |
| 85 video_track_clone = video_track.clone(); | 85 video_track_clone = video_track.clone(); |
| 86 assert_equals(video_track_clone.contentHint, "fluid"); | 86 assert_equals(video_track_clone.contentHint, "motion"); |
| 87 | 87 |
| 88 // Changing a cloned track's contentHint should not change the original. | 88 // Changing a cloned track's contentHint should not change the original. |
| 89 video_track_clone.contentHint = "detailed"; | 89 video_track_clone.contentHint = "detail"; |
| 90 assert_equals(video_track_clone.contentHint, "detailed"); | 90 assert_equals(video_track_clone.contentHint, "detail"); |
| 91 assert_equals(video_track.contentHint, "fluid"); | 91 assert_equals(video_track.contentHint, "motion"); |
| 92 }, "Cloned video tracks have separate contentHints"); | 92 }, "Cloned video tracks have separate contentHints"); |
| 93 | 93 |
| 94 test(t => { | 94 test(t => { |
| 95 audio_track = createAudioTrack(); | 95 audio_track = createAudioTrack(); |
| 96 audio_track.contentHint = "speech"; | 96 audio_track.contentHint = "speech"; |
| 97 assert_equals(audio_track.contentHint, "speech"); | 97 assert_equals(audio_track.contentHint, "speech"); |
| 98 | 98 |
| 99 // Cloning a track should preserve contentHint. | 99 // Cloning a track should preserve contentHint. |
| 100 audio_track_clone = audio_track.clone(); | 100 audio_track_clone = audio_track.clone(); |
| 101 assert_equals(audio_track_clone.contentHint, "speech"); | 101 assert_equals(audio_track_clone.contentHint, "speech"); |
| 102 | 102 |
| 103 // Changing a cloned track's contentHint should not change the original. | 103 // Changing a cloned track's contentHint should not change the original. |
| 104 audio_track_clone.contentHint = "music"; | 104 audio_track_clone.contentHint = "music"; |
| 105 assert_equals(audio_track_clone.contentHint, "music"); | 105 assert_equals(audio_track_clone.contentHint, "music"); |
| 106 assert_equals(audio_track.contentHint, "speech"); | 106 assert_equals(audio_track.contentHint, "speech"); |
| 107 }, "Cloned audio tracks have separate contentHints"); | 107 }, "Cloned audio tracks have separate contentHints"); |
| 108 | 108 |
| 109 </script> | 109 </script> |
| OLD | NEW |