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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp

Issue 1402933002: Revert "Post loading tasks on the appropriate WebFrameScheduler's queue." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 2 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 "config.h" 5 #include "config.h"
6 #include "core/dom/ScriptRunner.h" 6 #include "core/dom/ScriptRunner.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/ScriptLoader.h" 10 #include "core/dom/ScriptLoader.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 private: 66 private:
67 WebScheduler* m_webScheduler; 67 WebScheduler* m_webScheduler;
68 }; 68 };
69 69
70 class MockWebTaskRunner : public WebTaskRunner { 70 class MockWebTaskRunner : public WebTaskRunner {
71 public: 71 public:
72 explicit MockWebTaskRunner(Deque<OwnPtr<WebTaskRunner::Task>>* tasks) : m_ta sks(tasks) { } 72 explicit MockWebTaskRunner(Deque<OwnPtr<WebTaskRunner::Task>>* tasks) : m_ta sks(tasks) { }
73 ~MockWebTaskRunner() override { } 73 ~MockWebTaskRunner() override { }
74 74
75 void postTask(const WebTraceLocation&, Task* task) override 75 virtual void postTask(const WebTraceLocation&, Task* task)
76 { 76 {
77 m_tasks->append(adoptPtr(task)); 77 m_tasks->append(adoptPtr(task));
78 } 78 }
79 79
80 void postDelayedTask(const WebTraceLocation&, Task* task, double delayMs) ov erride 80 void postDelayedTask(const WebTraceLocation&, Task* task, double delayMs) ov erride
81 { 81 {
82 ASSERT_NOT_REACHED(); 82 ASSERT_NOT_REACHED();
83 } 83 }
84 84
85 WebTaskRunner* clone() override
86 {
87 ASSERT_NOT_REACHED();
88 return nullptr;
89 }
90
91 Deque<OwnPtr<WebTaskRunner::Task>>* m_tasks; // NOT OWNED 85 Deque<OwnPtr<WebTaskRunner::Task>>* m_tasks; // NOT OWNED
92 }; 86 };
93 87
94 class MockPlatform : public Platform, private WebScheduler { 88 class MockPlatform : public Platform, private WebScheduler {
95 public: 89 public:
96 MockPlatform() 90 MockPlatform()
97 : m_mockWebThread(this) 91 : m_mockWebThread(this)
98 , m_mockWebTaskRunner(&m_tasks) 92 , m_mockWebTaskRunner(&m_tasks)
99 , m_shouldYield(false) 93 , m_shouldYield(false)
100 , m_shouldYieldEveryOtherTime(false) { } 94 , m_shouldYieldEveryOtherTime(false) { }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 testing::Mock::VerifyAndClear(scriptLoader2.get()); 572 testing::Mock::VerifyAndClear(scriptLoader2.get());
579 testing::Mock::VerifyAndClear(scriptLoader3.get()); 573 testing::Mock::VerifyAndClear(scriptLoader3.get());
580 EXPECT_CALL(*scriptLoader2, execute()).Times(1); 574 EXPECT_CALL(*scriptLoader2, execute()).Times(1);
581 EXPECT_CALL(*scriptLoader3, execute()).Times(1); 575 EXPECT_CALL(*scriptLoader3, execute()).Times(1);
582 EXPECT_CALL(*scriptLoader2, isReady()).WillRepeatedly(Return(true)); 576 EXPECT_CALL(*scriptLoader2, isReady()).WillRepeatedly(Return(true));
583 EXPECT_CALL(*scriptLoader3, isReady()).WillRepeatedly(Return(true)); 577 EXPECT_CALL(*scriptLoader3, isReady()).WillRepeatedly(Return(true));
584 m_platform.runAllTasks(); 578 m_platform.runAllTasks();
585 } 579 }
586 580
587 } // namespace blink 581 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | third_party/WebKit/Source/core/fetch/FetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698