Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Unified Diff: components/scheduler/base/long_task_tracker_unittest.cc

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/scheduler/base/long_task_tracker_unittest.cc
diff --git a/components/scheduler/base/long_task_tracker_unittest.cc b/components/scheduler/base/long_task_tracker_unittest.cc
deleted file mode 100644
index 8d11c9b46480a4b9b2713bc423537b1d68deec19..0000000000000000000000000000000000000000
--- a/components/scheduler/base/long_task_tracker_unittest.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2016 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.
-
-#include "components/scheduler/base/long_task_tracker.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace scheduler {
-
-class LongTaskTrackerTest : public ::testing::Test {
- protected:
- LongTaskTracker long_task_tracker_;
-
- size_t NumLongTasks() {
- return long_task_tracker_.long_task_times_.size();
- }
-};
-
-TEST_F(LongTaskTrackerTest, RecordAndReport) {
- EXPECT_EQ(0U, NumLongTasks());
-
- // Add long tasks above 50ms threshold
- long_task_tracker_.RecordLongTask(
- base::TimeTicks() + base::TimeDelta::FromMilliseconds(4500),
- base::TimeDelta::FromMilliseconds(51));
- EXPECT_EQ(1U, NumLongTasks());
-
- long_task_tracker_.RecordLongTask(
- base::TimeTicks() + base::TimeDelta::FromMilliseconds(5500),
- base::TimeDelta::FromMilliseconds(75));
- EXPECT_EQ(2U, NumLongTasks());
-
- // Add task below 50ms threshold
- long_task_tracker_.RecordLongTask(
- base::TimeTicks() + base::TimeDelta::FromMilliseconds(6500),
- base::TimeDelta::FromMilliseconds(49));
- EXPECT_EQ(2U, NumLongTasks());
-
- LongTaskTracker::LongTaskTiming long_task_times =
- long_task_tracker_.GetLongTaskTiming();
- // GetLongTaskTiming clears the internal vector
- EXPECT_EQ(0U, NumLongTasks());
- // Validate recorded contents
- EXPECT_EQ(2U, long_task_times.size());
- EXPECT_EQ(base::TimeTicks() + base::TimeDelta::FromMilliseconds(4500),
- long_task_times[0].first);
- EXPECT_EQ(51, long_task_times[0].second.InMilliseconds());
- EXPECT_EQ(base::TimeTicks() + base::TimeDelta::FromMilliseconds(5500),
- long_task_times[1].first);
- EXPECT_EQ(75, long_task_times[1].second.InMilliseconds());
-}
-
-}
« no previous file with comments | « components/scheduler/base/long_task_tracker.cc ('k') | components/scheduler/base/pollable_thread_safe_flag.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698