@@ -3,7 +3,7 @@ use re_log_types::{EntityPath, TimePoint, Timeline};
3
3
use re_test_context:: { TestContext , external:: egui_kittest:: SnapshotOptions } ;
4
4
use re_test_viewport:: TestContextExt as _;
5
5
use re_view_time_series:: TimeSeriesView ;
6
- use re_viewer_context:: { BlueprintContext as _, ViewClass as _, ViewId } ;
6
+ use re_viewer_context:: { BlueprintContext as _, TimeBlueprintExt as _ , ViewClass as _, ViewId } ;
7
7
use re_viewport_blueprint:: { ViewBlueprint , ViewContents } ;
8
8
9
9
fn color_gradient0 ( step : i64 ) -> re_types:: components:: Color {
@@ -24,6 +24,8 @@ pub fn test_clear_series_points_and_line() {
24
24
fn test_clear_series_points_and_line_impl ( two_series_per_entity : bool ) {
25
25
let mut test_context = TestContext :: new_with_view_class :: < TimeSeriesView > ( ) ;
26
26
27
+ let timeline = Timeline :: log_tick ( ) ;
28
+
27
29
// TODO(#10512): Potentially fix up this after we have "markers".
28
30
// There are some intricacies involved with this test. `SeriesLines` and
29
31
// `SeriesPoints` can both be logged without any associated data (all
@@ -50,7 +52,7 @@ fn test_clear_series_points_and_line_impl(two_series_per_entity: bool) {
50
52
} ) ;
51
53
52
54
for i in 0 ..32 {
53
- let timepoint = TimePoint :: from ( [ ( test_context . active_timeline ( ) , i) ] ) ;
55
+ let timepoint = TimePoint :: from ( [ ( timeline , i) ] ) ;
54
56
55
57
match i {
56
58
15 => {
@@ -85,6 +87,10 @@ fn test_clear_series_points_and_line_impl(two_series_per_entity: bool) {
85
87
}
86
88
}
87
89
90
+ test_context. with_blueprint_ctx ( |ctx| {
91
+ ctx. set_timeline ( * timeline. name ( ) ) ;
92
+ } ) ;
93
+
88
94
let allowed_broken_pixels = if two_series_per_entity { 5 } else { 2 } ;
89
95
let view_id = setup_blueprint ( & mut test_context) ;
90
96
test_context. run_view_ui_and_save_snapshot (
@@ -136,6 +142,8 @@ fn test_line_properties() {
136
142
fn test_line_properties_impl ( multiple_properties : bool , multiple_scalars : bool ) {
137
143
let mut test_context = TestContext :: new_with_view_class :: < TimeSeriesView > ( ) ;
138
144
145
+ let timeline = Timeline :: log_tick ( ) ;
146
+
139
147
let properties_static = if multiple_properties {
140
148
re_types:: archetypes:: SeriesLines :: new ( )
141
149
. with_widths ( [ 4.0 , 8.0 ] )
@@ -155,7 +163,7 @@ fn test_line_properties_impl(multiple_properties: bool, multiple_scalars: bool)
155
163
} ) ;
156
164
157
165
for step in 0 ..32 {
158
- let timepoint = TimePoint :: from ( [ ( test_context . active_timeline ( ) , step) ] ) ;
166
+ let timepoint = TimePoint :: from ( [ ( timeline , step) ] ) ;
159
167
160
168
let properties = if multiple_properties {
161
169
re_types:: archetypes:: SeriesLines :: new ( )
@@ -181,6 +189,10 @@ fn test_line_properties_impl(multiple_properties: bool, multiple_scalars: bool)
181
189
} ) ;
182
190
}
183
191
192
+ test_context. with_blueprint_ctx ( |ctx| {
193
+ ctx. set_timeline ( * timeline. name ( ) ) ;
194
+ } ) ;
195
+
184
196
let view_id = setup_blueprint ( & mut test_context) ;
185
197
let mut name = "line_properties" . to_owned ( ) ;
186
198
if multiple_properties {
@@ -208,6 +220,8 @@ fn test_per_series_visibility() {
208
220
] {
209
221
let mut test_context = TestContext :: new_with_view_class :: < TimeSeriesView > ( ) ;
210
222
223
+ let timeline = Timeline :: log_tick ( ) ;
224
+
211
225
test_context. log_entity ( "plots" , |builder| {
212
226
builder. with_archetype (
213
227
RowId :: new ( ) ,
@@ -217,13 +231,17 @@ fn test_per_series_visibility() {
217
231
} ) ;
218
232
219
233
for step in 0 ..32 {
220
- let timepoint = TimePoint :: from ( [ ( test_context . active_timeline ( ) , step) ] ) ;
234
+ let timepoint = TimePoint :: from ( [ ( timeline , step) ] ) ;
221
235
let ( scalars, _) = scalars_for_properties_test ( step, true ) ;
222
236
test_context. log_entity ( "plots" , |builder| {
223
237
builder. with_archetype ( RowId :: new ( ) , timepoint. clone ( ) , & scalars)
224
238
} ) ;
225
239
}
226
240
241
+ test_context. with_blueprint_ctx ( |ctx| {
242
+ ctx. set_timeline ( * timeline. name ( ) ) ;
243
+ } ) ;
244
+
227
245
let view_id = setup_blueprint ( & mut test_context) ;
228
246
test_context. run_view_ui_and_save_snapshot ( view_id, name, egui:: vec2 ( 300.0 , 300.0 ) , None ) ;
229
247
}
@@ -253,6 +271,8 @@ fn test_point_properties() {
253
271
fn test_point_properties_impl ( multiple_properties : bool , multiple_scalars : bool ) {
254
272
let mut test_context = TestContext :: new_with_view_class :: < TimeSeriesView > ( ) ;
255
273
274
+ let timeline = Timeline :: log_tick ( ) ;
275
+
256
276
let static_props = if multiple_properties {
257
277
re_types:: archetypes:: SeriesPoints :: new ( )
258
278
. with_marker_sizes ( [ 4.0 , 8.0 ] )
@@ -278,7 +298,7 @@ fn test_point_properties_impl(multiple_properties: bool, multiple_scalars: bool)
278
298
} ) ;
279
299
280
300
for step in 0 ..32 {
281
- let timepoint = TimePoint :: from ( [ ( test_context . active_timeline ( ) , step) ] ) ;
301
+ let timepoint = TimePoint :: from ( [ ( timeline , step) ] ) ;
282
302
283
303
let properties = if multiple_properties {
284
304
re_types:: archetypes:: SeriesPoints :: new ( )
@@ -308,6 +328,10 @@ fn test_point_properties_impl(multiple_properties: bool, multiple_scalars: bool)
308
328
} ) ;
309
329
}
310
330
331
+ test_context. with_blueprint_ctx ( |ctx| {
332
+ ctx. set_timeline ( * timeline. name ( ) ) ;
333
+ } ) ;
334
+
311
335
let view_id = setup_blueprint ( & mut test_context) ;
312
336
let mut name = "point_properties" . to_owned ( ) ;
313
337
if multiple_properties {
@@ -399,6 +423,10 @@ fn test_bootstrapped_secondaries_impl(partial_range: bool) {
399
423
blueprint. add_view_at_root ( view)
400
424
} ) ;
401
425
426
+ test_context. with_blueprint_ctx ( |ctx| {
427
+ ctx. set_timeline ( * Timeline :: log_tick ( ) . name ( ) ) ;
428
+ } ) ;
429
+
402
430
let name = if partial_range {
403
431
"bootstrapped_secondaries_partial"
404
432
} else {
0 commit comments