Index: Source/core/wawwa/MockAnimationPlayer.h |
diff --git a/Source/core/workers/DedicatedWorkerThread.cpp b/Source/core/wawwa/MockAnimationPlayer.h |
similarity index 52% |
copy from Source/core/workers/DedicatedWorkerThread.cpp |
copy to Source/core/wawwa/MockAnimationPlayer.h |
index 1e253243e7b6043703bebf7f5d7c75b85d0c9ddd..a690ae5e26c4b8b582562661110a97c6b42ea350 100644 |
--- a/Source/core/workers/DedicatedWorkerThread.cpp |
+++ b/Source/core/wawwa/MockAnimationPlayer.h |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2009 Google Inc. All rights reserved. |
+ * Copyright (C) 2014 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,42 +28,56 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#include "config.h" |
- |
-#include "core/workers/DedicatedWorkerThread.h" |
+#ifndef MockAnimationPlayer_h |
+#define MockAnimationPlayer_h |
+#include "bindings/core/v8/Dictionary.h" |
+#include "core/animation/AnimationEffect.h" |
+#include "core/animation/AnimationTestHelper.h" |
+#include "core/animation/TimingInput.h" |
+#include "core/css/parser/BisonCSSParser.h" |
+#include "core/css/resolver/CSSToStyleMap.h" |
+#include "core/dom/CrossThreadTask.h" |
+#include "core/dom/Document.h" |
+#include "core/wawwa/ProxyKeyframe.h" |
#include "core/workers/DedicatedWorkerGlobalScope.h" |
+#include "core/workers/DedicatedWorkerThread.h" |
+#include "core/workers/Worker.h" |
#include "core/workers/WorkerObjectProxy.h" |
-#include "core/workers/WorkerThreadStartupData.h" |
+#include "wtf/text/WTFString.h" |
namespace blink { |
-PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData) |
-{ |
- return adoptRef(new DedicatedWorkerThread(workerLoaderProxy, workerObjectProxy, timeOrigin, startupData)); |
-} |
+class Dictionary; |
+class ExceptionState; |
-DedicatedWorkerThread::DedicatedWorkerThread(WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData) |
- : WorkerThread(workerLoaderProxy, workerObjectProxy, startupData) |
- , m_workerObjectProxy(workerObjectProxy) |
- , m_timeOrigin(timeOrigin) |
-{ |
-} |
+class MockAnimationPlayer FINAL : public RefCountedWillBeRefCountedGarbageCollected<MockAnimationPlayer> { |
-DedicatedWorkerThread::~DedicatedWorkerThread() |
-{ |
-} |
+public: |
+ MockAnimationPlayer(String inputID, PassRefPtr<DedicatedWorkerGlobalScope>, const Vector<ProxyKeyframe> keyframes, const Timing timingInputDictionary); |
+ static PassRefPtrWillBeRawPtr<MockAnimationPlayer> create(String inputID, PassRefPtr<DedicatedWorkerGlobalScope>, const Vector<ProxyKeyframe> keyframes, const Timing timingInputDictionary); |
+ void pause(ExceptionState&); |
+ void play(ExceptionState&); |
+ void cancel(ExceptionState&); |
+ void finish(ExceptionState&); |
+ void reverse(ExceptionState&); |
+ void setStartTime(double val) |
+ { |
+ startTime = val; |
+ } |
+ double getStartTime() |
+ { |
+ return startTime; |
+ } |
+ RefPtr<DedicatedWorkerGlobalScope> m_workerGlobalScope; |
-PassRefPtrWillBeRawPtr<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData) |
-{ |
- return DedicatedWorkerGlobalScope::create(this, startupData, m_timeOrigin); |
-} |
- |
-void DedicatedWorkerThread::runEventLoop() |
-{ |
- // Notify the parent object of our current active state before calling the superclass to run the event loop. |
- m_workerObjectProxy.reportPendingActivity(workerGlobalScope()->hasPendingActivity()); |
- WorkerThread::runEventLoop(); |
-} |
+private: |
+ String m_id; |
+ double startTime; |
+ Vector<ProxyKeyframe> m_keyframes; |
+ Timing m_timingInputDictionary; |
+}; |
} // namespace blink |
+ |
+#endif |