browser/devtools/tilt/test/browser_tilt_arcball.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/tilt/test/browser_tilt_arcball.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,496 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +"use strict";
     1.7 +
     1.8 +function cloneUpdate(update) {
     1.9 +  return {
    1.10 +    rotation: quat4.create(update.rotation),
    1.11 +    translation: vec3.create(update.translation)
    1.12 +  };
    1.13 +}
    1.14 +
    1.15 +function isExpectedUpdate(update1, update2) {
    1.16 +  if (update1.length !== update2.length) {
    1.17 +    return false;
    1.18 +  }
    1.19 +  for (let i = 0, len = update1.length; i < len; i++) {
    1.20 +    if (!isApproxVec(update1[i].rotation, update2[i].rotation) ||
    1.21 +        !isApproxVec(update1[i].translation, update2[i].translation)) {
    1.22 +      info("isExpectedUpdate expected " + JSON.stringify(update1), ", got " +
    1.23 +                                          JSON.stringify(update2) + " instead.");
    1.24 +      return false;
    1.25 +    }
    1.26 +  }
    1.27 +  return true;
    1.28 +}
    1.29 +
    1.30 +function test() {
    1.31 +  let arcball1 = new TiltVisualizer.Arcball(window, 123, 456);
    1.32 +
    1.33 +  is(arcball1.width, 123,
    1.34 +    "The first arcball width wasn't set correctly.");
    1.35 +  is(arcball1.height, 456,
    1.36 +    "The first arcball height wasn't set correctly.");
    1.37 +  is(arcball1.radius, 123,
    1.38 +    "The first arcball radius wasn't implicitly set correctly.");
    1.39 +
    1.40 +
    1.41 +  let arcball2 = new TiltVisualizer.Arcball(window, 987, 654);
    1.42 +
    1.43 +  is(arcball2.width, 987,
    1.44 +    "The second arcball width wasn't set correctly.");
    1.45 +  is(arcball2.height, 654,
    1.46 +    "The second arcball height wasn't set correctly.");
    1.47 +  is(arcball2.radius, 654,
    1.48 +    "The second arcball radius wasn't implicitly set correctly.");
    1.49 +
    1.50 +
    1.51 +  let arcball3 = new TiltVisualizer.Arcball(window, 512, 512);
    1.52 +
    1.53 +  let sphereVec = vec3.create();
    1.54 +  arcball3._pointToSphere(123, 456, 256, 512, 512, sphereVec);
    1.55 +
    1.56 +  ok(isApproxVec(sphereVec, [-0.009765625, 0.390625, 0.9204980731010437]),
    1.57 +    "The _pointToSphere() function didn't map the coordinates correctly.");
    1.58 +
    1.59 +  let stack1 = [];
    1.60 +  let expect1 = [
    1.61 +    { rotation: [
    1.62 +      -0.08877250552177429, 0.0242881178855896,
    1.63 +      -0.04222869873046875, -0.9948599338531494],
    1.64 +      translation: [0, 0, 0] },
    1.65 +    { rotation: [
    1.66 +      -0.13086390495300293, 0.03413732722401619,
    1.67 +      -0.06334304809570312, -0.9887855648994446],
    1.68 +      translation: [0, 0, 0] },
    1.69 +    { rotation: [
    1.70 +      -0.15138940513134003, 0.03854173421859741,
    1.71 +      -0.07390022277832031, -0.9849540591239929],
    1.72 +      translation: [0, 0, 0] },
    1.73 +    { rotation: [
    1.74 +      -0.1615273654460907, 0.040619146078825,
    1.75 +      -0.0791788101196289, -0.9828477501869202],
    1.76 +      translation: [0, 0, 0] },
    1.77 +    { rotation: [
    1.78 +      -0.16656573116779327, 0.04162723943591118,
    1.79 +      -0.0818181037902832, -0.9817478656768799],
    1.80 +      translation: [0, 0, 0] },
    1.81 +    { rotation: [
    1.82 +      -0.16907735168933868, 0.042123712599277496,
    1.83 +      -0.08313775062561035, -0.9811863303184509],
    1.84 +      translation: [0, 0, 0] },
    1.85 +    { rotation: [
    1.86 +      -0.17033125460147858, 0.042370058596134186,
    1.87 +      -0.08379757404327393, -0.9809026718139648],
    1.88 +      translation: [0, 0, 0] },
    1.89 +    { rotation: [
    1.90 +      -0.17095772922039032, 0.04249274358153343,
    1.91 +      -0.08412748575210571, -0.9807600975036621],
    1.92 +      translation: [0, 0, 0] },
    1.93 +    { rotation: [
    1.94 +      -0.17127084732055664, 0.04255397245287895,
    1.95 +      -0.0842924416065216, -0.9806886315345764],
    1.96 +      translation: [0, 0, 0] },
    1.97 +    { rotation: [
    1.98 +      -0.171427384018898, 0.042584557086229324,
    1.99 +      -0.08437491953372955, -0.9806528687477112],
   1.100 +      translation: [0, 0, 0] }];
   1.101 +
   1.102 +  arcball3.mouseDown(10, 10, 1);
   1.103 +  arcball3.mouseMove(10, 100);
   1.104 +  for (let i1 = 0; i1 < 10; i1++) {
   1.105 +    stack1.push(cloneUpdate(arcball3.update()));
   1.106 +  }
   1.107 +
   1.108 +  ok(isExpectedUpdate(stack1, expect1),
   1.109 +    "Mouse down & move events didn't create the expected transform. results.");
   1.110 +
   1.111 +  let stack2 = [];
   1.112 +  let expect2 = [
   1.113 +    { rotation: [
   1.114 +      -0.1684110015630722, 0.04199237748980522,
   1.115 +      -0.0827873945236206, -0.9813361167907715],
   1.116 +      translation: [0, 0, 0] },
   1.117 +    { rotation: [
   1.118 +      -0.16936375200748444, 0.04218007251620293,
   1.119 +      -0.08328840136528015, -0.9811217188835144],
   1.120 +      translation: [0, 0, 0] },
   1.121 +    { rotation: [
   1.122 +      -0.17003019154071808, 0.04231100529432297,
   1.123 +      -0.08363909274339676, -0.9809709787368774],
   1.124 +      translation: [0, 0, 0] },
   1.125 +    { rotation: [
   1.126 +      -0.17049652338027954, 0.042402446269989014,
   1.127 +      -0.0838845893740654, -0.9808651208877563],
   1.128 +      translation: [0, 0, 0] },
   1.129 +    { rotation: [
   1.130 +      -0.17082282900810242, 0.042466338723897934,
   1.131 +      -0.08405643701553345, -0.9807908535003662],
   1.132 +      translation: [0, 0, 0] },
   1.133 +    { rotation: [
   1.134 +      -0.17105120420455933, 0.04251104220747948,
   1.135 +      -0.08417671173810959, -0.9807388186454773],
   1.136 +      translation: [0, 0, 0] },
   1.137 +    { rotation: [
   1.138 +      -0.17121103405952454, 0.04254228621721268,
   1.139 +      -0.08426092565059662, -0.9807023406028748],
   1.140 +      translation: [0, 0, 0] },
   1.141 +    { rotation: [
   1.142 +      -0.17132291197776794, 0.042564138770103455,
   1.143 +      -0.08431987464427948, -0.9806767106056213],
   1.144 +      translation: [0, 0, 0] },
   1.145 +    { rotation: [
   1.146 +      -0.1714012324810028, 0.04257945716381073,
   1.147 +      -0.08436112850904465, -0.9806588888168335],
   1.148 +      translation: [0, 0, 0] },
   1.149 +    { rotation: [
   1.150 +      -0.17145603895187378, 0.042590171098709106,
   1.151 +      -0.08439001441001892, -0.9806463718414307],
   1.152 +      translation: [0, 0, 0] }];
   1.153 +
   1.154 +  arcball3.mouseUp(100, 100);
   1.155 +  for (let i2 = 0; i2 < 10; i2++) {
   1.156 +    stack2.push(cloneUpdate(arcball3.update()));
   1.157 +  }
   1.158 +
   1.159 +  ok(isExpectedUpdate(stack2, expect2),
   1.160 +    "Mouse up events didn't create the expected transformation results.");
   1.161 +
   1.162 +  let stack3 = [];
   1.163 +  let expect3 = [
   1.164 +    { rotation: [
   1.165 +      -0.17149439454078674, 0.04259764403104782,
   1.166 +      -0.08441022783517838, -0.9806375503540039],
   1.167 +      translation: [0, 0, -1] },
   1.168 +    { rotation: [
   1.169 +      -0.17152123153209686, 0.04260288551449776,
   1.170 +      -0.08442437648773193, -0.980631411075592],
   1.171 +      translation: [0, 0, -1.899999976158142] },
   1.172 +    { rotation: [
   1.173 +      -0.1715400665998459, 0.04260658100247383,
   1.174 +      -0.08443428575992584, -0.9806271195411682],
   1.175 +      translation: [0, 0, -2.7100000381469727] },
   1.176 +    { rotation: [
   1.177 +      -0.17155319452285767, 0.04260912910103798,
   1.178 +      -0.08444121479988098, -0.9806240797042847],
   1.179 +      translation: [0, 0, -3.439000129699707] },
   1.180 +    { rotation: [
   1.181 +      -0.17156240344047546, 0.042610932141542435,
   1.182 +      -0.08444607257843018, -0.9806219935417175],
   1.183 +      translation: [0, 0, -4.095099925994873] },
   1.184 +    { rotation: [
   1.185 +      -0.1715688556432724, 0.042612191289663315,
   1.186 +      -0.08444946259260178, -0.9806205034255981],
   1.187 +      translation: [0, 0, -4.685589790344238] },
   1.188 +    { rotation: [
   1.189 +      -0.17157337069511414, 0.04261308163404465,
   1.190 +      -0.0844518393278122, -0.980619490146637],
   1.191 +      translation: [0, 0, -5.217031002044678] },
   1.192 +    { rotation: [
   1.193 +      -0.17157652974128723, 0.0426136814057827,
   1.194 +      -0.0844535157084465, -0.9806187748908997],
   1.195 +      translation: [0, 0, -5.6953277587890625] },
   1.196 +    { rotation: [
   1.197 +      -0.17157875001430511, 0.04261413961648941,
   1.198 +      -0.08445467799901962, -0.9806182980537415],
   1.199 +      translation: [0, 0, -6.125794887542725] },
   1.200 +    { rotation: [
   1.201 +      -0.17158031463623047, 0.04261442646384239,
   1.202 +      -0.08445550501346588, -0.980617880821228],
   1.203 +      translation: [0, 0, -6.5132155418396] }];
   1.204 +
   1.205 +  arcball3.zoom(10);
   1.206 +  for (let i3 = 0; i3 < 10; i3++) {
   1.207 +    stack3.push(cloneUpdate(arcball3.update()));
   1.208 +  }
   1.209 +
   1.210 +  ok(isExpectedUpdate(stack3, expect3),
   1.211 +    "Mouse zoom events didn't create the expected transformation results.");
   1.212 +
   1.213 +  let stack4 = [];
   1.214 +  let expect4 = [
   1.215 +    { rotation: [
   1.216 +      -0.17158135771751404, 0.04261462762951851,
   1.217 +      -0.08445606380701065, -0.9806176424026489],
   1.218 +      translation: [0, 0, -6.861894130706787] },
   1.219 +    { rotation: [
   1.220 +      -0.1715821474790573, 0.04261479899287224,
   1.221 +      -0.08445646613836288, -0.9806175231933594],
   1.222 +      translation: [0, 0, -7.1757049560546875] },
   1.223 +    { rotation: [
   1.224 +      -0.1715826541185379, 0.0426148846745491,
   1.225 +      -0.08445674180984497, -0.980617344379425],
   1.226 +      translation: [0, 0, -7.458134651184082] },
   1.227 +    { rotation: [
   1.228 +      -0.17158304154872894, 0.04261497035622597,
   1.229 +      -0.08445693552494049, -0.9806172847747803],
   1.230 +      translation: [0, 0, -7.7123212814331055] },
   1.231 +    { rotation: [
   1.232 +      -0.17158329486846924, 0.042615000158548355,
   1.233 +      -0.08445708453655243, -0.9806172251701355],
   1.234 +      translation: [0, 0, -7.941089153289795] },
   1.235 +    { rotation: [
   1.236 +      -0.17158347368240356, 0.04261505603790283,
   1.237 +      -0.084457166492939, -0.9806172251701355],
   1.238 +      translation: [0, 0, -8.146980285644531] },
   1.239 +    { rotation: [
   1.240 +      -0.1715836226940155, 0.04261508584022522,
   1.241 +      -0.08445724099874496, -0.9806171655654907],
   1.242 +      translation: [0, 0, -8.332282066345215] },
   1.243 +    { rotation: [
   1.244 +      -0.17158368229866028, 0.04261508584022522,
   1.245 +      -0.08445728570222855, -0.980617105960846],
   1.246 +      translation: [0, 0, -8.499053955078125] },
   1.247 +    { rotation: [
   1.248 +      -0.17158377170562744, 0.04261511191725731,
   1.249 +      -0.08445732295513153, -0.980617105960846],
   1.250 +      translation: [0, 0, -8.649148941040039] },
   1.251 +    { rotation: [
   1.252 +      -0.17158380150794983, 0.04261511191725731,
   1.253 +      -0.08445733785629272, -0.980617105960846],
   1.254 +      translation: [0, 0, -8.784234046936035] }];
   1.255 +
   1.256 +  arcball3.keyDown(arcball3.rotateKeys.left);
   1.257 +  arcball3.keyDown(arcball3.rotateKeys.right);
   1.258 +  arcball3.keyDown(arcball3.rotateKeys.up);
   1.259 +  arcball3.keyDown(arcball3.rotateKeys.down);
   1.260 +  arcball3.keyDown(arcball3.panKeys.left);
   1.261 +  arcball3.keyDown(arcball3.panKeys.right);
   1.262 +  arcball3.keyDown(arcball3.panKeys.up);
   1.263 +  arcball3.keyDown(arcball3.panKeys.down);
   1.264 +  for (let i4 = 0; i4 < 10; i4++) {
   1.265 +    stack4.push(cloneUpdate(arcball3.update()));
   1.266 +  }
   1.267 +
   1.268 +  ok(isExpectedUpdate(stack4, expect4),
   1.269 +    "Key down events didn't create the expected transformation results.");
   1.270 +
   1.271 +  let stack5 = [];
   1.272 +  let expect5 = [
   1.273 +    { rotation: [
   1.274 +      -0.1715838462114334, 0.04261511191725731,
   1.275 +      -0.08445736765861511, -0.980617105960846],
   1.276 +      translation: [0, 0, -8.905810356140137] },
   1.277 +    { rotation: [
   1.278 +      -0.1715838462114334, 0.04261511191725731,
   1.279 +      -0.08445736765861511, -0.980617105960846],
   1.280 +      translation: [0, 0, -9.015229225158691] },
   1.281 +    { rotation: [
   1.282 +      -0.1715838462114334, 0.04261511191725731,
   1.283 +      -0.08445736765861511, -0.980617105960846],
   1.284 +      translation: [0, 0, -9.113706588745117] },
   1.285 +    { rotation: [
   1.286 +      -0.1715838611125946, 0.04261511191725731,
   1.287 +      -0.0844573825597763, -0.9806170463562012],
   1.288 +      translation: [0, 0, -9.202336311340332] },
   1.289 +    { rotation: [
   1.290 +      -0.17158392071723938, 0.0426151417195797,
   1.291 +      -0.0844573974609375, -0.980617105960846],
   1.292 +      translation: [0, 0, -9.282102584838867] },
   1.293 +    { rotation: [
   1.294 +      -0.17158392071723938, 0.0426151417195797,
   1.295 +      -0.0844573974609375, -0.980617105960846],
   1.296 +      translation: [0, 0, -9.35389232635498] },
   1.297 +    { rotation: [
   1.298 +      -0.17158392071723938, 0.0426151417195797,
   1.299 +      -0.0844573974609375, -0.980617105960846],
   1.300 +      translation: [0, 0, -9.418502807617188] },
   1.301 +    { rotation: [
   1.302 +      -0.17158392071723938, 0.0426151417195797,
   1.303 +      -0.0844573974609375, -0.980617105960846],
   1.304 +      translation: [0, 0, -9.476652145385742] },
   1.305 +    { rotation: [
   1.306 +      -0.17158392071723938, 0.0426151417195797,
   1.307 +      -0.0844573974609375, -0.980617105960846],
   1.308 +      translation: [0, 0, -9.528986930847168] },
   1.309 +    { rotation: [
   1.310 +      -0.17158392071723938, 0.0426151417195797,
   1.311 +      -0.0844573974609375, -0.980617105960846],
   1.312 +      translation: [0, 0, -9.576087951660156] }];
   1.313 +
   1.314 +  arcball3.keyUp(arcball3.rotateKeys.left);
   1.315 +  arcball3.keyUp(arcball3.rotateKeys.right);
   1.316 +  arcball3.keyUp(arcball3.rotateKeys.up);
   1.317 +  arcball3.keyUp(arcball3.rotateKeys.down);
   1.318 +  arcball3.keyUp(arcball3.panKeys.left);
   1.319 +  arcball3.keyUp(arcball3.panKeys.right);
   1.320 +  arcball3.keyUp(arcball3.panKeys.up);
   1.321 +  arcball3.keyUp(arcball3.panKeys.down);
   1.322 +  for (let i5 = 0; i5 < 10; i5++) {
   1.323 +    stack5.push(cloneUpdate(arcball3.update()));
   1.324 +  }
   1.325 +
   1.326 +  ok(isExpectedUpdate(stack5, expect5),
   1.327 +    "Key up events didn't create the expected transformation results.");
   1.328 +
   1.329 +  let stack6 = [];
   1.330 +  let expect6 = [
   1.331 +    { rotation: [
   1.332 +      -0.17158392071723938, 0.0426151417195797,
   1.333 +      -0.0844573974609375, -0.980617105960846],
   1.334 +      translation: [0, 0, -9.618478775024414] },
   1.335 +    { rotation: [
   1.336 +      -0.17158392071723938, 0.0426151417195797,
   1.337 +      -0.0844573974609375, -0.980617105960846],
   1.338 +      translation: [0, 0, -6.156630992889404] },
   1.339 +    { rotation: [
   1.340 +      -0.17158392071723938, 0.0426151417195797,
   1.341 +      -0.0844573974609375, -0.980617105960846],
   1.342 +      translation: [0, 0, 0.4590320587158203] },
   1.343 +    { rotation: [
   1.344 +      -0.17158392071723938, 0.0426151417195797,
   1.345 +      -0.0844573974609375, -0.980617105960846],
   1.346 +      translation: [0, 0, 9.913128852844238] },
   1.347 +    { rotation: [
   1.348 +      -0.17158392071723938, 0.0426151417195797,
   1.349 +      -0.0844573974609375, -0.980617105960846],
   1.350 +      translation: [0, 0, 21.921815872192383] },
   1.351 +    { rotation: [
   1.352 +      -0.17158392071723938, 0.0426151417195797,
   1.353 +      -0.0844573974609375, -0.980617105960846],
   1.354 +      translation: [0, 0, 36.22963333129883] },
   1.355 +    { rotation: [
   1.356 +      -0.17158392071723938, 0.0426151417195797,
   1.357 +      -0.0844573974609375, -0.980617105960846],
   1.358 +      translation: [0, 0, 52.60667037963867] },
   1.359 +    { rotation: [
   1.360 +      -0.17158392071723938, 0.0426151417195797,
   1.361 +      -0.0844573974609375, -0.980617105960846],
   1.362 +      translation: [0, 0, 70.84600067138672] },
   1.363 +    { rotation: [
   1.364 +      -0.17158392071723938, 0.0426151417195797,
   1.365 +      -0.0844573974609375, -0.980617105960846],
   1.366 +      translation: [0, 0, 90.76139831542969] },
   1.367 +    { rotation: [
   1.368 +      -0.17158392071723938, 0.0426151417195797,
   1.369 +      -0.0844573974609375, -0.980617105960846],
   1.370 +      translation: [0, 0, 112.18525695800781] }];
   1.371 +
   1.372 +  arcball3.keyDown(arcball3.zoomKeys["in"][0]);
   1.373 +  arcball3.keyDown(arcball3.zoomKeys["in"][1]);
   1.374 +  arcball3.keyDown(arcball3.zoomKeys["in"][2]);
   1.375 +  for (let i6 = 0; i6 < 10; i6++) {
   1.376 +    stack6.push(cloneUpdate(arcball3.update()));
   1.377 +  }
   1.378 +  arcball3.keyUp(arcball3.zoomKeys["in"][0]);
   1.379 +  arcball3.keyUp(arcball3.zoomKeys["in"][1]);
   1.380 +  arcball3.keyUp(arcball3.zoomKeys["in"][2]);
   1.381 +
   1.382 +  ok(isExpectedUpdate(stack6, expect6),
   1.383 +    "Key zoom in events didn't create the expected transformation results.");
   1.384 +
   1.385 +  let stack7 = [];
   1.386 +  let expect7 = [
   1.387 +    { rotation: [
   1.388 +      -0.17158392071723938, 0.0426151417195797,
   1.389 +      -0.0844573974609375, -0.980617105960846],
   1.390 +      translation: [0, 0, 134.96673583984375] },
   1.391 +    { rotation: [
   1.392 +      -0.17158392071723938, 0.0426151417195797,
   1.393 +      -0.0844573974609375, -0.980617105960846],
   1.394 +      translation: [0, 0, 151.97006225585938] },
   1.395 +    { rotation: [
   1.396 +      -0.17158392071723938, 0.0426151417195797,
   1.397 +      -0.0844573974609375, -0.980617105960846],
   1.398 +      translation: [0, 0, 163.77305603027344] },
   1.399 +    { rotation: [
   1.400 +      -0.17158392071723938, 0.0426151417195797,
   1.401 +      -0.0844573974609375, -0.980617105960846],
   1.402 +      translation: [0, 0, 170.895751953125] },
   1.403 +    { rotation: [
   1.404 +      -0.17158392071723938, 0.0426151417195797,
   1.405 +      -0.0844573974609375, -0.980617105960846],
   1.406 +      translation: [0, 0, 173.80618286132812] },
   1.407 +    { rotation: [
   1.408 +      -0.17158392071723938, 0.0426151417195797,
   1.409 +      -0.0844573974609375, -0.980617105960846],
   1.410 +      translation: [0, 0, 172.92556762695312] },
   1.411 +    { rotation: [
   1.412 +      -0.17158392071723938, 0.0426151417195797,
   1.413 +      -0.0844573974609375, -0.980617105960846],
   1.414 +      translation: [0, 0, 168.6330108642578] },
   1.415 +    { rotation: [
   1.416 +      -0.17158392071723938, 0.0426151417195797,
   1.417 +      -0.0844573974609375, -0.980617105960846],
   1.418 +      translation: [0, 0, 161.26971435546875] },
   1.419 +    { rotation: [
   1.420 +      -0.17158392071723938, 0.0426151417195797,
   1.421 +      -0.0844573974609375, -0.980617105960846],
   1.422 +      translation: [0, 0, 151.1427459716797] },
   1.423 +    { rotation: [
   1.424 +      -0.17158392071723938, 0.0426151417195797,
   1.425 +      -0.0844573974609375, -0.980617105960846],
   1.426 +      translation: [0, 0, 138.52847290039062] }];
   1.427 +
   1.428 +  arcball3.keyDown(arcball3.zoomKeys["out"][0]);
   1.429 +  arcball3.keyDown(arcball3.zoomKeys["out"][1]);
   1.430 +  for (let i7 = 0; i7 < 10; i7++) {
   1.431 +    stack7.push(cloneUpdate(arcball3.update()));
   1.432 +  }
   1.433 +  arcball3.keyUp(arcball3.zoomKeys["out"][0]);
   1.434 +  arcball3.keyUp(arcball3.zoomKeys["out"][1]);
   1.435 +
   1.436 +  ok(isExpectedUpdate(stack7, expect7),
   1.437 +    "Key zoom out events didn't create the expected transformation results.");
   1.438 +
   1.439 +  let stack8 = [];
   1.440 +  let expect8 = [
   1.441 +    { rotation: [
   1.442 +      -0.17158392071723938, 0.0426151417195797,
   1.443 +      -0.0844573974609375, -0.980617105960846],
   1.444 +      translation: [0, 0, 123.67562866210938] },
   1.445 +    { rotation: [
   1.446 +      -0.17158392071723938, 0.0426151417195797,
   1.447 +      -0.0844573974609375, -0.980617105960846],
   1.448 +      translation: [0, 0, 111.30806732177734] },
   1.449 +    { rotation: [
   1.450 +      -0.17158392071723938, 0.0426151417195797,
   1.451 +      -0.0844573974609375, -0.980617105960846],
   1.452 +      translation: [0, 0, 100.17726135253906] },
   1.453 +    { rotation: [
   1.454 +      -0.17158392071723938, 0.0426151417195797,
   1.455 +      -0.0844573974609375, -0.980617105960846],
   1.456 +      translation: [0, 0, 90.15953826904297] },
   1.457 +    { rotation: [
   1.458 +      -0.17158392071723938, 0.0426151417195797,
   1.459 +      -0.0844573974609375, -0.980617105960846],
   1.460 +      translation: [0, 0, 81.14358520507812] },
   1.461 +    { rotation: [
   1.462 +      -0.17158392071723938, 0.0426151417195797,
   1.463 +      -0.0844573974609375, -0.980617105960846],
   1.464 +      translation: [0, 0, 73.02922821044922] },
   1.465 +    { rotation: [
   1.466 +      -0.17158392071723938, 0.0426151417195797,
   1.467 +      -0.0844573974609375, -0.980617105960846],
   1.468 +      translation: [0, 0, 65.72630310058594] },
   1.469 +    { rotation: [
   1.470 +      -0.17158392071723938, 0.0426151417195797,
   1.471 +      -0.0844573974609375, -0.980617105960846],
   1.472 +      translation: [0, 0, 59.15367126464844] },
   1.473 +    { rotation: [
   1.474 +      -0.17158392071723938, 0.0426151417195797,
   1.475 +      -0.0844573974609375, -0.980617105960846],
   1.476 +      translation: [0, 0, 53.238304138183594] },
   1.477 +    { rotation: [
   1.478 +      -0.17158392071723938, 0.0426151417195797,
   1.479 +      -0.0844573974609375, -0.980617105960846],
   1.480 +      translation: [0, 0, 47.91447448730469] }];
   1.481 +
   1.482 +  arcball3.keyDown(arcball3.zoomKeys["unzoom"]);
   1.483 +  for (let i8 = 0; i8 < 10; i8++) {
   1.484 +    stack8.push(cloneUpdate(arcball3.update()));
   1.485 +  }
   1.486 +  arcball3.keyUp(arcball3.zoomKeys["unzoom"]);
   1.487 +
   1.488 +  ok(isExpectedUpdate(stack8, expect8),
   1.489 +    "Key zoom reset events didn't create the expected transformation results.");
   1.490 +
   1.491 +
   1.492 +  arcball3.resize(123, 456);
   1.493 +  is(arcball3.width, 123,
   1.494 +    "The third arcball width wasn't updated correctly.");
   1.495 +  is(arcball3.height, 456,
   1.496 +    "The third arcball height wasn't updated correctly.");
   1.497 +  is(arcball3.radius, 123,
   1.498 +    "The third arcball radius wasn't implicitly updated correctly.");
   1.499 +}

mercurial