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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/long_task_tracker_unittest.cc

Issue 2259013003: Move and rename TaskTimeTracker to public interface exposed to WebThread, use in WebPerf Agent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch TaskTimeTracker over to WebThread::TaskTimeObserver 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: third_party/WebKit/Source/platform/scheduler/base/long_task_tracker_unittest.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/long_task_tracker_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/long_task_tracker_unittest.cc
deleted file mode 100644
index 322d02876e53be253ede9d30336901376b1754f2..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/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 "platform/scheduler/base/long_task_tracker.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace blink {
-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());
-}
-
-} // namespace scheduler
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698