Title: [133166] trunk/Tools
Revision
133166
Author
[email protected]
Date
2012-11-01 07:25:10 -0700 (Thu, 01 Nov 2012)

Log Message

[BlackBerry] Fix editing/text-iterator/findString-expected.html fail
https://bugs.webkit.org/show_bug.cgi?id=100902

Reviewed by Yong Li.

PR 210039

Fix the test my using the Page::findString method instead of our own in-page searcher.
This also syncs some of the changes we did regarding String usage.

* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(BlackBerry::WebKit::DumpRenderTree::dumpFramesAsText):
(BlackBerry::WebKit::dumpHistoryItem):
(BlackBerry::WebKit::dumpBackForwardListForWebView):
(BlackBerry::WebKit::DumpRenderTree::dump):
(BlackBerry::WebKit::DumpRenderTree::didFinishDocumentLoadForFrame):
(BlackBerry::WebKit::DumpRenderTree::didReceiveTitleForFrame):
(BlackBerry::WebKit::DumpRenderTree::runJavaScriptAlert):
* DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
(DumpRenderTree):
* DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
(TestRunner::setMockGeolocationError):
(TestRunner::layerTreeAsText):
(TestRunner::findString):
(TestRunner::setStorageDatabaseIdleInterval):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (133165 => 133166)


--- trunk/Tools/ChangeLog	2012-11-01 14:24:34 UTC (rev 133165)
+++ trunk/Tools/ChangeLog	2012-11-01 14:25:10 UTC (rev 133166)
@@ -1,3 +1,31 @@
+2012-10-31  Rob Buis  <[email protected]>
+
+        [BlackBerry] Fix editing/text-iterator/findString-expected.html fail
+        https://bugs.webkit.org/show_bug.cgi?id=100902
+
+        Reviewed by Yong Li.
+
+        PR 210039
+
+        Fix the test my using the Page::findString method instead of our own in-page searcher.
+        This also syncs some of the changes we did regarding String usage.
+
+        * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+        (BlackBerry::WebKit::DumpRenderTree::dumpFramesAsText):
+        (BlackBerry::WebKit::dumpHistoryItem):
+        (BlackBerry::WebKit::dumpBackForwardListForWebView):
+        (BlackBerry::WebKit::DumpRenderTree::dump):
+        (BlackBerry::WebKit::DumpRenderTree::didFinishDocumentLoadForFrame):
+        (BlackBerry::WebKit::DumpRenderTree::didReceiveTitleForFrame):
+        (BlackBerry::WebKit::DumpRenderTree::runJavaScriptAlert):
+        * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
+        (DumpRenderTree):
+        * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
+        (TestRunner::setMockGeolocationError):
+        (TestRunner::layerTreeAsText):
+        (TestRunner::findString):
+        (TestRunner::setStorageDatabaseIdleInterval):
+
 2012-11-01  Christophe Dumez  <[email protected]>
 
         [EFL][WK2] Add File Chooser dialog support to MiniBrowser

Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp (133165 => 133166)


--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp	2012-11-01 14:24:34 UTC (rev 133165)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp	2012-11-01 14:25:10 UTC (rev 133166)
@@ -373,12 +373,12 @@
     if (frame->tree()->parent())
         s = String::format("\n--------\nFrame: '%s'\n--------\n", frame->tree()->uniqueName().string().utf8().data());
 
-    s += documentElement->innerText() + "\n";
+    s = s + documentElement->innerText() + "\n";
 
     if (gTestRunner->dumpChildFramesAsText()) {
         WebCore::FrameTree* tree = frame->tree();
         for (WebCore::Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling())
-            s += dumpFramesAsText(child);
+            s = s + dumpFramesAsText(child);
     }
     return s;
 }
@@ -426,11 +426,11 @@
 
     int start = 0;
     if (current) {
-        result += "curr->";
+        result = result + "curr->";
         start = 6;
     }
     for (int i = start; i < indent; i++)
