Index: Source/wtf/WTFPlatform.h |
diff --git a/Source/core/testing/UnitTestHelpers.cpp b/Source/wtf/WTFPlatform.h |
similarity index 71% |
copy from Source/core/testing/UnitTestHelpers.cpp |
copy to Source/wtf/WTFPlatform.h |
index 8c5bc5bbe4552847c5199f067aa587a7d748e073..035972e79fe3b4e344b441a7f3117ae1177bdf0e 100644 |
--- a/Source/core/testing/UnitTestHelpers.cpp |
+++ b/Source/wtf/WTFPlatform.h |
@@ -17,35 +17,34 @@ |
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#include "config.h" |
-#include "core/testing/UnitTestHelpers.h" |
- |
-#include "public/platform/Platform.h" |
-#include "public/platform/WebThread.h" |
+#ifndef WTF_WTFPlatform_h |
+#define WTF_WTFPlatform_h |
+#include "wtf/Assertions.h" |
+#include "wtf/DiscardableMemory.h" |
+#include "wtf/PassOwnPtr.h" |
-namespace WebCore { |
-namespace testing { |
+namespace WTF { |
-class QuitTask : public blink::WebThread::Task { |
+class WTFPlatform { |
public: |
- virtual void run() |
- { |
- blink::Platform::current()->currentThread()->exitRunLoop(); |
- } |
+ virtual ~WTFPlatform() { } |
+ |
+ virtual PassOwnPtr<DiscardableMemory> allocateAndLockDiscardableMemory(size_t bytes) = 0; |
+ |
+ static WTFPlatform* getInstance() { return s_instance; } |
+ static void setInstance(WTFPlatform* instance) { ASSERT(!s_instance); s_instance = instance; } |
+ |
+private: |
+ static WTFPlatform* s_instance; |
}; |
-void runPendingTasks() |
-{ |
- blink::Platform::current()->currentThread()->postTask(new QuitTask); |
- blink::Platform::current()->currentThread()->enterRunLoop(); |
-} |
+} // namespace WTF |
-} |
-} |
+#endif |