xref: /aosp_15_r20/external/pdfium/core/fxcrt/fake_time_test.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2022 The PDFium Authors
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 "core/fxcrt/fake_time_test.h"
6 
7 #include "core/fxcrt/fx_extension.h"
8 
SetUp()9 void FakeTimeTest::SetUp() {
10   // Arbitrary, picked descending digits, 2020-04-23 15:05:21.
11   FXSYS_SetTimeFunction([]() -> time_t { return 1587654321; });
12   FXSYS_SetLocaltimeFunction([](const time_t* t) { return gmtime(t); });
13 }
14 
TearDown()15 void FakeTimeTest::TearDown() {
16   FXSYS_SetTimeFunction(nullptr);
17   FXSYS_SetLocaltimeFunction(nullptr);
18 }
19