Home | History | Annotate | Download | only in test
      1 /*
      2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_
     12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_
     13 
     14 #include <string>
     15 #include "webrtc/modules/interface/module_common_types.h"
     16 
     17 namespace webrtc {
     18 namespace testing {
     19 namespace bwe {
     20 
     21 class BaseLineFileInterface {
     22  public:
     23   virtual ~BaseLineFileInterface() {}
     24 
     25   // Compare, or log, one estimate against the baseline file.
     26   virtual void Estimate(int64_t time_ms, uint32_t estimate_bps) = 0;
     27 
     28   // Verify whether there are any differences between the logged estimates and
     29   // those read from the baseline file. If updating the baseline file, write out
     30   // new file if there were differences. Return true if logged estimates are
     31   // identical, or if output file was updated successfully.
     32   virtual bool VerifyOrWrite() = 0;
     33 
     34   // Create an instance for either verifying estimates against a baseline file
     35   // with name |filename|, living in the resources/ directory or, if the flag
     36   // |write_updated_file| is set, write logged estimates to a file with the same
     37   // name, living in the out/ directory.
     38   static BaseLineFileInterface* Create(const std::string& filename,
     39                                        bool write_updated_file);
     40 };
     41 }  // namespace bwe
     42 }  // namespace testing
     43 }  // namespace webrtc
     44 
     45 #endif  // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_BASELINEFILE_H_
     46