Commit abb4d368 authored by Joe Mason's avatar Joe Mason Committed by Commit Bot

[PM] Add boundary condition unit tests for V8PerFrameMemoryRequest

Add tests for base::TimeDelta parameters of zero, min, max, and
negative. Fix errors in constructor DCHECK's uncovered by the tests.

Add a gmock InSequence declaration to ExpectBindAndRespondToQuery, which
included two expectations that happened to be in the wrong order. This
makes it usable from inside another InSequence block, and also enforces
the correct order in tests that don't already use InSequence.

R=chrisha

Bug: 1080672
Change-Id: I39ece84cbbeaf23466fd1678bd761f62f54f7d71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422903
Commit-Queue: Joe Mason <joenotcharles@chromium.org>
Reviewed-by: default avatarChris Hamilton <chrisha@chromium.org>
Auto-Submit: Joe Mason <joenotcharles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811912}
parent 6cfefebd
......@@ -473,6 +473,7 @@ V8PerFrameMemoryRequest::V8PerFrameMemoryRequest(
: min_time_between_requests_(min_time_between_requests), mode_(mode) {
#if DCHECK_IS_ON()
DCHECK_GT(min_time_between_requests_, base::TimeDelta());
DCHECK(!min_time_between_requests_.is_inf());
DCHECK(mode != MeasurementMode::kEagerForTesting ||
g_test_eager_measurement_requests_enabled);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment