Changeset 52753 in webkit


Ignore:
Timestamp:
Jan 4, 2010 1:19:41 PM (14 years ago)
Author:
Adam Roben
Message:

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>.

Location:
trunk
Files:
11 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/win/ChangeLog

    r52749 r52753  
     12010-01-04  Adam Roben  <aroben@apple.com>
     2
     3        Add WebKitAPITest
     4
     5        Fixes <http://webkit.org/b/33167>.
     6
     7        Reviewed by Sam Weinig.
     8
     9        * WebKit.vcproj/WebKit.sln: Added WebKitAPITest.vcproj. It builds just
     10        after DumpRenderTree.vcproj.
     11
    1122010-01-04  Dan Bernstein  <mitz@apple.com>
    213
  • trunk/WebKit/win/WebKit.vcproj/WebKit.sln

    r52263 r52753  
    8080EndProject
    8181Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "record-memory-win", "..\..\..\WebKitTools\record-memory-win\record-memory-win.vcproj", "{44B9C152-1870-4035-B94D-7B3285AA0C12}"
     82EndProject
     83Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitAPITest", "..\..\..\WebKitTools\WebKitAPITest\WebKitAPITest.vcproj", "{626089A3-25D3-4883-A96C-B8C66E036397}"
     84        ProjectSection(ProjectDependencies) = postProject
     85                {6567DFD4-D6DE-4CD5-825D-17E353D160E1} = {6567DFD4-D6DE-4CD5-825D-17E353D160E1}
     86        EndProjectSection
    8287EndProject
    8388Global
     
    223228                {44B9C152-1870-4035-B94D-7B3285AA0C12}.Release|Win32.ActiveCfg = Release|Win32
    224229                {44B9C152-1870-4035-B94D-7B3285AA0C12}.Release|Win32.Build.0 = Release|Win32
     230                {626089A3-25D3-4883-A96C-B8C66E036397}.Debug_Cairo|Win32.ActiveCfg = Debug_Internal|Win32
     231                {626089A3-25D3-4883-A96C-B8C66E036397}.Debug_Cairo|Win32.Build.0 = Debug_Internal|Win32
     232                {626089A3-25D3-4883-A96C-B8C66E036397}.Debug|Win32.ActiveCfg = Debug|Win32
     233                {626089A3-25D3-4883-A96C-B8C66E036397}.Debug|Win32.Build.0 = Debug|Win32
     234                {626089A3-25D3-4883-A96C-B8C66E036397}.Release_Cairo|Win32.ActiveCfg = Debug|Win32
     235                {626089A3-25D3-4883-A96C-B8C66E036397}.Release_Cairo|Win32.Build.0 = Debug|Win32
     236                {626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.ActiveCfg = Debug|Win32
     237                {626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.Build.0 = Debug|Win32
    225238        EndGlobalSection
    226239        GlobalSection(SolutionProperties) = preSolution
  • trunk/WebKitTools/ChangeLog

    r52739 r52753  
     12010-01-04  Adam Roben  <aroben@apple.com>
     2
     3        Add a test harness for the Windows WebKit API, and a few tests
     4
     5        We currently only have tests for a handful of bugs regarding WebView
     6        destruction, but more tests can easily be added later. Eventually
     7        we'll run these tests as part of run-webkit-tests.
     8
     9        Fixes <http://webkit.org/b/33167>.
     10
     11        Reviewed by Sam Weinig.
     12
     13        * WebKitAPITest/HostWindow.cpp: Added.
     14        (WebKitAPITest::HostWindow::HostWindow): Initialize m_window.
     15        (WebKitAPITest::HostWindow::~HostWindow): Destroy our window if
     16        needed.
     17        (WebKitAPITest::HostWindow::initialize): Create our window.
     18        (WebKitAPITest::HostWindow::clientRect): Return our window's client
     19        rect.
     20        (WebKitAPITest::HostWindow::registerWindowClass): Does what it says.
     21        (WebKitAPITest::HostWindow::wndProc): Just call through to
     22        DefWindowProcW.
     23
     24        * WebKitAPITest/HostWindow.h: Added.
     25        (WebKitAPITest::HostWindow::window): Simple getter.
     26
     27        * WebKitAPITest/Test.h: Added. This file defines some macros useful
     28        for writing tests.
     29
     30        * WebKitAPITest/TestsController.cpp: Added.
     31        (WebKitAPITest::TestsController::TestsController): Initialize our
     32        members.
     33        (WebKitAPITest::TestsController::shared): Return the shared instance.
     34        (WebKitAPITest::TestsController::runAllTests): Run a message pump
     35        until a WM_QUIT message is received, then return whether all tests
     36        succeeded.
     37        (WebKitAPITest::TestsController::addTest): Add the test to m_tests and
     38        start running tests soon.
     39        (WebKitAPITest::TestsController::testFailed): Record the failure and
     40        print a message about it to stdout.
     41        (WebKitAPITest::TestsController::runNextTest): If we don't have any
     42        tests to run, post a WM_QUIT message to stop the message pump.
     43        Otherwise, run the test and print whether it passed, then schedule the
     44        next test.
     45        (WebKitAPITest::TestsController::runNextTestSoon): Set a 0-delay timer
     46        to run the next test.
     47        (WebKitAPITest::TestsController::registerWindowClass): Does what it
     48        says.
     49        (WebKitAPITest::TestsController::wndProc): If the runNextTestTimer
     50        fired, call runNextTest(). Pass everything else through to
     51        DefWindowProcW.
     52
     53        * WebKitAPITest/TestsController.h: Added.
     54
     55        * WebKitAPITest/WebKitAPITest.vcproj: Added.
     56
     57        * WebKitAPITest/WebKitAPITestCommon.vsprops: Added.
     58
     59        * WebKitAPITest/main.cpp: Added.
     60        (main): (Mostly) just calls TestsController::runAllTests.
     61
     62        * WebKitAPITest/tests/WebViewDestruction.cpp: Added.
     63        (WebKitAPITest::WebKitCreateInstance): Helper function template to
     64        call through to the real WebKitCreateInstance.
     65        (WebKitAPITest::webViewCount): Helper function to call through to
     66        IWebKitStatistics::webViewCount.
     67        (WebKitAPITest::createWebView): Helper function to create a WebView
     68        and put it inside a HostWindow.
     69        (WebKitAPITest::runMessagePump): Helper function to run a message pump
     70        for a specified number of milliseconds, or until a WM_QUIT message is
     71        received.
     72        (WebKitAPITest::CloseWithoutDestroyWindow): Test for
     73        <http://webkit.org/b/32827>.
     74        (WebKitAPITest::MainFrameAfterClose): Test for
     75        <http://webkit.org/b/32868>.
     76        (WebKitAPITest::NoCloseOrDestroyWindow): Test for
     77        <http://webkit.org/b/33162>.
     78
    1792010-01-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    280
Note: See TracChangeset for help on using the changeset viewer.