/// <summary>
 /// If supported by any attached test service, this publishes the final
 /// test results. Typical harness implementations may immediately close
 /// the web browser channel upon receiving the message, so any other
 /// reporting should be done first.
 /// </summary>
 protected void PublishFinalResult()
 {
     // Final publish on the test service
     if (TestService != null && TestService.HasService(TestServiceFeature.TestReporting))
     {
         TestReportingProvider trp = TestService.GetService <TestReportingProvider>(TestServiceFeature.TestReporting);
         if (trp != null)
         {
             int failures = State.Failures;
             int total    = State.TotalScenarios;
             trp.ReportFinalResult(null, State.Failed, failures, total, "" /* message is not supported right now */);
         }
     }
 }