2011-01-12 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 07:09:26 +0000 (07:09 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 07:09:26 +0000 (07:09 +0000)
        Reviewed by David Levin.

        Add beforeunload support to WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=52353

        * platform/mac-wk2/Skipped: Unskip a test that was failing solely due to missing
        beforeunload support.
2011-01-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by David Levin.

        Add beforeunload support to WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=52353

        This makes a number of currently failing tests pass.

        * WebKitTestRunner/TestController.cpp:
        (WTR::runBeforeUnloadConfirmPanel):
        (WTR::createOtherPage):
        (WTR::TestController::initialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75682 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Source/WebCore/loader/FrameLoader.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp

index 0b1f3dd..7520b49 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-12  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add beforeunload support to WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=52353
+
+        * platform/mac-wk2/Skipped: Unskip a test that was failing solely due to missing
+        beforeunload support.
+
 2011-01-12  Hayato Ito  <hayato@chromium.org>
 
         Unreviewed test expectations files fix.
index 42506bc..787037e 100644 (file)
@@ -2036,9 +2036,6 @@ plugins/get-url-with-blank-target.html
 fast/parser/remove-misnested-iframe-in-beforeload.html
 fast/parser/remove-misnested-iframe-parent-in-beforeload.html
 
-# Unexplained failures that were formerly in the WebKitTestRunner needs to print onunload handler list.
-fast/events/onunload-clears-onbeforeunload.html
-
 # Unexplained failures that were formerly in the dumpChildFramesAsText list.
 fast/frames/sandboxed-iframe-storage.html
 http/tests/misc/isindex-with-no-form-base-href.html
index 34fa195..7d99bab 100644 (file)
@@ -2882,6 +2882,8 @@ bool FrameLoader::shouldClose()
         NavigationDisablerForBeforeUnload navigationDisabler;
         size_t i;
 
+        puts("about to test for before unload events");
+
         for (i = 0; i < targetFrames.size(); i++) {
             if (!targetFrames[i]->tree()->isDescendantOf(m_frame))
                 continue;
index 8d02d44..72b8f77 100644 (file)
@@ -1,5 +1,19 @@
 2011-01-12  Maciej Stachowiak  <mjs@apple.com>
 
+        Reviewed by David Levin.
+
+        Add beforeunload support to WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=52353
+        
+        This makes a number of currently failing tests pass.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::runBeforeUnloadConfirmPanel):
+        (WTR::createOtherPage):
+        (WTR::TestController::initialize):
+
+2011-01-12  Maciej Stachowiak  <mjs@apple.com>
+
         Reviewed by Sam Weinig.
 
         Detect, identify and recover from WebProcess crashes in run-webkit-tests
index 58fdfb6..699982e 100644 (file)
@@ -97,6 +97,12 @@ static void setWindowFrameOtherPage(WKPageRef page, WKRect frame, const void* cl
     view->setWindowFrame(frame);
 }
 
+static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo)
+{
+    printf("%s\n", toSTD(message).c_str());
+    return true;
+}
+
 static void closeOtherPage(WKPageRef page, const void* clientInfo)
 {
     WKPageClose(page);
@@ -134,7 +140,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModi
         0, // setIsResizable
         getWindowFrameOtherPage,
         setWindowFrameOtherPage,
-        0, // runBeforeUnloadConfirmPanel
+        runBeforeUnloadConfirmPanel,
         0, // didDraw
         0, // pageDidScroll
         0, // exceededDatabaseQuota
@@ -239,7 +245,7 @@ void TestController::initialize(int argc, const char* argv[])
         0, // setIsResizable
         getWindowFrameMainPage,
         setWindowFrameMainPage,
-        0, // runBeforeUnloadConfirmPanel
+        runBeforeUnloadConfirmPanel,
         0, // didDraw
         0, // pageDidScroll
         0, // exceededDatabaseQuota