@@ -1680,15 +1680,15 @@ fn test_recorded_context_recorded() -> Result<()> {
16801680 app_version : Some ( "124.0.0" . to_string ( ) ) ,
16811681 ..Default :: default ( )
16821682 } ;
1683- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
1683+ let recorded_context = TestRecordedContext :: new ( ) ;
16841684 recorded_context. set_context ( json ! ( {
16851685 "app_version" : "125.0.0" ,
16861686 "other" : "stuff" ,
16871687 } ) ) ;
16881688 let metrics = TestMetrics :: new ( ) ;
16891689 let client = NimbusClient :: new (
16901690 app_context. clone ( ) ,
1691- Some ( recorded_context) ,
1691+ Some ( recorded_context. clone ( ) ) ,
16921692 Default :: default ( ) ,
16931693 temp_dir. path ( ) ,
16941694 metrics. clone ( ) ,
@@ -1707,7 +1707,7 @@ fn test_recorded_context_recorded() -> Result<()> {
17071707
17081708 let active_experiments = client. get_active_experiments ( ) ?;
17091709 assert_eq ! ( active_experiments. len( ) , 1 ) ;
1710- assert_eq ! ( client . get_recorded_context ( ) . get_record_calls( ) , 1u64 ) ;
1710+ assert_eq ! ( recorded_context . get_record_calls( ) , 1u64 ) ;
17111711 assert_eq ! ( metrics. get_submit_targeting_context_calls( ) , 1u64 ) ;
17121712
17131713 Ok ( ( ) )
@@ -1724,7 +1724,7 @@ fn test_recorded_context_event_queries() -> Result<()> {
17241724 app_version : Some ( "124.0.0" . to_string ( ) ) ,
17251725 ..Default :: default ( )
17261726 } ;
1727- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
1727+ let recorded_context = TestRecordedContext :: new ( ) ;
17281728 recorded_context. set_context ( json ! ( {
17291729 "app_version" : "125.0.0" ,
17301730 "other" : "stuff" ,
@@ -1735,7 +1735,7 @@ fn test_recorded_context_event_queries() -> Result<()> {
17351735 ) ] ) ) ;
17361736 let client = NimbusClient :: new (
17371737 app_context,
1738- Some ( recorded_context) ,
1738+ Some ( recorded_context. clone ( ) ) ,
17391739 Default :: default ( ) ,
17401740 temp_dir. path ( ) ,
17411741 TestMetrics :: new ( ) ,
@@ -1754,16 +1754,13 @@ fn test_recorded_context_event_queries() -> Result<()> {
17541754
17551755 info ! (
17561756 "{}" ,
1757- serde_json:: to_string( & client . get_recorded_context ( ) . get_event_queries( ) ) ?
1757+ serde_json:: to_string( & recorded_context . get_event_queries( ) ) ?
17581758 ) ;
17591759
17601760 let active_experiments = client. get_active_experiments ( ) ?;
1761- assert_eq ! (
1762- client. get_recorded_context( ) . get_event_query_values( ) [ "TEST_QUERY" ] ,
1763- 0.0
1764- ) ;
1761+ assert_eq ! ( recorded_context. get_event_query_values( ) [ "TEST_QUERY" ] , 0.0 ) ;
17651762 assert_eq ! ( active_experiments. len( ) , 1 ) ;
1766- assert_eq ! ( client . get_recorded_context ( ) . get_record_calls( ) , 1u64 ) ;
1763+ assert_eq ! ( recorded_context . get_record_calls( ) , 1u64 ) ;
17671764
17681765 Ok ( ( ) )
17691766}
@@ -1779,7 +1776,6 @@ fn test_gecko_pref_enrollment() -> Result<()> {
17791776 app_version : Some ( "124.0.0" . to_string ( ) ) ,
17801777 ..Default :: default ( )
17811778 } ;
1782- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
17831779
17841780 let pref_state = GeckoPrefState :: new ( "test.pref" , None )
17851781 . with_gecko_value ( PrefValue :: Null )
@@ -1792,7 +1788,7 @@ fn test_gecko_pref_enrollment() -> Result<()> {
17921788
17931789 let client = NimbusClient :: new (
17941790 app_context,
1795- Some ( recorded_context ) ,
1791+ Some ( TestRecordedContext :: new ( ) ) ,
17961792 Default :: default ( ) ,
17971793 temp_dir. path ( ) ,
17981794 TestMetrics :: new ( ) ,
@@ -1853,7 +1849,6 @@ fn test_gecko_pref_unenrollment() -> Result<()> {
18531849 app_version : Some ( "124.0.0" . to_string ( ) ) ,
18541850 ..Default :: default ( )
18551851 } ;
1856- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
18571852
18581853 let pref_state = GeckoPrefState :: new ( "test.pref" , None ) . with_gecko_value ( PrefValue :: Null ) ;
18591854 let handler = TestGeckoPrefHandler :: new ( create_feature_prop_pref_map ( vec ! [ (
@@ -1864,7 +1859,7 @@ fn test_gecko_pref_unenrollment() -> Result<()> {
18641859
18651860 let client = NimbusClient :: new (
18661861 app_context,
1867- Some ( recorded_context ) ,
1862+ Some ( TestRecordedContext :: new ( ) ) ,
18681863 Default :: default ( ) ,
18691864 temp_dir. path ( ) ,
18701865 TestMetrics :: new ( ) ,
@@ -1979,7 +1974,6 @@ fn test_gecko_pref_unenrollment_reverts() -> Result<()> {
19791974 app_version : Some ( "124.0.0" . to_string ( ) ) ,
19801975 ..Default :: default ( )
19811976 } ;
1982- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
19831977
19841978 let pref_state_1 = GeckoPrefState :: new ( "test.pref.1" , None ) . with_gecko_value ( PrefValue :: Null ) ;
19851979 let pref_state_2 = GeckoPrefState :: new ( "test.pref.2" , None ) . with_gecko_value ( PrefValue :: Null ) ;
@@ -1990,7 +1984,7 @@ fn test_gecko_pref_unenrollment_reverts() -> Result<()> {
19901984
19911985 let client = NimbusClient :: new (
19921986 app_context,
1993- Some ( recorded_context ) ,
1987+ Some ( TestRecordedContext :: new ( ) ) ,
19941988 Default :: default ( ) ,
19951989 temp_dir. path ( ) ,
19961990 TestMetrics :: new ( ) ,
@@ -2118,7 +2112,6 @@ fn register_previous_gecko_pref_states() -> Result<()> {
21182112 app_version : Some ( "124.0.0" . to_string ( ) ) ,
21192113 ..Default :: default ( )
21202114 } ;
2121- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
21222115 let pref_state = GeckoPrefState :: new ( "test.pref" , None ) . with_gecko_value ( PrefValue :: Null ) ;
21232116 let handler = TestGeckoPrefHandler :: new ( create_feature_prop_pref_map ( vec ! [ (
21242117 "test_feature" ,
@@ -2127,7 +2120,7 @@ fn register_previous_gecko_pref_states() -> Result<()> {
21272120 ) ] ) ) ;
21282121 let client = NimbusClient :: new (
21292122 app_context. clone ( ) ,
2130- Some ( recorded_context ) ,
2123+ Some ( TestRecordedContext :: new ( ) ) ,
21312124 Default :: default ( ) ,
21322125 temp_dir. path ( ) ,
21332126 metrics. clone ( ) ,
@@ -2315,7 +2308,6 @@ fn test_add_prev_gecko_pref_states_for_experiment() -> Result<()> {
23152308 app_version : Some ( "124.0.0" . to_string ( ) ) ,
23162309 ..Default :: default ( )
23172310 } ;
2318- let recorded_context = Arc :: new ( TestRecordedContext :: new ( ) ) ;
23192311 let pref_state = GeckoPrefState :: new ( "test.pref" , None ) . with_gecko_value ( PrefValue :: Null ) ;
23202312 let handler = TestGeckoPrefHandler :: new ( create_feature_prop_pref_map ( vec ! [ (
23212313 "test_feature" ,
@@ -2324,7 +2316,7 @@ fn test_add_prev_gecko_pref_states_for_experiment() -> Result<()> {
23242316 ) ] ) ) ;
23252317 let client = NimbusClient :: new (
23262318 app_context. clone ( ) ,
2327- Some ( recorded_context ) ,
2319+ Some ( TestRecordedContext :: new ( ) ) ,
23282320 Default :: default ( ) ,
23292321 temp_dir. path ( ) ,
23302322 metrics. clone ( ) ,
0 commit comments