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

Side by Side Diff: third_party/WebKit/Source/web/tests/scheduler/ThrottlingTest.cpp

Issue 2895673002: [scheduler] Add unthrottled-by-blockable task queue to fix touch latency regression. (Closed)
Patch Set: Address comments and disable a failing test Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code if governed by a BSD-style license that can be 2 // Use of this source code if governed by a BSD-style license that can be
3 // found in LICENSE file. 3 // found in LICENSE file.
4 4
5 #include "platform/scheduler/child/web_scheduler.h" 5 #include "platform/scheduler/child/web_scheduler.h"
6 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 6 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
7 #include "platform/testing/UnitTestHelpers.h" 7 #include "platform/testing/UnitTestHelpers.h"
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "public/platform/WebThread.h" 9 #include "public/platform/WebThread.h"
10 #include "public/platform/scheduler/renderer/renderer_scheduler.h" 10 #include "public/platform/scheduler/renderer/renderer_scheduler.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Run delayed tasks for 1 second. All tasks should be completed 61 // Run delayed tasks for 1 second. All tasks should be completed
62 // with throttling disabled. 62 // with throttling disabled.
63 testing::RunDelayedTasks(1000); 63 testing::RunDelayedTasks(1000);
64 64
65 EXPECT_THAT(ConsoleMessages(), ElementsAre("called f", "called f", "called f", 65 EXPECT_THAT(ConsoleMessages(), ElementsAre("called f", "called f", "called f",
66 "called f", "called f")); 66 "called f", "called f"));
67 } 67 }
68 68
69 class BackgroundRendererThrottlingTest : public SimTest {}; 69 class BackgroundRendererThrottlingTest : public SimTest {};
70 70
71 TEST_F(BackgroundRendererThrottlingTest, BackgroundRenderersAreThrottled) { 71 TEST_F(BackgroundRendererThrottlingTest,
72 DISABLED_BackgroundRenderersAreThrottled) {
72 SimRequest main_resource("https://example.com/", "text/html"); 73 SimRequest main_resource("https://example.com/", "text/html");
73 74
74 LoadURL("https://example.com/"); 75 LoadURL("https://example.com/");
75 76
76 main_resource.Complete( 77 main_resource.Complete(
77 "(<script>" 78 "(<script>"
78 " function f(repetitions) {" 79 " function f(repetitions) {"
79 " if (repetitions == 0) return;" 80 " if (repetitions == 0) return;"
80 " console.log('called f');" 81 " console.log('called f');"
81 " setTimeout(f, 10, repetitions - 1);" 82 " setTimeout(f, 10, repetitions - 1);"
82 " }" 83 " }"
83 " setTimeout(f, 10, 3);" 84 " setTimeout(f, 10, 3);"
84 "</script>)"); 85 "</script>)");
85 86
86 Platform::Current() 87 Platform::Current()
87 ->CurrentThread() 88 ->CurrentThread()
88 ->Scheduler() 89 ->Scheduler()
89 ->GetRendererSchedulerForTest() 90 ->GetRendererSchedulerForTest()
90 ->OnRendererBackgrounded(); 91 ->OnRendererBackgrounded();
91 92
92 // Make sure that we run a task once a second. 93 // Make sure that we run a task once a second.
93 for (int i = 0; i < 3; ++i) { 94 for (int i = 0; i < 3; ++i) {
94 testing::RunDelayedTasks(1000); 95 testing::RunDelayedTasks(1000);
95 EXPECT_THAT(ConsoleMessages(), ElementsAre("called f")); 96 EXPECT_THAT(ConsoleMessages(), ElementsAre("called f"));
96 ConsoleMessages().clear(); 97 ConsoleMessages().clear();
97 } 98 }
98 } 99 }
99 100
100 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698