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

Side by Side Diff: third_party/WebKit/Source/platform/TimerTest.cpp

Issue 1962053002: Allow expensive task blocking if there is pending iframe navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use an enum Created 4 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/Timer.h" 5 #include "platform/Timer.h"
6 6
7 #include "platform/testing/TestingPlatformSupport.h" 7 #include "platform/testing/TestingPlatformSupport.h"
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "public/platform/WebScheduler.h" 9 #include "public/platform/WebScheduler.h"
10 #include "public/platform/WebThread.h" 10 #include "public/platform/WebThread.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 double nextTimerTaskDelaySecs() const 182 double nextTimerTaskDelaySecs() const
183 { 183 {
184 ASSERT(hasOneTimerTask()); 184 ASSERT(hasOneTimerTask());
185 return m_timerTasks.top().delaySeconds(); 185 return m_timerTasks.top().delaySeconds();
186 } 186 }
187 187
188 void shutdown() override {} 188 void shutdown() override {}
189 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov erride { return nullptr; } 189 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov erride { return nullptr; }
190 void suspendTimerQueue() override { } 190 void suspendTimerQueue() override { }
191 void resumeTimerQueue() override { } 191 void resumeTimerQueue() override { }
192 void addPendingNavigation() override { } 192 void addPendingNavigation(WebScheduler::NavigatingFrameType) override { }
193 void removePendingNavigation() override { } 193 void removePendingNavigation(WebScheduler::NavigatingFrameType) override { }
194 void onNavigationStarted() override { } 194 void onNavigationStarted() override { }
195 195
196 private: 196 private:
197 std::priority_queue<DelayedTask> m_timerTasks; 197 std::priority_queue<DelayedTask> m_timerTasks;
198 MockWebTaskRunner m_timerWebTaskRunner; 198 MockWebTaskRunner m_timerWebTaskRunner;
199 }; 199 };
200 200
201 class FakeWebThread : public WebThread { 201 class FakeWebThread : public WebThread {
202 public: 202 public:
203 FakeWebThread() : m_webScheduler(adoptPtr(new MockWebScheduler())) { } 203 FakeWebThread() : m_webScheduler(adoptPtr(new MockWebScheduler())) { }
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); 761 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner);
762 timer.startOneShot(0, BLINK_FROM_HERE); 762 timer.startOneShot(0, BLINK_FROM_HERE);
763 763
764 // Make sure the task was posted on taskRunner. 764 // Make sure the task was posted on taskRunner.
765 EXPECT_FALSE(timerTasks.empty()); 765 EXPECT_FALSE(timerTasks.empty());
766 } 766 }
767 767
768 768
769 } // namespace 769 } // namespace
770 } // namespace blink 770 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698