diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-29 10:46:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-02 12:02:10 +0000 |
commit | 99677208ff3b216fdfec551fbe548da5520cd6fb (patch) | |
tree | 476a4865c10320249360e859d8fdd3e01833b03a /chromium/ui/base/prediction/prediction_unittest_helpers.h | |
parent | c30a6232df03e1efbd9f3b226777b07e087a1122 (diff) | |
download | qtwebengine-chromium-99677208ff3b216fdfec551fbe548da5520cd6fb.tar.gz |
BASELINE: Update Chromium to 86.0.4240.124
Change-Id: Ide0ff151e94cd665ae6521a446995d34a9d1d644
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/base/prediction/prediction_unittest_helpers.h')
-rw-r--r-- | chromium/ui/base/prediction/prediction_unittest_helpers.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/ui/base/prediction/prediction_unittest_helpers.h b/chromium/ui/base/prediction/prediction_unittest_helpers.h new file mode 100644 index 00000000000..3a22cdd55bc --- /dev/null +++ b/chromium/ui/base/prediction/prediction_unittest_helpers.h @@ -0,0 +1,32 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_PREDICTION_PREDICTION_UNITTEST_HELPERS_H_ +#define UI_BASE_PREDICTION_PREDICTION_UNITTEST_HELPERS_H_ + +#include "base/time/time.h" + +namespace ui { +namespace test { + +class PredictionUnittestHelpers { + public: + // Copied from third_party\blink\public\common\input\web_input_event.h + static constexpr base::TimeTicks GetStaticTimeStampForTests() { + // Note: intentionally use a relatively large delta from base::TimeTicks == + // 0. Otherwise, code that tracks the time ticks of the last event that + // happened and computes a delta might get confused when the testing + // timestamp is near 0, as the computed delta may very well be under the + // delta threshold. + // + // TODO(dcheng): This really shouldn't use FromInternalValue(), but + // constexpr support for time operations is a bit busted... + return base::TimeTicks::FromInternalValue(123'000'000); + } +}; + +} // namespace test +} // namespace ui + +#endif // UI_BASE_PREDICTION_PREDICTION_UNITTEST_HELPERS_H_ |