Commit cfd42782 authored by aroben@apple.com's avatar aroben@apple.com

Add a test harness for the Windows WebKit API, and a few tests

We currently only have tests for a handful of bugs regarding WebView
destruction, but more tests can easily be added later. Eventually
we'll run these tests as part of run-webkit-tests.

Fixes <http://webkit.org/b/33167>.

Reviewed by Sam Weinig.

WebKit/win:

* WebKit.vcproj/WebKit.sln: Added WebKitAPITest.vcproj. It builds just
after DumpRenderTree.vcproj.

WebKitTools:

* WebKitAPITest/HostWindow.cpp: Added.
(WebKitAPITest::HostWindow::HostWindow): Initialize m_window.
(WebKitAPITest::HostWindow::~HostWindow): Destroy our window if
needed.
(WebKitAPITest::HostWindow::initialize): Create our window.
(WebKitAPITest::HostWindow::clientRect): Return our window's client
rect.
(WebKitAPITest::HostWindow::registerWindowClass): Does what it says.
(WebKitAPITest::HostWindow::wndProc): Just call through to
DefWindowProcW.

* WebKitAPITest/HostWindow.h: Added.
(WebKitAPITest::HostWindow::window): Simple getter.

* WebKitAPITest/Test.h: Added. This file defines some macros useful
for writing tests.

* WebKitAPITest/TestsController.cpp: Added.
(WebKitAPITest::TestsController::TestsController): Initialize our
members.
(WebKitAPITest::TestsController::shared): Return the shared instance.
(WebKitAPITest::TestsController::runAllTests): Run a message pump
until a WM_QUIT message is received, then return whether all tests
succeeded.
(WebKitAPITest::TestsController::addTest): Add the test to m_tests and
start running tests soon.
(WebKitAPITest::TestsController::testFailed): Record the failure and
print a message about it to stdout.
(WebKitAPITest::TestsController::runNextTest): If we don't have any
tests to run, post a WM_QUIT message to stop the message pump.
Otherwise, run the test and print whether it passed, then schedule the
next test.
(WebKitAPITest::TestsController::runNextTestSoon): Set a 0-delay timer
to run the next test.
(WebKitAPITest::TestsController::registerWindowClass): Does what it
says.
(WebKitAPITest::TestsController::wndProc): If the runNextTestTimer
fired, call runNextTest(). Pass everything else through to
DefWindowProcW.

* WebKitAPITest/TestsController.h: Added.

* WebKitAPITest/WebKitAPITest.vcproj: Added.

* WebKitAPITest/WebKitAPITestCommon.vsprops: Added.

* WebKitAPITest/main.cpp: Added.
(main): (Mostly) just calls TestsController::runAllTests.

