Bug 102438 - [Gtk] navigator.plugins contains too many plugin entries. First one are garbages
Summary: [Gtk] navigator.plugins contains too many plugin entries. First one are garbages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: arno.
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-15 15:11 PST by arno.
Modified: 2013-01-02 15:32 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.40 KB, patch)
2012-11-15 15:29 PST, arno.
no flags Details | Formatted Diff | Diff
Patch (4.11 KB, patch)
2012-11-16 14:37 PST, arno.
no flags Details | Formatted Diff | Diff
Patch (4.50 KB, patch)
2012-12-04 12:48 PST, arno.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description arno. 2012-11-15 15:11:29 PST
Hi,
if I have 3 plugins, navigator.plugins.length will be 6
navigator.plugins[0], navigator.plugins[1] and navigator.plugins[2] will contain objets with null name, description or filename.
So, it looks like first half of navigator.plugins array contains wrong empty objects.
Comment 1 arno. 2012-11-15 15:29:45 PST
Created attachment 174534 [details]
Patch

patch proposal
Comment 2 WebKit Review Bot 2012-11-15 16:41:47 PST
Comment on attachment 174534 [details]
Patch

Attachment 174534 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14860009

New failing tests:
plugins/navigator-plugins.html
Comment 3 Build Bot 2012-11-16 11:01:02 PST
Comment on attachment 174534 [details]
Patch

Attachment 174534 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14858548

New failing tests:
plugins/navigator-plugins.html
Comment 4 arno. 2012-11-16 11:02:40 PST
Comment on attachment 174534 [details]
Patch

Of course, the test could only pass if the test system have the same number of plugins as me.
Comment 5 arno. 2012-11-16 14:37:08 PST
Created attachment 174763 [details]
Patch

updated patch
Comment 6 Xan Lopez 2012-12-01 02:59:26 PST
Comment on attachment 174763 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=174763&action=review

Looks good, r- with just a couple of minor comments.

> Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.cpp:87
> +    outPlugins.resize(0);

If you look at PluginData::initPlugins() there's an ASSERT(m_plugins.isEmpty()) before calling this method, so I think we can just get rid of the resize(0) too, the vector will be empty always.

> LayoutTests/plugins/navigator-plugins.html:29
> +</body>

Hrm, it seems this could just be a pure js test in plugins/script-tests no? Look at navigator-mimeTypes-length.js for instance.
Comment 7 arno. 2012-12-04 12:48:33 PST
Created attachment 177530 [details]
Patch

updated patch
Comment 8 Xan Lopez 2012-12-05 03:14:36 PST
Comment on attachment 177530 [details]
Patch

Looks good to me, thanks.
Comment 9 WebKit Review Bot 2012-12-05 09:10:29 PST
Comment on attachment 177530 [details]
Patch

Clearing flags on attachment: 177530

Committed r136697: <http://trac.webkit.org/changeset/136697>
Comment 10 WebKit Review Bot 2012-12-05 09:10:33 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Ryosuke Niwa 2013-01-02 15:29:55 PST
The test added by this patch has been failing on Mac WebKit2:

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20-%20webkit.org&tests=plugins%2Fnavigator-plugins.html

--- /Volumes/Data/slave/mountainlion-release-tests-wk2/build/layout-test-results/plugins/navigator-plugins-expected.txt
+++ /Volumes/Data/slave/mountainlion-release-tests-wk2/build/layout-test-results/plugins/navigator-plugins-actual.txt
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS hasInvalidPlugin is false
+FAIL hasInvalidPlugin should be false. Was true.
 PASS successfullyParsed is true
 
 TEST COMPLETE
Comment 12 Ryosuke Niwa 2013-01-02 15:32:20 PST
Filed https://bugs.webkit.org/show_bug.cgi?id=105960 to track the test failure.