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

Unified Diff: third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl_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: third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl_unittest.cc
diff --git a/components/scheduler/child/worker_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl_unittest.cc
similarity index 95%
rename from components/scheduler/child/worker_scheduler_impl_unittest.cc
rename to third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl_unittest.cc
index c5ff4a6253e1924854dac05190a7bf6da6815374..1214e6c836639bbfe542fcf68f1661ce18786676 100644
--- a/components/scheduler/child/worker_scheduler_impl_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/scheduler/child/worker_scheduler_impl.h"
+#include "platform/scheduler/child/worker_scheduler_impl.h"
#include "base/callback.h"
#include "base/macros.h"
@@ -10,18 +10,18 @@
#include "base/strings/stringprintf.h"
#include "base/test/simple_test_tick_clock.h"
#include "cc/test/ordered_simple_task_runner.h"
-#include "components/scheduler/base/test_time_source.h"
-#include "components/scheduler/child/scheduler_tqm_delegate_for_test.h"
+#include "platform/scheduler/base/test_time_source.h"
+#include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using testing::ElementsAreArray;
+namespace blink {
namespace scheduler {
namespace {
-void NopTask() {
-}
+void NopTask() {}
int TimeTicksToIntMs(const base::TimeTicks& time) {
return static_cast<int>((time - base::TimeTicks()).InMilliseconds());
@@ -278,8 +278,7 @@ TEST_F(WorkerSchedulerImplTest, TestIdleDeadlineWithPendingDelayedTask) {
RunUntilIdle();
std::string expected_timeline[] = {
- "CanEnterLongIdlePeriod @ 5",
- "Post delayed and idle tasks",
+ "CanEnterLongIdlePeriod @ 5", "Post delayed and idle tasks",
"CanEnterLongIdlePeriod @ 5",
"run TimelineIdleTestTask deadline 25", // Note the short 20ms deadline.
"run RecordTimelineTask @ 25"};
@@ -305,8 +304,7 @@ TEST_F(WorkerSchedulerImplTest,
RunUntilIdle();
std::string expected_timeline[] = {
- "CanEnterLongIdlePeriod @ 5",
- "Post delayed and idle tasks",
+ "CanEnterLongIdlePeriod @ 5", "Post delayed and idle tasks",
"CanEnterLongIdlePeriod @ 5",
"run TimelineIdleTestTask deadline 55", // Note the full 50ms deadline.
"run RecordTimelineTask @ 505"};
@@ -366,20 +364,17 @@ TEST_F(WorkerSchedulerImplTest, TestLongIdlePeriodTimeline) {
RunUntilIdle();
std::string expected_timeline[] = {
- "RunUntilIdle begin @ 55",
- "RunUntilIdle end @ 55",
+ "RunUntilIdle begin @ 55", "RunUntilIdle end @ 55",
"PostIdleTaskAfterWakeup",
"RunUntilIdle begin @ 55", // NOTE idle task doesn't run till later.
- "RunUntilIdle end @ 55",
- "Post RecordTimelineTask",
- "RunUntilIdle begin @ 55",
- "run RecordTimelineTask @ 55",
+ "RunUntilIdle end @ 55", "Post RecordTimelineTask",
+ "RunUntilIdle begin @ 55", "run RecordTimelineTask @ 55",
"IsNotQuiescent @ 55", // NOTE we have to wait for quiescence.
- "CanEnterLongIdlePeriod @ 355",
- "run TimelineIdleTestTask deadline 405",
+ "CanEnterLongIdlePeriod @ 355", "run TimelineIdleTestTask deadline 405",
"RunUntilIdle end @ 355"};
EXPECT_THAT(timeline, ElementsAreArray(expected_timeline));
}
} // namespace scheduler
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698