-        result += " ";
+        result = result + " ";
 
     String url = ""
     if (url.contains("file://")) {
@@ -441,25 +441,25 @@
         if (res.isEmpty())
             return result;
 
-        result += fileTestString;
-        result += res;
+        result = result + fileTestString;
+        result = result + res;
     } else
-        result += url;
+        result = result + url;
 
     String target = item->target();
     if (!target.isEmpty())
-        result += " (in frame \"" + target + "\")";
+        result = result + " (in frame \"" + target + "\")";
 
     if (item->isTargetItem())
-        result += "  **nav target**";
-    result += "\n";
+        result = result + "  **nav target**";
+    result = result + "\n";
 
     WebCore::HistoryItemVector children = item->children();
     // Must sort to eliminate arbitrary result ordering which defeats reproducible testing.
     nonCopyingSort(children.begin(), children.end(), historyItemCompare);
     unsigned resultSize = children.size();
     for (unsigned i = 0; i < resultSize; ++i)
-        result += dumpHistoryItem(children[i], indent + 4, false);
+        result = result + dumpHistoryItem(children[i], indent + 4, false);
 
     return result;
 }
@@ -476,16 +476,16 @@
     bfList->backListWithLimit(maxItems, entries);
     unsigned resultSize = entries.size();
     for (unsigned i = 0; i < resultSize; ++i)
-        result += dumpHistoryItem(entries[i], 8, false);
+        result = result + dumpHistoryItem(entries[i], 8, false);
 
-    result += dumpHistoryItem(bfList->currentItem(), 8, true);
+    result = result + dumpHistoryItem(bfList->currentItem(), 8, true);
 
     bfList->forwardListWithLimit(maxItems, entries);
     resultSize = entries.size();
     for (unsigned i = 0; i < resultSize; ++i)
-        result += dumpHistoryItem(entries[i], 8, false);
+        result = result + dumpHistoryItem(entries[i], 8, false);
 
-    result += "===============================================\n";
+    result = result +  "===============================================\n";
 
     return result;
 }
@@ -506,7 +506,7 @@
     String data = "" ? dumpFramesAsText(mainFrame) : renderTreeDump();
 
     if (gTestRunner->dumpBackForwardList())
-        data += dumpBackForwardListForWebView();
+        data = "" + dumpBackForwardListForWebView();
 
     String result = "Content-Type: " + resultMimeType + "\n" + data;
 
@@ -631,7 +631,7 @@
         if (gTestRunner->dumpFrameLoadCallbacks())
             printf("%s - didFinishDocumentLoadForFrame\n", drtFrameDescription(frame).utf8().data());
         else {
-            unsigned pendingFrameUnloadEvents = frame->domWindow()->pendingUnloadEventListeners();
+            unsigned pendingFrameUnloadEvents = frame->document()->domWindow()->pendingUnloadEventListeners();
             if (pendingFrameUnloadEvents)
                 printf("%s - has %u onunload handler(s)\n", drtFrameDescription(frame).utf8().data(), pendingFrameUnloadEvents);
         }
@@ -664,7 +664,7 @@
         printf("%s - didReceiveTitle: %s\n", drtFrameDescription(frame).utf8().data(), title.utf8().data());
 
     if (gTestRunner->dumpTitleChanges())
-        printf("TITLE CHANGED: '%s'\n", title.utf8().data());
+        printf("TITLE CHANGED: %s\n", title.utf8().data());
 }
 
 // ChromeClient delegates.
@@ -691,10 +691,8 @@
 
 void DumpRenderTree::runJavaScriptAlert(const String& message)
 {
-    if (!testDone) {
+    if (!testDone)
         printf("ALERT: %s\n", message.utf8().data());
-        fflush(stdout);
-    }
 }
 
 bool DumpRenderTree::runJavaScriptConfirm(const String& message)
@@ -767,12 +765,6 @@
         printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", "WebViewDidChangeSelectionNotification");
 }
 
