summaryrefslogtreecommitdiffstats
path: root/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/DumpRenderTree/chromium/LayoutTestController.h')
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index 6706157..7bb22ca 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -42,13 +42,15 @@
#define LayoutTestController_h
#include "CppBoundClass.h"
-#include "base/timer.h" // FIXME: Remove this.
+#include "Task.h"
#include "public/WebString.h"
#include "public/WebURL.h"
#include <wtf/Deque.h>
#include <wtf/OwnPtr.h>
namespace WebKit {
+class WebDeviceOrientationClient;
+class WebDeviceOrientationClientMock;
class WebSpeechInputController;
class WebSpeechInputControllerMock;
class WebSpeechInputListener;
@@ -62,6 +64,8 @@ public:
// object.
LayoutTestController(TestShell*);
+ ~LayoutTestController();
+
// This function sets a flag that tells the test_shell to dump pages as
// plain text, rather than as a text representation of the renderer's state.
// It takes an optional argument, whether to dump pixels results or not.
@@ -116,7 +120,6 @@ public:
// to delay the completion of the test until notifyDone is called.
void waitUntilDone(const CppArgumentList&, CppVariant*);
void notifyDone(const CppArgumentList&, CppVariant*);
- void notifyDoneTimedOut();
// Methods for adding actions to the work queue. Used in conjunction with
// waitUntilDone/notifyDone above.
@@ -319,6 +322,7 @@ public:
void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
+ WebKit::WebDeviceOrientationClient* deviceOrientationClient();
bool shouldDumpAsText() { return m_dumpAsText; }
bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
@@ -360,6 +364,8 @@ public:
virtual bool run(TestShell* shell) = 0;
};
+ TaskList* taskList() { return &m_taskList; }
+
private:
friend class WorkItem;
friend class WorkQueue;
@@ -379,11 +385,17 @@ private:
void setFrozen(bool frozen) { m_frozen = frozen; }
bool isEmpty() { return m_queue.isEmpty(); }
+ TaskList* taskList() { return &m_taskList; }
private:
void processWork();
+ class WorkQueueTask: public MethodTask<WorkQueue> {
+ public:
+ WorkQueueTask(WorkQueue* object): MethodTask<WorkQueue>(object) {}
+ virtual void runIfValid() { m_object->processWork(); }
+ };
- base::OneShotTimer<WorkQueue> m_timer;
+ TaskList m_taskList;
Deque<WorkItem*> m_queue;
bool m_frozen;
LayoutTestController* m_controller;
@@ -396,6 +408,12 @@ private:
void logErrorToConsole(const std::string&);
void completeNotifyDone(bool isTimeout);
+ class NotifyDoneTimedOutTask: public MethodTask<LayoutTestController> {
+ public:
+ NotifyDoneTimedOutTask(LayoutTestController* object): MethodTask<LayoutTestController>(object) {}
+ virtual void runIfValid() { m_object->completeNotifyDone(true); }
+ };
+
bool pauseAnimationAtTimeOnElementWithId(const WebKit::WebString& animationName, double time, const WebKit::WebString& elementId);
bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId);
@@ -405,7 +423,7 @@ private:
void resumeAnimations();
// Used for test timeouts.
- ScopedRunnableMethodFactory<LayoutTestController> m_timeoutFactory;
+ TaskList m_taskList;
// Non-owning pointer. The LayoutTestController is owned by the host.
TestShell* m_shell;
@@ -493,6 +511,8 @@ private:
WebKit::WebURL m_userStyleSheetLocation;
OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
+
+ OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
};
#endif // LayoutTestController_h