Title: [139600] trunk/Source/WebKit2
Revision
139600
Author
[email protected]
Date
2013-01-14 03:02:35 -0800 (Mon, 14 Jan 2013)

Log Message

[Qt][WK2] plugin tests assert in debug
https://bugs.webkit.org/show_bug.cgi?id=106659

Reviewed by Benjamin Poulain.

Fixed the misuse of String::split.

* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::truncateToSingleLine):
Add an assert to make sure this function works well. I just walked there
while debugging the bug, and although it was innocent, adding this assertion
is logical.
* UIProcess/Plugins/qt/PluginProcessProxyQt.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
The ASSERT was wrong. We have three lines, each ends in a newline, so split
with allowEmptyEntries=true will devide it to 4 substrings.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (139599 => 139600)


--- trunk/Source/WebKit2/ChangeLog	2013-01-14 10:44:47 UTC (rev 139599)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-14 11:02:35 UTC (rev 139600)
@@ -1,3 +1,22 @@
+2013-01-11  Balazs Kelemen  <[email protected]>
+
+        [Qt][WK2] plugin tests assert in debug
+        https://bugs.webkit.org/show_bug.cgi?id=106659
+
+        Reviewed by Benjamin Poulain.
+
+        Fixed the misuse of String::split.
+
+        * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+        (WebKit::truncateToSingleLine):
+        Add an assert to make sure this function works well. I just walked there
+        while debugging the bug, and although it was innocent, adding this assertion
+        is logical.
+        * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp:
+        (WebKit::PluginProcessProxy::scanPlugin):
+        The ASSERT was wrong. We have three lines, each ends in a newline, so split
+        with allowEmptyEntries=true will devide it to 4 substrings.
+
 2013-01-11  Filip Pizlo  <[email protected]>
 
         JITThunks should not compile only because of luck

Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp (139599 => 139600)


--- trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp	2013-01-14 10:44:47 UTC (rev 139599)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp	2013-01-14 11:02:35 UTC (rev 139600)
@@ -172,9 +172,9 @@
     }
     buffer[newLength++] = UChar('\n');
 
-    if (newLength == oldLength + 1)
-        return stringBuffer;
-    return String(stringBuffer.characters16(), newLength);
+    String result = (newLength == oldLength + 1) ? stringBuffer : String(stringBuffer.characters16(), newLength);
+    ASSERT(result.endsWith(UChar('\n')));
+    return result;
 }
 
 bool NetscapePluginModule::scanPlugin(const String& pluginPath)

Modified: trunk/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp (139599 => 139600)


--- trunk/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp	2013-01-14 10:44:47 UTC (rev 139599)
+++ trunk/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp	2013-01-14 11:02:35 UTC (rev 139600)
@@ -208,7 +208,7 @@
         String output(reinterpret_cast<const UChar*>(outputBytes.constData()), outputBytes.size() / sizeof(UChar));
         Vector<String> lines;
         output.split(UChar('\n'), true, lines);
-        ASSERT(lines.size() == 3);
+        ASSERT(lines.size() == 4 && lines.last().isEmpty());
 
         result.name.swap(lines[0]);
         result.description.swap(lines[1]);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to