You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
661 B
JavaScript
24 lines
661 B
JavaScript
import { isBlobUri } from "../../Source/Cesium.js";
|
|
|
|
describe("Core/isBlobUri", function () {
|
|
it("Throws if url is undefined", function () {
|
|
expect(function () {
|
|
isBlobUri(undefined);
|
|
}).toThrowDeveloperError();
|
|
});
|
|
|
|
it("Determines that a uri is not a blob uri", function () {
|
|
expect(isBlobUri("http://cesiumjs.org/")).toEqual(false);
|
|
});
|
|
|
|
it("Determines that a uri is a blob uri", function () {
|
|
var uint8Array = new Uint8Array(4);
|
|
var blob = new Blob([uint8Array], {
|
|
type: "application/octet-stream",
|
|
});
|
|
|
|
var blobUrl = window.URL.createObjectURL(blob);
|
|
expect(isBlobUri(blobUrl)).toEqual(true);
|
|
});
|
|
});
|