* WebKitAPITest/tests/WebViewDestruction.cpp: Added.
(WebKitAPITest::WebKitCreateInstance): Helper function template to
call through to the real WebKitCreateInstance.
(WebKitAPITest::webViewCount): Helper function to call through to
IWebKitStatistics::webViewCount.
(WebKitAPITest::createWebView): Helper function to create a WebView
and put it inside a HostWindow.
(WebKitAPITest::runMessagePump): Helper function to run a message pump
for a specified number of milliseconds, or until a WM_QUIT message is
received.
(WebKitAPITest::CloseWithoutDestroyWindow): Test for
<http://webkit.org/b/32827>.
(WebKitAPITest::MainFrameAfterClose): Test for
<http://webkit.org/b/32868>.
(WebKitAPITest::NoCloseOrDestroyWindow): Test for
<http://webkit.org/b/33162>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f53cff40
2010-01-04 Adam Roben <aroben@apple.com>
Add WebKitAPITest
Fixes <http://webkit.org/b/33167>.
Reviewed by Sam Weinig.
* WebKit.vcproj/WebKit.sln: Added WebKitAPITest.vcproj. It builds just
after DumpRenderTree.vcproj.
2010-01-04 Dan Bernstein <mitz@apple.com>
Reviewed by Ada Chan and Mark Rowe.
......
......@@ -80,6 +80,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testapi", "..\..\..\JavaScr
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "record-memory-win", "..\..\..\WebKitTools\record-memory-win\record-memory-win.vcproj", "{44B9C152-1870-4035-B94D-7B3285AA0C12}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitAPITest", "..\..\..\WebKitTools\WebKitAPITest\WebKitAPITest.vcproj", "{626089A3-25D3-4883-A96C-B8C66E036397}"
ProjectSection(ProjectDependencies) = postProject
{6567DFD4-D6DE-4CD5-825D-17E353D160E1} = {6567DFD4-D6DE-4CD5-825D-17E353D160E1}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Cairo|Win32 = Debug_Cairo|Win32
......@@ -222,6 +227,14 @@ Global
{44B9C152-1870-4035-B94D-7B3285AA0C12}.Release_Cairo|Win32.Build.0 = Release|Win32
{44B9C152-1870-4035-B94D-7B3285AA0C12}.Release|Win32.ActiveCfg = Release|Win32
{44B9C152-1870-4035-B94D-7B3285AA0C12}.Release|Win32.Build.0 = Release|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Debug_Cairo|Win32.ActiveCfg = Debug_Internal|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Debug_Cairo|Win32.Build.0 = Debug_Internal|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Debug|Win32.ActiveCfg = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Debug|Win32.Build.0 = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release_Cairo|Win32.ActiveCfg = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release_Cairo|Win32.Build.0 = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.ActiveCfg = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
2010-01-04 Adam Roben <aroben@apple.com>
Add a test harness for the Windows WebKit API, and a few tests
We currently only have tests for a handful of bugs regarding WebView
destruction, but more tests can easily be added later. Eventually
we'll run these tests as part of run-webkit-tests.
Fixes <http://webkit.org/b/33167>.
Reviewed by Sam Weinig.
* WebKitAPITest/HostWindow.cpp: Added.
(WebKitAPITest::HostWindow::HostWindow): Initialize m_window.
(WebKitAPITest::HostWindow::~HostWindow): Destroy our window if
needed.
(WebKitAPITest::HostWindow::initialize): Create our window.
(WebKitAPITest::HostWindow::clientRect): Return our window's client
rect.
(WebKitAPITest::HostWindow::registerWindowClass): Does what it says.
(WebKitAPITest::HostWindow::wndProc): Just call through to
DefWindowProcW.
* WebKitAPITest/HostWindow.h: Added.
(WebKitAPITest::HostWindow::window): Simple getter.
* WebKitAPITest/Test.h: Added. This file defines some macros useful
for writing tests.
* WebKitAPITest/TestsController.cpp: Added.
(WebKitAPITest::TestsController::TestsController): Initialize our
members.
(WebKitAPITest::TestsController::shared): Return the shared instance.
(WebKitAPITest::TestsController::runAllTests): Run a message pump
until a WM_QUIT message is received, then return whether all tests
succeeded.
(WebKitAPITest::TestsController::addTest): Add the test to m_tests and
start running tests soon.
(WebKitAPITest::TestsController::testFailed): Record the failure and
print a message about it to stdout.
(WebKitAPITest::TestsController::runNextTest): If we don't have any
tests to run, post a WM_QUIT message to stop the message pump.
Otherwise, run the test and print whether it passed, then schedule the
next test.
(WebKitAPITest::TestsController::runNextTestSoon): Set a 0-delay timer
to run the next test.
(WebKitAPITest::TestsController::registerWindowClass): Does what it
says.
(WebKitAPITest::TestsController::wndProc): If the runNextTestTimer
fired, call runNextTest(). Pass everything else through to
DefWindowProcW.
* WebKitAPITest/TestsController.h: Added.
* WebKitAPITest/WebKitAPITest.vcproj: Added.
* WebKitAPITest/WebKitAPITestCommon.vsprops: Added.
* WebKitAPITest/main.cpp: Added.
(main): (Mostly) just calls TestsController::runAllTests.
* WebKitAPITest/tests/WebViewDestruction.cpp: Added.
(WebKitAPITest::WebKitCreateInstance): Helper function template to
call through to the real WebKitCreateInstance.
(WebKitAPITest::webViewCount): Helper function to call through to
IWebKitStatistics::webViewCount.
(WebKitAPITest::createWebView): Helper function to create a WebView
and put it inside a HostWindow.
(WebKitAPITest::runMessagePump): Helper function to run a message pump
for a specified number of milliseconds, or until a WM_QUIT message is
received.
(WebKitAPITest::CloseWithoutDestroyWindow): Test for
<http://webkit.org/b/32827>.
(WebKitAPITest::MainFrameAfterClose): Test for
<http://webkit.org/b/32868>.
(WebKitAPITest::NoCloseOrDestroyWindow): Test for
<http://webkit.org/b/33162>.
2010-01-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed by David Kilzer.
......
/*
* Copyright (C) 2010 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. 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;
* 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 "HostWindow.h"
namespace WebKitAPITest {
static LPCWSTR hostWindowClassName = L"HostWindow";
HostWindow::HostWindow()
: m_window(0)
{
}
bool HostWindow::initialize()
{
registerWindowClass();
m_window = CreateWindowExW(0, hostWindowClassName, L"WebKitAPITest", WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, GetModuleHandle(0), 0);
return m_window;
}
HostWindow::~HostWindow()
{
if (!IsWindow(m_window))
return;
DestroyWindow(m_window);
}
RECT HostWindow::clientRect() const
{
RECT rect = {0};
if (!GetClientRect(m_window, &rect)) {
RECT emptyRect = {0};
return emptyRect;
}
return rect;
}
void HostWindow::registerWindowClass()
{
static bool initialized;
if (initialized)
return;
initialized = true;
WNDCLASSEXW wndClass = {0};
wndClass.cbSize = sizeof(wndClass);
wndClass.style = CS_HREDRAW | CS_VREDRAW;
wndClass.lpfnWndProc = wndProc;
wndClass.hCursor = LoadCursor(0, IDC_ARROW);
wndClass.hInstance = GetModuleHandle(0);
wndClass.lpszClassName = hostWindowClassName;
RegisterClassExW(&wndClass);
}
LRESULT HostWindow::wndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
} // namespace WebKitAPITest
/*
* Copyright (C) 2010 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. 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;
* 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 HostWindow_h
#define HostWindow_h
#include <windows.h>
#include <wtf/Noncopyable.h>
namespace WebKitAPITest {
class HostWindow : public Noncopyable {
public:
HostWindow();
~HostWindow();
bool initialize();
RECT clientRect() const;
HWND window() const { return m_window; }
private:
static void registerWindowClass();
static LRESULT CALLBACK wndProc(HWND, UINT uMsg, WPARAM, LPARAM);
HWND m_window;
};
} // namespace WebKitAPITest
#endif // HostWindow_h
/*
* Copyright (C) 2010 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. 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;
* 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 Test_h
#define Test_h
#include "TestsController.h"
namespace WebKitAPITest {
// Abstract base class that all tests inherit from.
class Test {
public:
~Test() { }
virtual const char* name() const = 0;
virtual void run() = 0;
};
#define TEST_CLASS_NAME(testCaseName, testName) testCaseName##_##testName##_Test
// Use this to define a new test.
#define TEST(testCaseName, testName) \
class TEST_CLASS_NAME(testCaseName, testName) : public Test { \
public: \
virtual const char* name() const { return #testCaseName ": " #testName; } \
virtual void run(); \
static const bool initialized; \
}; \
\
const bool TEST_CLASS_NAME(testCaseName, testName)::initialized = (TestsController::shared().addTest(new TEST_CLASS_NAME(testCaseName, testName)), true); \
\
void TEST_CLASS_NAME(testCaseName, testName)::run()
#define TEST_ASSERT(expression) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0)
} // namespace WebKitAPITest
#endif // Test_h
/*
* Copyright (C) 2010 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. 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;
* 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 "TestsController.h"
#include "Test.h"
#include <wtf/PassOwnPtr.h>
using namespace std;
namespace WebKitAPITest {
static const LPCWSTR testsControllerWindowClassName = L"TestsControllerWindowClass";
enum { runNextTestTimerID = 1 };
inline TestsController::TestsController()
: m_testFailed(false)
, m_anyTestFailed(false)
{
registerWindowClass();
m_window = CreateWindowExW(0, testsControllerWindowClassName, 0, WS_CHILD, 0, 0, 0, 0, HWND_MESSAGE, 0, GetModuleHandle(0), 0);
}
TestsController& TestsController::shared()
{
static TestsController& shared = *new TestsController;
return shared;
}
bool TestsController::runAllTests()
{
if (m_tests.isEmpty())
return true;
MSG msg;
BOOL result;
while ((result = GetMessage(&msg, 0, 0, 0))) {
if (result == -1)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (msg.message != WM_QUIT)
return false;
return !m_anyTestFailed;
}
void TestsController::addTest(PassOwnPtr<Test> test)
{
m_tests.append(test.release());
runNextTestSoon();
}
void TestsController::testFailed(const char* file, int line, const char* message)
{
ASSERT(!m_tests.isEmpty());
m_testFailed = true;
m_anyTestFailed = true;
printf("FAIL: %s\n\t%s (%s:%d)\n", m_tests.first()->name(), message, file, line);
fflush(stdout);
}
void TestsController::runNextTest()
{
if (m_tests.isEmpty()) {
PostQuitMessage(0);
return;
}
Test* test = m_tests.first();
m_testFailed = false;
printf("RUN: %s\n", test->name());
fflush(stdout);
test->run();
if (!m_testFailed) {
printf("PASS: %s\n", test->name());
fflush(stdout);
}
m_tests.removeFirst();
delete test;
runNextTestSoon();
}
void TestsController::runNextTestSoon()
{
SetTimer(m_window, runNextTestTimerID, 0, 0);
}
void TestsController::registerWindowClass()
{
static bool initialized;
if (initialized)
return;
initialized = true;
WNDCLASSEXW wndClass = {0};
wndClass.cbSize = sizeof(wndClass);
wndClass.lpfnWndProc = wndProc;
wndClass.hCursor = LoadCursor(0, IDC_ARROW);
wndClass.hInstance = GetModuleHandle(0);
wndClass.lpszClassName = testsControllerWindowClassName;
RegisterClassExW(&wndClass);
}
LRESULT TestsController::wndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_TIMER && wParam == runNextTestTimerID) {
KillTimer(hWnd, runNextTestTimerID);
TestsController::shared().runNextTest();
return 0;
}
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
} // namespace WebKitAPITest
/*
* Copyright (C) 2010 Apple 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:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. 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;
* 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 TestsController_h
#define TestsController_h
#include <windows.h>
#include <wtf/Forward.h>
#include <wtf/Deque.h>
#include <wtf/Noncopyable.h>
namespace WebKitAPITest {
class Test;
class TestsController : public Noncopyable {
public:
static TestsController& shared();
// Returns true if all the tests passed, false otherwise.
bool runAllTests();
void addTest(PassOwnPtr<Test>);
void testFailed(const char* file, int line, const char* message);
private:
TestsController();
~TestsController();
void runNextTest();
void runNextTestSoon();
static void registerWindowClass();
static LRESULT CALLBACK wndProc(HWND, UINT uMsg, WPARAM, LPARAM);
HWND m_window;
Deque<Test*> m_tests;
bool m_testFailed;
bool m_anyTestFailed;
};
} // namespace WebKitAPITest
#endif // TestsController_h
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="WebKitAPITest"
ProjectGUID="{626089A3-25D3-4883-A96C-B8C66E036397}"
RootNamespace="WebKitAPITest"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug_All|Win32"
ConfigurationType="1"
InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\WebKitAPITestCommon.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug_Internal|Win32"
ConfigurationType="1"
InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\WebKitAPITestCommon.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"