Skip to content

Commit

Permalink
skip: test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
happyhj committed Jan 14, 2018
1 parent f5c8277 commit c90a05a
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 51 deletions.
4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions 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.

4 changes: 2 additions & 2 deletions 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.

8 changes: 2 additions & 6 deletions src/PanoImageRenderer/ImageLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export default class ImageLoader {
/* Check isMaybeLoaded() first because there may have posibilities that image already loaded before get is called. for example calling get on external image onload callback.*/
res(this._image);
} else if (this._loadStatus === STATUS.LOADING) {
this._once("load", () => {
res(this._image);
});
this._once("load", () => res(this._image));
this._once("error", () => rej("ImageLoader: failed to load images."));
} else {
rej("ImageLoader: failed to load images");
Expand Down Expand Up @@ -52,9 +50,7 @@ export default class ImageLoader {
return;
}

this._once("load", () => {
this._loadStatus = STATUS.LOADED;
});
this._once("load", () => (this._loadStatus = STATUS.LOADED));
this._once("error", () => (this._loadStatus = STATUS.ERROR));
}

Expand Down
46 changes: 23 additions & 23 deletions test/unit/PanoViewer/PanoViewer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,31 +161,31 @@ describe("PanoViewer", function() {
});

// Currently not available
// IT.skip("should replace image of other projection type", function(done) {
// // Given
// panoViewer = new PanoViewer(target, {
// image: "./images/test_equi.png"
// });
IT.skip("should replace image of other projection type", function(done) {
// Given
panoViewer = new PanoViewer(target, {
image: "./images/test_equi.png"
});

// // first `onContentLoad` event is for image specified in constructor.
// panoViewer.once(PanoViewer.EVENTS.CONTENT_LOADED, evt1 => {
// console.log("contentLoaded #1", evt1.content.src, evt1.projectionType);
// const prevContentSrc = evt1.content.src;
// const prevProjectionType = evt1.projectionType;

// panoViewer.once(PanoViewer.EVENTS.CONTENT_LOADED, evt2 => {
// console.log("contentLoaded #2", evt2.content.src, evt2.projectionType);
// // Then
// expect(evt2.content.src).to.not.equal(prevContentSrc);
// expect(evt2.projectionType).to.not.equal(prevProjectionType);
// done();
// });
// first `onContentLoad` event is for image specified in constructor.
panoViewer.once(PanoViewer.EVENTS.CONTENT_LOADED, evt1 => {
console.log("contentLoaded #1", evt1.content.src, evt1.projectionType);
const prevContentSrc = evt1.content.src;
const prevProjectionType = evt1.projectionType;

panoViewer.once(PanoViewer.EVENTS.CONTENT_LOADED, evt2 => {
console.log("contentLoaded #2", evt2.content.src, evt2.projectionType);
// Then
expect(evt2.content.src).to.not.equal(prevContentSrc);
expect(evt2.projectionType).to.not.equal(prevProjectionType);
done();
});

// // When
// // Change image of other projection type.
// panoViewer.setImage("./images/glasscITy_cube_1024.jpg", PanoViewer.ProjectionType.VERTICAL_CUBESTRIP);
// });
// });
// When
// Change image of other projection type.
panoViewer.setImage("./images/glasscITy_cube_1024.jpg", PanoViewer.ProjectionType.VERTICAL_CUBESTRIP);
});
});
});

describe("event flow", function() {
Expand Down

0 comments on commit c90a05a

Please sign in to comment.