Closed Bug 484923 Opened 14 years ago Closed 14 years ago

Test plugin needs to support windowed mode on GTK2/X

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

References

Details

Attachments

(1 file)

To test the compositor changes to hoist plugin widgets to the top-level window, we need the test plugin to support windowed mode (currently it's windowless only). This bug is about doing that for GTK2.

Here's my proposed API:

+== Windowed/windowless mode ==
+
+The test plugin is windowless by default.
+
+The test plugin supports the following parameter:
+
+* wmode="window"
+The plugin will be given a native widget on platforms that support this
+(Windows and X).
+
+The test plugin object supports the following scriptable method:
+
+* hasWidget()
+Returns true if the plugin has an associated widget. This will return true if
+wmode="window" was specified and the platform supports windowed plugins.

The hasWidget() method will be useful for tests that depend on the plugin being windowed (or not) --- they won't have to hardcode assumptions about which platforms support windowed or windowless.
I plan to do this for GTK2 first and file a separate bug for similar support on Windows.
Attached patch fixSplinter Review
As described. I couldn't resist cleaning up the test plugin code a little bit. In particular pluginDraw didn't need to be exposed to nptest.cpp. A bunch of functions could be static. I replaced the if/else stack in scriptableInvoke with a loop over an array. I've also had to add a pluginInstanceShutdown hook. I had to refactor the GTK2 drawing code to accomodate drawing into a plugin window.
Attachment #369210 - Flags: review?(joshmoz)
The patch is on top of the patch in bug 469831.
Comment on attachment 369210 [details] [diff] [review]
fix

Karl should review the GTK/GDK stuff.
Blocks: 485120
Attachment #369210 - Flags: review?(mozbugz) → review+
Attachment #369210 - Flags: review?(joshmoz) → review+
http://hg.mozilla.org/mozilla-central/rev/adbc4043e8bd
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
I noticed (in the context of your patch) that the Makefile looks a little goofy:
http://hg.mozilla.org/mozilla-central/annotate/2c97a6aeb0db/modules/plugin/test/mochitest/Makefile.in#l47

_TEST_FILES gets redefined. Can you just kill that first line the next time you touch this file?
Depends on: 486581
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.