| 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 <script src="../resources/mojo-helpers.js"></script> | 4 <script src="../resources/mojo-helpers.js"></script> |
| 5 <script src="resources/mock-imagecapture.js"></script> | 5 <script src="resources/mock-imagecapture.js"></script> |
| 6 <body> | 6 <body> |
| 7 <canvas id='canvas' width=10 height=10/> | 7 <canvas id='canvas' width=10 height=10/> |
| 8 </body> | 8 </body> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 var stream = canvas.captureStream(); | 30 var stream = canvas.captureStream(); |
| 31 var videoTrack = stream.getVideoTracks()[0]; | 31 var videoTrack = stream.getVideoTracks()[0]; |
| 32 | 32 |
| 33 // |videoTrack|s settings retrieval, just like the actual capture, is a | 33 // |videoTrack|s settings retrieval, just like the actual capture, is a |
| 34 // process kicked right after creation, we introduce a small delay to | 34 // process kicked right after creation, we introduce a small delay to |
| 35 // allow for those to be collected. | 35 // allow for those to be collected. |
| 36 setTimeout(() => { | 36 setTimeout(() => { |
| 37 settings = videoTrack.getSettings(); | 37 settings = videoTrack.getSettings(); |
| 38 assert_equals(typeof settings, 'object'); | 38 assert_equals(typeof settings, 'object'); |
| 39 | 39 |
| 40 assert_equals(settings.whiteBalanceMode, | 40 assert_equals( |
| 41 meteringModeNames[mock_settings.white_balance_mode], | 41 settings.whiteBalanceMode, |
| 42 meteringModeNames[mock_settings.current_white_balance_mode], |
| 42 'whiteBalanceMode'); | 43 'whiteBalanceMode'); |
| 43 assert_equals(settings.exposureMode, | 44 assert_equals(settings.exposureMode, |
| 44 meteringModeNames[mock_settings.exposure_mode], 'exposureMode;'); | 45 meteringModeNames[mock_settings.current_exposure_mode], |
| 46 'exposureMode;'); |
| 45 assert_equals(settings.focusMode, | 47 assert_equals(settings.focusMode, |
| 46 meteringModeNames[mock_settings.focus_mode], 'focusMode'); | 48 meteringModeNames[mock_settings.current_focus_mode], |
| 49 'focusMode'); |
| 47 | 50 |
| 48 assert_equals(settings.pointsOfInterest.length, | 51 assert_equals(settings.pointsOfInterest.length, |
| 49 mock_settings.points_of_interest.length, | 52 mock_settings.points_of_interest.length, |
| 50 'pointsOfInterest'); | 53 'pointsOfInterest'); |
| 51 for (i = 0; i < settings.pointsOfInterest.length; ++i) { | 54 for (i = 0; i < settings.pointsOfInterest.length; ++i) { |
| 52 assert_approx_equals(settings.pointsOfInterest[i].x, | 55 assert_approx_equals(settings.pointsOfInterest[i].x, |
| 53 mock_settings.points_of_interest[i].x, 0.01, | 56 mock_settings.points_of_interest[i].x, 0.01, |
| 54 'pointsOfInterest x'); | 57 'pointsOfInterest x'); |
| 55 assert_approx_equals(settings.pointsOfInterest[i].y, | 58 assert_approx_equals(settings.pointsOfInterest[i].y, |
| 56 mock_settings.points_of_interest[i].y, 0.01, | 59 mock_settings.points_of_interest[i].y, 0.01, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 75 t.done(); | 78 t.done(); |
| 76 }, 100); | 79 }, 100); |
| 77 }, | 80 }, |
| 78 error => { | 81 error => { |
| 79 assert_unreached("Error creating MockImageCapture: " + error); | 82 assert_unreached("Error creating MockImageCapture: " + error); |
| 80 }); | 83 }); |
| 81 | 84 |
| 82 }, 'exercises MediaStreamTrack.getSettings()'); | 85 }, 'exercises MediaStreamTrack.getSettings()'); |
| 83 | 86 |
| 84 </script> | 87 </script> |
| OLD | NEW |