[fixit] Remove TestSyncService::SetTransportState()

Test-only change.
This CL removes SetTransportState() - which sets the transport state
arbitrarily, possibly in an inconsistent manner - and instead exposes
SetMaxTransportState(). This will be the value of GetTransportState()
when there is no auth error (TransportState::PAUSED) nor
disable reason (TransportState::DISABLED).

Fixed: 348605115
Change-Id: I6b2995704eb816150b1237a7aff6d72c7a8fb207
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665303
Reviewed-by: Steven Holte <[email protected]>
Reviewed-by: Marc Treib <[email protected]>
Reviewed-by: Matthew Jones <[email protected]>
Commit-Queue: Victor Vianna <[email protected]>
Code-Coverage: [email protected] <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1321957}
diff --git a/chrome/browser/sharing/sharing_service_unittest.cc b/chrome/browser/sharing/sharing_service_unittest.cc
index 01b0921..5b8602c 100644
--- a/chrome/browser/sharing/sharing_service_unittest.cc
+++ b/chrome/browser/sharing/sharing_service_unittest.cc
@@ -437,7 +437,7 @@
             GetSharingService()->GetStateForTesting());
 
   // Change sync to configuring, which will be ignored.
-  test_sync_service_.SetTransportState(
+  test_sync_service_.SetMaxTransportState(
       syncer::SyncService::TransportState::CONFIGURING);
   test_sync_service_.FireStateChanged();
   EXPECT_EQ(1, sharing_device_registration_->registration_attempts());
@@ -463,6 +463,8 @@
             GetSharingService()->GetStateForTesting());
 
   // Should be able to register once again when sync is back on.
+  test_sync_service_.SetMaxTransportState(
+      syncer::SyncService::TransportState::ACTIVE);
   test_sync_service_.SetSignedInWithSyncFeatureOn();
   EXPECT_CALL(*fcm_handler_, StartListening()).Times(1);
   test_sync_service_.FireStateChanged();
diff --git a/chrome/browser/sharing/sharing_utils_unittest.cc b/chrome/browser/sharing/sharing_utils_unittest.cc
index e99914ac..248be63 100644
--- a/chrome/browser/sharing/sharing_utils_unittest.cc
+++ b/chrome/browser/sharing/sharing_utils_unittest.cc
@@ -86,7 +86,7 @@
 }
 
 TEST_F(SharingUtilsTest, SyncDisabled_Configuring) {
-  test_sync_service_.SetTransportState(
+  test_sync_service_.SetMaxTransportState(
       syncer::SyncService::TransportState::CONFIGURING);
   test_sync_service_.GetUserSettings()->SetSelectedTypes(
       /*sync_everything=*/false,