-bool DumpRenderTree::findString(const String& string, WebCore::FindOptions options)
-{
-    WebCore::Page* page = mainFrame ? mainFrame->page() : 0;
-    return page && page->findString(string, options);
-}
-
 bool DumpRenderTree::shouldBeginEditingInDOMRange(WebCore::Range* range)
 {
     if (!testDone && gTestRunner->dumpEditingCallbacks())

Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h (133165 => 133166)


--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h	2012-11-01 14:24:34 UTC (rev 133165)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h	2012-11-01 14:25:10 UTC (rev 133166)
@@ -23,11 +23,11 @@
 
 
 #include "DumpRenderTreeClient.h"
-#include "PlatformString.h"
 #include "Timer.h"
 #include <BlackBerryPlatformLayoutTest.h>
 #include <FindOptions.h>
 #include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 class Credential;
@@ -94,7 +94,6 @@
     void didEndEditing();
     void didChange();
     void didChangeSelection();
-    bool findString(const String&, WebCore::FindOptions);
     bool shouldBeginEditingInDOMRange(WebCore::Range*);
     bool shouldEndEditingInDOMRange(WebCore::Range*);
     bool shouldDeleteDOMRange(WebCore::Range*);

Modified: trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp (133165 => 133166)


--- trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp	2012-11-01 14:24:34 UTC (rev 133165)
+++ trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp	2012-11-01 14:25:10 UTC (rev 133166)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2009, 2010, 2012 Research In Motion Limited. All rights reserved.
- * Copyright (C) 2012 Apple Inc. All Rights Reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,7 +19,6 @@
 #include "config.h"
 #include "TestRunner.h"
 
-#include "CString.h"
 #include "DatabaseTracker.h"
 #include "Document.h"
 #include "DocumentLoader.h"
@@ -36,14 +34,12 @@
 #include "JSElement.h"
 #include "KURL.h"
 #include "NotImplemented.h"
-#include "OwnArrayPtr.h"
 #include "Page.h"
 #include "RenderTreeAsText.h"
 #include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "SecurityPolicy.h"
 #include "Settings.h"
-#include "UnusedParam.h"
 #include "WorkQueue.h"
 #include "WorkQueueItem.h"
 #include "WorkerThread.h"
@@ -53,6 +49,10 @@
 #include <WebPage.h>
 #include <WebSettings.h>
 
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
+
 using WebCore::toElement;
 using WebCore::toJS;
 
@@ -452,10 +452,10 @@
     DumpRenderTreeSupport::setMockGeolocationPosition(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), latitude, longitude, accuracy);
 }
 
-void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message)
+void TestRunner::setMockGeolocationError(int code, JSStringRef message)
 {
     String messageStr = jsStringRefToWebCoreString(message);
-    DumpRenderTreeSupport::setMockGeolocationPositionUnavailableError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), messageStr);
+    DumpRenderTreeSupport::setMockGeolocationError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), code, messageStr);
 }
 
 void TestRunner::showWebInspector()
@@ -587,6 +587,12 @@
     return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value);
 }
 
+JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
+{
+    notImplemented();
+    return 0;
+}
+
 JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
 {
     WebCore::Element* element = toElement(toJS(toJS(context), nodeObject));
@@ -746,9 +752,7 @@
             options |= WebCore::StartInSelection;
     }
 
-    // Our layout tests assume find will wrap and highlight all matches.
-    return BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->findNextString(nameStr.utf8().data(),
-        !(options & WebCore::Backwards), !(options & WebCore::CaseInsensitive), true /* wrap */, true /* highlightAllMatches */);
+    return mainFrame->page()->findString(nameStr, options);
 }
 
 void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL)
@@ -839,3 +843,9 @@
 {
     notImplemented();
 }
+
+void TestRunner::setStorageDatabaseIdleInterval(double)
+{
+    // FIXME: Implement this.
+    notImplemented();
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to