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

Side by Side Diff: content/test/data/media/depth_stream_test_utilities.js

Issue 2550193002: Fix: DepthCapture_depthStreamToRGBAFloatTexture flaky on MAC ATI Retina (Closed)
Patch Set: Fix: DepthCapture_depthStreamToRGBAFloatTexture flaky on MAC ATI Retina Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 function getConstraintsForDevice(deviceLabel) { 5 function getConstraintsForDevice(deviceLabel) {
6 return new Promise(function(resolve, reject) { 6 return new Promise(function(resolve, reject) {
7 navigator.mediaDevices.enumerateDevices() 7 navigator.mediaDevices.enumerateDevices()
8 .then(function(devices) { 8 .then(function(devices) {
9 for (var i = 0; i < devices.length; ++i) { 9 for (var i = 0; i < devices.length; ++i) {
10 if (deviceLabel == devices[i].label) { 10 if (deviceLabel == devices[i].label) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // Calculate all reference points based on top left and compare. 54 // Calculate all reference points based on top left and compare.
55 for (var j = 0; j < rowsColumnsToCheck.length; ++j) { 55 for (var j = 0; j < rowsColumnsToCheck.length; ++j) {
56 var row = rowsColumnsToCheck[j][0]; 56 var row = rowsColumnsToCheck[j][0];
57 var column = rowsColumnsToCheck[j][1]; 57 var column = rowsColumnsToCheck[j][1];
58 var i = (width * row + column) * 4; 58 var i = (width * row + column) * 4;
59 if (data[i] != data[i + 1] || data[i] != data[i + 2]) { 59 if (data[i] != data[i + 1] || data[i] != data[i + 2]) {
60 return Promise.reject(test_name + ": values " + data[i] + ", " + 60 return Promise.reject(test_name + ": values " + data[i] + ", " +
61 data[i + 1] + ", " + data[i + 2] + 61 data[i + 1] + ", " + data[i + 2] +
62 " differ at index " + i); 62 " differ at index " + i);
63 } 63 }
64 var calculated = (data[0] + 64 var calculated = (data[0] + wrap_around +
65 step * ((flip_y ? -row : row) + column)) % wrap_around; 65 step * ((flip_y ? -row : row) + column)) % wrap_around;
66 if (Math.abs(calculated - data[i]) > tolerance) { 66 if (Math.abs(calculated - data[i]) > tolerance) {
67 return Promise.reject(test_name + ": reference value " + data[i] + 67 return Promise.reject(test_name + ": reference value " + data[i] +
68 " differs from calculated: " + calculated + 68 " differs from calculated: " + calculated +
69 " at index (row, column) " + i + " (" + row + ", " + column + 69 " at index (row, column) " + i + " (" + row + ", " + column +
70 "). TopLeft value:" + data[0] + ", step:" + step + ", flip_y:" + 70 "). TopLeft value:" + data[0] + ", step:" + step + ", flip_y:" +
71 flip_y); 71 flip_y);
72 } 72 }
73 } 73 }
74 return true; 74 return true;
75 } 75 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698