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

Unified Diff: Source/bindings/core/v8/ScriptStreamerTest.cpp

Issue 962053003: tests: Use runPendingTasks instead of WebThread::enterRunLoop()/exitRunLoop() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 10 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
« no previous file with comments | « no previous file | Source/core/fetch/MemoryCacheTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptStreamerTest.cpp
diff --git a/Source/bindings/core/v8/ScriptStreamerTest.cpp b/Source/bindings/core/v8/ScriptStreamerTest.cpp
index db7f2dc10d6cee4821e95ef9fd40075e7067155d..27bec55e26f84be6d9010df2e4204c90d9316d37 100644
--- a/Source/bindings/core/v8/ScriptStreamerTest.cpp
+++ b/Source/bindings/core/v8/ScriptStreamerTest.cpp
@@ -13,6 +13,7 @@
#include "core/dom/Element.h"
#include "core/dom/PendingScript.h"
#include "core/frame/Settings.h"
+#include "core/testing/UnitTestHelpers.h"
#include "platform/Task.h"
#include "platform/heap/Handle.h"
#include "public/platform/Platform.h"
@@ -59,7 +60,7 @@ private:
PendingScript m_pendingScript;
};
-class ScriptStreamingTest : public testing::Test {
+class ScriptStreamingTest : public ::testing::Test {
public:
ScriptStreamingTest()
: m_scope(v8::Isolate::GetCurrent())
@@ -106,15 +107,12 @@ protected:
void processTasksUntilStreamingComplete()
{
- WebThread* currentThread = blink::Platform::current()->currentThread();
while (ScriptStreamerThread::shared()->isRunningTask()) {
- currentThread->postTask(FROM_HERE, new Task(WTF::bind(&WebThread::exitRunLoop, currentThread)));
- currentThread->enterRunLoop();
+ testing::runPendingTasks();
}
// Once more, because the "streaming complete" notification might only
// now be in the task queue.
- currentThread->postTask(FROM_HERE, new Task(WTF::bind(&WebThread::exitRunLoop, currentThread)));
- currentThread->enterRunLoop();
+ testing::runPendingTasks();
}
V8TestingScope m_scope;
« no previous file with comments | « no previous file | Source/core/fetch/MemoryCacheTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698