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

Unified Diff: Source/core/testing/NullExecutionContext.cpp

Issue 338833002: Factor out NullExecutionContext from unittest files. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed #2 Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/testing/NullExecutionContext.h ('k') | Source/modules/indexeddb/IDBRequestTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/NullExecutionContext.cpp
diff --git a/Source/core/testing/NullExecutionContext.cpp b/Source/core/testing/NullExecutionContext.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b0f18f82d3e2069bc71a475c4b86115f31181906
--- /dev/null
+++ b/Source/core/testing/NullExecutionContext.cpp
@@ -0,0 +1,30 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+
+#include "core/testing/NullExecutionContext.h"
+
+namespace WebCore {
+
+namespace {
+
+class NullEventQueue FINAL : public EventQueue {
+public:
+ NullEventQueue() { }
+ virtual ~NullEventQueue() { }
+ virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE { return true; }
+ virtual bool cancelEvent(Event*) OVERRIDE { return true; }
+ virtual void close() OVERRIDE { }
+};
+
+} // namespace
+
+NullExecutionContext::NullExecutionContext()
+ : m_tasksNeedSuspension(false)
+ , m_queue(adoptPtrWillBeNoop(new NullEventQueue()))
+{
+}
+
+} // namespace WebCore
« no previous file with comments | « Source/core/testing/NullExecutionContext.h ('k') | Source/modules/indexeddb/IDBRequestTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698