mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Implement blank file tests + fix shim
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
describe("chrome.cast.Receiver", () => {
|
||||
describe("chrome.cast.ReceiverDisplayStatus", () => {
|
||||
it("should have all properties", async () => {
|
||||
const receiverDisplayStatus =
|
||||
new chrome.cast.ReceiverDisplayStatus();
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
describe("chrome.cast.SenderApplication", () => {
|
||||
it("should have all properties", async () => {
|
||||
const senderApplication = new chrome.cast.SenderApplication();
|
||||
|
||||
expect(senderApplication.platform).toBe(undefined);
|
||||
expect(senderApplication.url).toBe(null);
|
||||
expect(senderApplication.packageId).toBe(null);
|
||||
});
|
||||
|
||||
it("should have expected assigned properties", async () => {
|
||||
const senderApplication = new chrome.cast.SenderApplication(
|
||||
chrome.cast.SenderPlatform.CHROME);
|
||||
|
||||
expect(senderApplication.platform).toBe("chrome");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
|
||||
describe("chrome.cast.Session", () => {
|
||||
it("should have all properties", async () => {
|
||||
const session = new chrome.cast.Session();
|
||||
|
||||
expect(session.appId).toBe(undefined);
|
||||
expect(session.appImages).toBe(undefined);
|
||||
expect(session.displayName).toBe(undefined);
|
||||
expect(session.media).toEqual([]);
|
||||
expect(session.namespaces).toEqual([]);
|
||||
expect(session.receiver).toBe(undefined);
|
||||
expect(session.senderApps).toEqual([]);
|
||||
expect(session.sessionId).toBe(undefined);
|
||||
expect(session.status).toBe("connected");
|
||||
expect(session.statusText).toBe(null);
|
||||
expect(session.transportId).toBe("");
|
||||
});
|
||||
|
||||
it("should have expected assigned properties", async () => {
|
||||
const session = new chrome.cast.Session(
|
||||
"__sessionId"
|
||||
, "__appId"
|
||||
, "__displayName"
|
||||
, [ new chrome.cast.Image("http://example.com") ]
|
||||
, new chrome.cast.Receiver("__label", "__friendlyName"));
|
||||
|
||||
expect(session.appId).toBe("__appId");
|
||||
expect(session.appImages).toEqual(jasmine.arrayContaining([
|
||||
jasmine.objectContaining({ url: "http://example.com" })
|
||||
]));
|
||||
expect(session.displayName).toBe("__displayName");
|
||||
expect(session.receiver).toEqual(jasmine.any(chrome.cast.Receiver));
|
||||
expect(session.sessionId).toBe("__sessionId");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
describe("chrome.cast.SessionRequest", () => {
|
||||
it("should have all properties", async () => {
|
||||
const sessionRequest = new chrome.cast.SessionRequest();
|
||||
|
||||
expect(sessionRequest.appId).toBe(undefined);
|
||||
expect(sessionRequest.capabilities).toEqual([ "video_out", "audio_out" ]);
|
||||
expect(sessionRequest.dialRequest).toBe(null);
|
||||
expect(sessionRequest.language).toBe(null);
|
||||
expect(sessionRequest.requestSessionTimeout).toBe(60000);
|
||||
});
|
||||
|
||||
it("should have expected assigned properties", async () => {
|
||||
const sessionRequest = new chrome.cast.SessionRequest(
|
||||
"__appId"
|
||||
, [ chrome.cast.Capability.VIDEO_OUT
|
||||
, chrome.cast.Capability.AUDIO_IN ]
|
||||
, 5000);
|
||||
|
||||
expect(sessionRequest.appId).toBe("__appId");
|
||||
expect(sessionRequest.capabilities).toEqual([ "video_out", "audio_in" ]);
|
||||
expect(sessionRequest.requestSessionTimeout).toBe(5000);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
describe("chrome.cast.Timeout", () => {
|
||||
it("should have all properties", async () => {
|
||||
const timeout = new chrome.cast.Timeout();
|
||||
|
||||
expect(timeout.leaveSession).toBe(3000);
|
||||
expect(timeout.requestSession).toBe(60000);
|
||||
expect(timeout.sendCustomMessage).toBe(3000);
|
||||
expect(timeout.setReceiverVolume).toBe(3000);
|
||||
expect(timeout.stopSession).toBe(3000);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
describe("chrome.cast.Volume", () => {
|
||||
it("should have all properties", async () => {
|
||||
const volume = new chrome.cast.Volume();
|
||||
|
||||
expect(volume.level).toBe(null);
|
||||
expect(volume.muted).toBe(null);
|
||||
});
|
||||
|
||||
it("should have expected assigned properties", async () => {
|
||||
const volume = new chrome.cast.Volume(0.5, false);
|
||||
|
||||
expect(volume.level).toBe(0.5);
|
||||
expect(volume.muted).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user