Skip to content

Commit

Permalink
skip: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
happyhj committed Mar 25, 2018
1 parent dfb2dc8 commit 3e6733b
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 32 deletions.
3 changes: 2 additions & 1 deletion dist/PanoViewer/view360.panoviewer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SpinViewer/view360.spinviewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SpinViewer/view360.spinviewer.pkgd.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/view360.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/view360.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/view360.pkgd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/view360.pkgd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.pkgd.min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/YawPitchControl/YawPitchControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ const YawPitchControl = class YawPitchControl extends Component {

if (keys.some(key => key === "gyroMode") && SUPPORT_DEVICEMOTION) {
const isVR = this.options.gyroMode === GYRO_MODE.VR;
const isYawPitch = this.options.gyroMode === GYRO_MODE.YAWPITCH;

// Disconnect first
if (this.axesTiltMotionInput) {
Expand All @@ -255,7 +256,7 @@ const YawPitchControl = class YawPitchControl extends Component {

if (isVR) {
this._initDeviceQuaternion();
} else if (!isVR) {
} else if (isYawPitch) {
this.axesTiltMotionInput = new TiltMotionInput(this._element);
this.axes.connect(["yaw", "pitch"], this.axesTiltMotionInput);
}
Expand Down
38 changes: 25 additions & 13 deletions test/unit/YawPitchControl/YawPitchControl.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2111,15 +2111,22 @@ describe("YawPitchControl", function() {
};

class MockRotationPanInput extends RotationPanInput {
constructor(el, options) {
super(el, options);

this._screenRotationAngle = {
getRadian: function() {
return glMatrix.toRadian(90); /* 90 degree */
},
unref: function() {
/* Do nothing */
setUseRotation(useRotation) {
this._useRotation = useRotation;

if (this._screenRotationAngle) {
this._screenRotationAngle.unref();
this._screenRotationAngle = null;
}

if (this._useRotation) {
this._screenRotationAngle = {
getRadian: function() {
return glMatrix.toRadian(90); /* 90 degree */
},
unref: function() {
/* Do nothing */
}
}
}
}
Expand Down Expand Up @@ -2149,17 +2156,22 @@ describe("YawPitchControl", function() {
gyroMode: GYRO_MODE.VR /* this makes RotationPanInput as a rotation Mode */
});

inst.on("change", function(e) {
console.log(e);
});
inst.enable();

const prevYaw = inst.getYaw();
const prevPitch = inst.getPitch();

console.log(prevYaw,prevPitch )
// When
Simulator.gestures.pan(target, MOVE_VERTICALLY, () => {
// Then
console.log(inst.getYaw(), inst.getPitch())
expect(inst.getYaw()).to.be.not.equal(prevYaw);
expect(inst.getPitch()).to.be.equal(prevPitch);
const currYaw = inst.getYaw();
const currPitch = inst.getPitch();
console.log(currYaw, currPitch);
expect(currYaw).to.be.not.equal(prevYaw);
expect(currPitch).to.be.equal(prevPitch);
done();
});
});
Expand Down

0 comments on commit 3e6733b

Please sign in to comment.