OLD | NEW |
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 "core/testing/sim/SimRequest.h" | 5 #include "core/testing/sim/SimRequest.h" |
6 #include "core/testing/sim/SimTest.h" | 6 #include "core/testing/sim/SimTest.h" |
7 #include "platform/scheduler/child/web_scheduler.h" | 7 #include "platform/scheduler/child/web_scheduler.h" |
8 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" | 8 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" |
9 #include "platform/testing/UnitTestHelpers.h" | 9 #include "platform/testing/UnitTestHelpers.h" |
10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
11 #include "public/platform/WebThread.h" | 11 #include "public/platform/WebThread.h" |
12 #include "public/platform/scheduler/renderer/renderer_scheduler.h" | 12 #include "public/platform/scheduler/renderer/renderer_scheduler.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 using testing::ElementsAre; | 15 using ::testing::ElementsAre; |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class DisableBackgroundThrottlingIsRespectedTest : public SimTest { | 19 class DisableBackgroundThrottlingIsRespectedTest : public SimTest { |
20 public: | 20 public: |
21 void SetUp() override { | 21 void SetUp() override { |
22 background_tab_timer_throttling_feature_ = | 22 background_tab_timer_throttling_feature_ = |
23 WTF::MakeUnique<ScopedBackgroundTabTimerThrottlingForTest>(false); | 23 WTF::MakeUnique<ScopedBackgroundTabTimerThrottlingForTest>(false); |
24 SimTest::SetUp(); | 24 SimTest::SetUp(); |
25 } | 25 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Make sure that we run a task once a second. | 93 // Make sure that we run a task once a second. |
94 for (int i = 0; i < 3; ++i) { | 94 for (int i = 0; i < 3; ++i) { |
95 testing::RunDelayedTasks(1000); | 95 testing::RunDelayedTasks(1000); |
96 EXPECT_THAT(ConsoleMessages(), ElementsAre("called f")); | 96 EXPECT_THAT(ConsoleMessages(), ElementsAre("called f")); |
97 ConsoleMessages().clear(); | 97 ConsoleMessages().clear(); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
OLD | NEW |