chromium/third_party/blink/renderer/core/scheduler/dom_timer_test.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/scheduler/dom_timer.h"

#include "base/test/scoped_command_line.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/renderer/bindings/core/v8/idl_types.h"
#include "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h"
#include "third_party/blink/renderer/bindings/core/v8/script_evaluation_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/timing/dom_window_performance.h"

DoubleNear;
ElementsAreArray;
Matcher;

namespace blink {

namespace {

// The resolution of performance.now is 5us, so the threshold for time
// comparison is 6us to account for rounding errors.
const double kThreshold =;

class DOMTimerTest : public RenderingTest {};

const char* const kSetTimeout0ScriptText =;

TEST_F(DOMTimerTest, setTimeout_ZeroIsNotClampedToOne) {}

TEST_F(DOMTimerTest, setTimeout_ZeroIsClampedToOne) {}

const char* const kSetTimeoutNestedScriptText =;

TEST_F(DOMTimerTest, setTimeout_ClampsAfter4Nestings) {}

const char* const kSetIntervalScriptText =;

TEST_F(DOMTimerTest, setInterval_ClampsAfter4Iterations) {}

TEST_F(DOMTimerTest, setInterval_NestingResetsForLaterCalls) {}

}  // namespace

}  // namespace blink