+
-
diff --git a/browser/components/loop/test/shared/views_test.js b/browser/components/loop/test/shared/views_test.js
index d0b2952bca26..2222e3d533f1 100644
--- a/browser/components/loop/test/shared/views_test.js
+++ b/browser/components/loop/test/shared/views_test.js
@@ -253,7 +253,7 @@ describe("loop.shared.views", function() {
});
describe("ConversationToolbar", function() {
- var hangup, publishStream;
+ var clock, hangup, publishStream;
function mountTestComponent(props) {
props = _.extend({
@@ -266,6 +266,47 @@ describe("loop.shared.views", function() {
beforeEach(function() {
hangup = sandbox.stub();
publishStream = sandbox.stub();
+ clock = sinon.useFakeTimers();
+ });
+
+ afterEach(function() {
+ clock.restore();
+ });
+
+ it("should start no idle", function() {
+ var comp = mountTestComponent({
+ hangupButtonLabel: "foo",
+ hangup: hangup,
+ publishStream: publishStream
+ });
+ expect(comp.getDOMNode().classList.contains("idle")).eql(false);
+ });
+
+ it("should be on idle state after 6 seconds", function() {
+ var comp = mountTestComponent({
+ hangupButtonLabel: "foo",
+ hangup: hangup,
+ publishStream: publishStream
+ });
+ expect(comp.getDOMNode().classList.contains("idle")).eql(false);
+
+ clock.tick(6001);
+ expect(comp.getDOMNode().classList.contains("idle")).eql(true);
+ });
+
+ it("should remove idle state when the user moves the mouse", function() {
+ var comp = mountTestComponent({
+ hangupButtonLabel: "foo",
+ hangup: hangup,
+ publishStream: publishStream
+ });
+
+ clock.tick(6001);
+ expect(comp.getDOMNode().classList.contains("idle")).eql(true);
+
+ document.body.dispatchEvent(new CustomEvent("mousemove"));
+
+ expect(comp.getDOMNode().classList.contains("idle")).eql(false);
});
it("should accept a hangupButtonLabel optional prop", function() {
diff --git a/browser/components/loop/ui/ui-showcase.js b/browser/components/loop/ui/ui-showcase.js
index b20439498265..927ac94e805a 100644
--- a/browser/components/loop/ui/ui-showcase.js
+++ b/browser/components/loop/ui/ui-showcase.js
@@ -518,7 +518,7 @@
"dropdown-white", "dropdown-active", "dropdown-disabled", "edit",
"edit-active", "edit-disabled", "edit-white", "expand", "expand-active",
"expand-disabled", "minimize", "minimize-active", "minimize-disabled",
- "settings-cog"
+ "settings-cog-grey", "settings-cog-white"
],
"14x14": ["audio", "audio-active", "audio-disabled", "facemute",
"facemute-active", "facemute-disabled", "hangup", "hangup-active",
@@ -928,76 +928,38 @@
),
React.createElement(Section, {name: "ConversationToolbar"},
- React.createElement("h2", null, "Desktop Conversation Window"),
React.createElement("div", null,
React.createElement(FramedExample, {dashed: true,
- height: 26,
+ height: 56,
summary: "Default",
width: 300},
React.createElement("div", {className: "fx-embedded"},
- React.createElement(ConversationToolbar, {audio: {enabled: true},
+ React.createElement(ConversationToolbar, {audio: { enabled: true, visible: true},
hangup: noop,
publishStream: noop,
- video: {enabled: true}})
+ video: { enabled: true, visible: true}})
)
),
React.createElement(FramedExample, {dashed: true,
- height: 26,
+ height: 56,
summary: "Video muted",
width: 300},
React.createElement("div", {className: "fx-embedded"},
- React.createElement(ConversationToolbar, {audio: {enabled: true},
+ React.createElement(ConversationToolbar, {audio: { enabled: true, visible: true},
hangup: noop,
publishStream: noop,
- video: {enabled: false}})
+ video: { enabled: false, visible: true}})
)
),
React.createElement(FramedExample, {dashed: true,
- height: 26,
+ height: 56,
summary: "Audio muted",
width: 300},
React.createElement("div", {className: "fx-embedded"},
- React.createElement(ConversationToolbar, {audio: {enabled: false},
+ React.createElement(ConversationToolbar, {audio: { enabled: false, visible: true},
hangup: noop,
publishStream: noop,
- video: {enabled: true}})
- )
- )
- ),
-
- React.createElement("h2", null, "Standalone"),
- React.createElement("div", {className: "standalone override-position"},
- React.createElement(FramedExample, {dashed: true,
- height: 26,
- summary: "Default",
- width: 300},
- React.createElement("div", {className: "fx-embedded"},
- React.createElement(ConversationToolbar, {audio: {enabled: true},
- hangup: noop,
- publishStream: noop,
- video: {enabled: true}})
- )
- ),
- React.createElement(FramedExample, {dashed: true,
- height: 26,
- summary: "Video muted",
- width: 300},
- React.createElement("div", {className: "fx-embedded"},
- React.createElement(ConversationToolbar, {audio: {enabled: true},
- hangup: noop,
- publishStream: noop,
- video: {enabled: false}})
- )
- ),
- React.createElement(FramedExample, {dashed: true,
- height: 26,
- summary: "Audio muted",
- width: 300},
- React.createElement("div", {className: "fx-embedded"},
- React.createElement(ConversationToolbar, {audio: {enabled: false},
- hangup: noop,
- publishStream: noop,
- video: {enabled: true}})
+ video: { enabled: true, visible: true}})
)
)
)
@@ -1057,14 +1019,14 @@
width: 298},
React.createElement("div", {className: "fx-embedded"},
React.createElement(OngoingConversationView, {
- audio: {enabled: true},
+ audio: { enabled: true, visible: true},
conversationStore: conversationStores[0],
dispatcher: dispatcher,
localPosterUrl: "sample-img/video-screen-local.png",
mediaConnected: true,
remotePosterUrl: "sample-img/video-screen-remote.png",
remoteVideoEnabled: true,
- video: {enabled: true}})
+ video: { enabled: true, visible: true}})
)
),
@@ -1075,14 +1037,14 @@
width: 600},
React.createElement("div", {className: "fx-embedded"},
React.createElement(OngoingConversationView, {
- audio: {enabled: true},
+ audio: { enabled: true, visible: true},
conversationStore: conversationStores[1],
dispatcher: dispatcher,
localPosterUrl: "sample-img/video-screen-local.png",
mediaConnected: true,
remotePosterUrl: "sample-img/video-screen-remote.png",
remoteVideoEnabled: true,
- video: {enabled: true}})
+ video: { enabled: true, visible: true}})
)
),
@@ -1092,14 +1054,14 @@
width: 800},
React.createElement("div", {className: "fx-embedded"},
React.createElement(OngoingConversationView, {
- audio: {enabled: true},
+ audio: { enabled: true, visible: true},
conversationStore: conversationStores[2],
dispatcher: dispatcher,
localPosterUrl: "sample-img/video-screen-local.png",
mediaConnected: true,
remotePosterUrl: "sample-img/video-screen-remote.png",
remoteVideoEnabled: true,
- video: {enabled: true}})
+ video: { enabled: true, visible: true}})
)
),
@@ -1110,14 +1072,14 @@
width: 298},
React.createElement("div", {className: "fx-embedded"},
React.createElement(OngoingConversationView, {
- audio: {enabled: true},
+ audio: { enabled: true, visible: true},
conversationStore: conversationStores[3],
dispatcher: dispatcher,
localPosterUrl: "sample-img/video-screen-local.png",
mediaConnected: true,
remotePosterUrl: "sample-img/video-screen-remote.png",
remoteVideoEnabled: true,
- video: {enabled: false}})
+ video: { enabled: true, visible: true}})
)
),
@@ -1128,14 +1090,14 @@
width: 298},
React.createElement("div", {className: "fx-embedded"},
React.createElement(OngoingConversationView, {
- audio: {enabled: true},
+ audio: { enabled: true, visible: true},
conversationStore: conversationStores[4],
dispatcher: dispatcher,
localPosterUrl: "sample-img/video-screen-local.png",
mediaConnected: true,
remotePosterUrl: "sample-img/video-screen-remote.png",
remoteVideoEnabled: false,
- video: {enabled: true}})
+ video: { enabled: true, visible: true}})
)
)
@@ -1628,7 +1590,7 @@
// This simulates the mocha layout for errors which means we can run
// this alongside our other unit tests but use the same harness.
- var expectedWarningsCount = 16;
+ var expectedWarningsCount = 10;
var warningsMismatch = caughtWarnings.length !== expectedWarningsCount;
if (uncaughtError || warningsMismatch) {
$("#results").append("
" +
diff --git a/browser/components/loop/ui/ui-showcase.jsx b/browser/components/loop/ui/ui-showcase.jsx
index 35d30251ab37..993f9c072ee3 100644
--- a/browser/components/loop/ui/ui-showcase.jsx
+++ b/browser/components/loop/ui/ui-showcase.jsx
@@ -518,7 +518,7 @@
"dropdown-white", "dropdown-active", "dropdown-disabled", "edit",
"edit-active", "edit-disabled", "edit-white", "expand", "expand-active",
"expand-disabled", "minimize", "minimize-active", "minimize-disabled",
- "settings-cog"
+ "settings-cog-grey", "settings-cog-white"
],
"14x14": ["audio", "audio-active", "audio-disabled", "facemute",
"facemute-active", "facemute-disabled", "hangup", "hangup-active",
@@ -928,76 +928,38 @@
- Desktop Conversation Window
-
+ video={{ enabled: true, visible: true }} />
-
+ video={{ enabled: false, visible: true }} />
-
-
-
-
-
- Standalone
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ video={{ enabled: true, visible: true }} />
@@ -1057,14 +1019,14 @@
width={298}>
+ video={{ enabled: true, visible: true }} />
@@ -1075,14 +1037,14 @@
width={600}>
+ video={{ enabled: true, visible: true }} />
@@ -1092,14 +1054,14 @@
width={800}>
+ video={{ enabled: true, visible: true }} />
@@ -1110,14 +1072,14 @@
width={298}>
+ video={{ enabled: true, visible: true }} />
@@ -1128,14 +1090,14 @@
width={298} >
+ video={{ enabled: true, visible: true }} />
@@ -1628,7 +1590,7 @@
// This simulates the mocha layout for errors which means we can run
// this alongside our other unit tests but use the same harness.
- var expectedWarningsCount = 16;
+ var expectedWarningsCount = 10;
var warningsMismatch = caughtWarnings.length !== expectedWarningsCount;
if (uncaughtError || warningsMismatch) {
$("#results").append("" +