@@ -782,6 +782,48 @@ TEST_F(ProcessBehaviorNodeTest,
782
782
EXPECT_THAT (stack_, ElementsAre (NullNodeValueMatcher ()));
783
783
}
784
784
785
+ TEST_F (ProcessBehaviorNodeTest, SourceNodeTimeSinceInputsFinishedInSeconds) {
786
+ BrushBehavior::SourceNode source_node = {
787
+ .source = BrushBehavior::Source::kTimeSinceInputsFinishedInSeconds ,
788
+ .source_value_range = {0 , 10 },
789
+ };
790
+
791
+ // If `inputs_are_finished` is still `false`, the source node emits a null
792
+ // value.
793
+ input_modeler_state_.total_real_elapsed_time = Duration32::Seconds (3 );
794
+ input_modeler_state_.complete_elapsed_time = Duration32::Seconds (5 );
795
+ input_modeler_state_.inputs_are_finished = false ;
796
+ ProcessBehaviorNode (source_node, context_);
797
+ EXPECT_THAT (stack_, ElementsAre (NullNodeValueMatcher ()));
798
+
799
+ // Once `inputs_are_finished` is `true`, the source node emits its value.
800
+ stack_.clear ();
801
+ input_modeler_state_.inputs_are_finished = true ;
802
+ ProcessBehaviorNode (source_node, context_);
803
+ EXPECT_THAT (stack_, ElementsAre (0 .2f ));
804
+ }
805
+
806
+ TEST_F (ProcessBehaviorNodeTest, SourceNodeTimeSinceInputsFinishedInMillis) {
807
+ BrushBehavior::SourceNode source_node = {
808
+ .source = BrushBehavior::Source::kTimeSinceInputsFinishedInMillis ,
809
+ .source_value_range = {0 , 10000 },
810
+ };
811
+
812
+ // If `inputs_are_finished` is still `false`, the source node emits a null
813
+ // value.
814
+ input_modeler_state_.total_real_elapsed_time = Duration32::Seconds (3 );
815
+ input_modeler_state_.complete_elapsed_time = Duration32::Seconds (5 );
816
+ input_modeler_state_.inputs_are_finished = false ;
817
+ ProcessBehaviorNode (source_node, context_);
818
+ EXPECT_THAT (stack_, ElementsAre (NullNodeValueMatcher ()));
819
+
820
+ // Once `inputs_are_finished` is `true`, the source node emits its value.
821
+ stack_.clear ();
822
+ input_modeler_state_.inputs_are_finished = true ;
823
+ ProcessBehaviorNode (source_node, context_);
824
+ EXPECT_THAT (stack_, ElementsAre (0 .2f ));
825
+ }
826
+
785
827
TEST_F (ProcessBehaviorNodeTest, SourceNodeOutOfRangeClamp) {
786
828
BrushBehavior::SourceNode source_node = {
787
829
.source = BrushBehavior::Source::kNormalizedPressure ,
0 commit comments