summaryrefslogtreecommitdiff
path: root/Tools/DumpRenderTree/chromium
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
commit815f1ed417bd26fbe2abbdf20ac5d3423b30796c (patch)
tree923c9a9e2834ccab60f5caecfb8f0ac410c1dd9e /Tools/DumpRenderTree/chromium
parentb4ad5d9d2b96baacd0180ead50de5195ca78af2d (diff)
downloadqtwebkit-815f1ed417bd26fbe2abbdf20ac5d3423b30796c.tar.gz
Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308)
New snapshot with better configure tests
Diffstat (limited to 'Tools/DumpRenderTree/chromium')
-rw-r--r--Tools/DumpRenderTree/chromium/DumpRenderTree.cpp3
-rw-r--r--Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp55
-rw-r--r--Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h48
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp40
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h7
-rw-r--r--Tools/DumpRenderTree/chromium/TestShellWin.cpp6
-rwxr-xr-xTools/DumpRenderTree/chromium/WebThemeControlDRTWin.cpp5
-rw-r--r--Tools/DumpRenderTree/chromium/config.h11
8 files changed, 150 insertions, 25 deletions
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
index 789aa877f..e589df2bf 100644
--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -30,6 +30,7 @@
#include "config.h"
+#include "MockWebKitPlatformSupport.h"
#include "TestShell.h"
#include "WebCompositor.h"
#include "webkit/support/webkit_support.h"
@@ -72,7 +73,7 @@ class WebKitSupportTestEnvironment {
public:
WebKitSupportTestEnvironment()
{
- webkit_support::SetUpTestEnvironment();
+ webkit_support::SetUpTestEnvironment(MockWebKitPlatformSupport::create());
}
~WebKitSupportTestEnvironment()
{
diff --git a/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp
new file mode 100644
index 000000000..d487b88aa
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 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
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 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 "MockWebKitPlatformSupport.h"
+
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+
+Platform* MockWebKitPlatformSupport::create()
+{
+ return new MockWebKitPlatformSupport();
+}
+
+MockWebKitPlatformSupport::MockWebKitPlatformSupport()
+{
+}
+
+void MockWebKitPlatformSupport::cryptographicallyRandomValues(unsigned char*, size_t)
+{
+ CRASH();
+}
+
+WebMediaStreamCenter* MockWebKitPlatformSupport::createMediaStreamCenter(WebMediaStreamCenterClient*)
+{
+ return 0;
+}
diff --git a/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h
new file mode 100644
index 000000000..c5daa6f0f
--- /dev/null
+++ b/Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 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
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 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.
+ */
+
+#ifndef MockWebKitPlatformSupport_h
+#define MockWebKitPlatformSupport_h
+
+#include <public/Platform.h>
+
+class MockWebKitPlatformSupport : public WebKit::Platform {
+public:
+ static WebKit::Platform* create();
+
+ virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) OVERRIDE;
+
+ virtual WebKit::WebMediaStreamCenter* createMediaStreamCenter(WebKit::WebMediaStreamCenterClient*) OVERRIDE;
+
+private:
+ MockWebKitPlatformSupport();
+};
+
+#endif // MockWebKitPlatformSupport_h
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp
index 5cfb2c2f8..c0d532a07 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp
@@ -34,24 +34,58 @@
#include "GamepadController.h"
#include "platform/WebString.h"
+#include <wtf/OwnPtr.h>
+
using WebKit::WebFrame;
using WebKit::WebString;
-TestInterfaces::TestInterfaces()
+class TestInterfaces::Internal {
+public:
+ Internal();
+ ~Internal();
+
+ void bindTo(WebFrame*);
+ void resetAll();
+
+private:
+ OwnPtr<GamepadController> m_gamepadController;
+};
+
+TestInterfaces::Internal::Internal()
{
m_gamepadController = adoptPtr(new GamepadController());
}
+TestInterfaces::Internal::~Internal()
+{
+}
+
+void TestInterfaces::Internal::bindTo(WebFrame* frame)
+{
+ m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
+}
+
+void TestInterfaces::Internal::resetAll()
+{
+ m_gamepadController->reset();
+}
+
+TestInterfaces::TestInterfaces()
+ : m_internal(new TestInterfaces::Internal())
+{
+}
+
TestInterfaces::~TestInterfaces()
{
+ delete m_internal;
}
void TestInterfaces::bindTo(WebFrame* frame)
{
- m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
+ m_internal->bindTo(frame);
}
void TestInterfaces::resetAll()
{
- m_gamepadController->reset();
+ m_internal->resetAll();
}
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h
index e2404ad6d..16ed5a69e 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h
+++ b/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h
@@ -31,14 +31,10 @@
#ifndef TestInterfaces_h
#define TestInterfaces_h
-#include <wtf/OwnPtr.h>
-
namespace WebKit {
class WebFrame;
}
-class GamepadController;
-
class TestInterfaces {
public:
TestInterfaces();
@@ -48,7 +44,8 @@ public:
void resetAll();
private:
- OwnPtr<GamepadController> m_gamepadController;
+ class Internal;
+ Internal* m_internal;
};
#endif // TestInterfaces_h
diff --git a/Tools/DumpRenderTree/chromium/TestShellWin.cpp b/Tools/DumpRenderTree/chromium/TestShellWin.cpp
index 850e5de81..083d54a1b 100644
--- a/Tools/DumpRenderTree/chromium/TestShellWin.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShellWin.cpp
@@ -78,7 +78,7 @@ unsigned int __stdcall watchDogThread(void* arg)
void TestShell::waitTestFinished()
{
- DCHECK(!m_testIsPending) << "cannot be used recursively";
+ ASSERT(!m_testIsPending);
m_testIsPending = true;
@@ -89,7 +89,7 @@ void TestShell::waitTestFinished()
// timeout, it can't do anything except terminate the test
// shell, which is unfortunate.
m_finishedEvent = CreateEvent(0, TRUE, FALSE, 0);
- DCHECK(m_finishedEvent);
+ ASSERT(m_finishedEvent);
HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(
0,
@@ -98,7 +98,7 @@ void TestShell::waitTestFinished()
this,
0,
0));
- DCHECK(threadHandle);
+ ASSERT(threadHandle);
// TestFinished() will post a quit message to break this loop when the page
// finishes loading.
diff --git a/Tools/DumpRenderTree/chromium/WebThemeControlDRTWin.cpp b/Tools/DumpRenderTree/chromium/WebThemeControlDRTWin.cpp
index 13b798284..065df4f52 100755
--- a/Tools/DumpRenderTree/chromium/WebThemeControlDRTWin.cpp
+++ b/Tools/DumpRenderTree/chromium/WebThemeControlDRTWin.cpp
@@ -43,6 +43,7 @@
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkRect.h"
+#include <algorithm>
#include <wtf/Assertions.h>
using namespace std;
@@ -74,8 +75,8 @@ static SkIRect validate(const SkIRect& rect, WebThemeControlDRTWin::Type ctype)
// The maximum width and height is 13.
// Center the square in the passed rectangle.
const int maxControlSize = 13;
- int controlSize = min(rect.width(), rect.height());
- controlSize = min(controlSize, maxControlSize);
+ int controlSize = std::min(rect.width(), rect.height());
+ controlSize = std::min(controlSize, maxControlSize);
retval.fLeft = rect.fLeft + (rect.width() / 2) - (controlSize / 2);
retval.fRight = retval.fLeft + controlSize - 1;
diff --git a/Tools/DumpRenderTree/chromium/config.h b/Tools/DumpRenderTree/chromium/config.h
index 57b3a54fc..ef418aec0 100644
--- a/Tools/DumpRenderTree/chromium/config.h
+++ b/Tools/DumpRenderTree/chromium/config.h
@@ -31,17 +31,6 @@
#ifndef config_h
#define config_h
-// To avoid confict of LOG in wtf/Assertions.h and LOG in base/logging.h,
-// skip base/loggin.h by defining BASE_LOGGING_H_ and define some macros
-// provided by base/logging.h.
-// FIXME: Remove this hack!
-#include <iostream>
-#define BASE_LOGGING_H_
-#define CHECK(condition) while (false && (condition)) std::cerr
-#define DCHECK(condition) while (false && (condition)) std::cerr
-#define DCHECK_EQ(a, b) while (false && (a) == (b)) std::cerr
-#define DCHECK_NE(a, b) while (false && (a) != (b)) std::cerr
-
#include <wtf/Platform.h>
#include <wtf/ExportMacros.h>