Flutter Engine
The Flutter Engine
time_point_unittest.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/fml/time/chrono_timestamp_provider.h"
6
7#include "flutter/runtime/dart_timestamp_provider.h"
8
9#include <thread>
10
11#include "gtest/gtest.h"
12
13namespace fml {
14namespace {
15
16TEST(TimePoint, Control) {
19}
20
21TEST(TimePoint, DartClockIsMonotonic) {
22 using namespace std::chrono_literals;
24 std::this_thread::sleep_for(1us);
26 std::this_thread::sleep_for(1us);
28 EXPECT_LT(TimePoint::Min(), t1);
29 EXPECT_LE(t1, t2);
30 EXPECT_LE(t2, t3);
31 EXPECT_LT(t3, TimePoint::Max());
32}
33
34} // namespace
35} // namespace fml
static constexpr TimePoint Max()
Definition: time_point.h:39
static constexpr TimePoint Min()
Definition: time_point.h:35
struct MyStruct s
fml::TimePoint DartTimelineTicksSinceEpoch()
Definition: ascii_trie.cc:9
fml::TimePoint ChronoTicksSinceEpoch()
TEST(MallocMapping, EmptyContructor)
std::chrono::time_point< std::chrono::high_resolution_clock > TimePoint
Definition: timing.h:15