15832144755
2022-01-06 7b4c8991dca9cf2a809a95e239d144697d3afb56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
  });
});