Closed
Bug 806523
Opened 13 years ago
Closed 12 years ago
Provide a way for plugins to detect which Windows environment they are running in
Categories
(Core Graveyard :: Plug-ins, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: jimm, Assigned: jimm)
References
Details
Attachments
(2 files, 4 obsolete files)
8.98 KB,
patch
|
jaas
:
review+
|
Details | Diff | Splinter Review |
8.90 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
Provide for plugins a way of knowing which Windows environment the browser is running in. We're thinking this can be through a new NPN_GetValue identifier. (PNVmetroBrowser?)
![]() |
Assignee | |
Updated•13 years ago
|
Whiteboard: metro-it2
Updated•13 years ago
|
Whiteboard: metro-it2 → [metro-it2]
![]() |
Assignee | |
Updated•13 years ago
|
Assignee: nobody → jmathies
![]() |
Assignee | |
Updated•13 years ago
|
Whiteboard: [metro-it2]
![]() |
Assignee | |
Comment 1•12 years ago
|
||
![]() |
Assignee | |
Comment 2•12 years ago
|
||
![]() |
Assignee | |
Comment 3•12 years ago
|
||
Attachment #699321 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 4•12 years ago
|
||
Comment on attachment 699320 [details] [diff] [review]
plugins v.1
This adds support for a metro/desktop flag that can be queried via NPN_GetValue.
Attachment #699320 -
Flags: review?(joshmoz)
![]() |
Assignee | |
Comment 5•12 years ago
|
||
Comment on attachment 699325 [details] [diff] [review]
metro browser tests
Adding a mochitest-metro-chrome test for the same. I'll be adding to these tests as I work through other windowless flash support bugs.
Attachment #699325 -
Flags: review?(mbrubeck)
![]() |
Assignee | |
Comment 6•12 years ago
|
||
Comment on attachment 699320 [details] [diff] [review]
plugins v.1
Review of attachment 699320 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/plugins/ipc/PluginInstanceParent.cpp
@@ +271,5 @@
> + NPError* result)
> +{
> + *result = NPERR_INVALID_PARAM;
> +#ifdef XP_WIN
> + NPWindowsEnvironment flag;
I didn't need this extra variable, I can just assign 'value' directly. Updated in my local copy.
Comment 7•12 years ago
|
||
Did this API get proposed to plugin-futures? npapi.h is imported from the npapi-sdk which is shared code.
![]() |
Assignee | |
Comment 8•12 years ago
|
||
(In reply to Benjamin Smedberg [:bsmedberg] from comment #7)
> Did this API get proposed to plugin-futures? npapi.h is imported from the
> npapi-sdk which is shared code.
No it did not, but but obviously can be. Who listens to plugin-futures? Before I do that though I'd like to get approval on the approach, including whatever I'll put together for bug 806513.
![]() |
Assignee | |
Comment 9•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #8)
> (In reply to Benjamin Smedberg [:bsmedberg] from comment #7)
> > Did this API get proposed to plugin-futures? npapi.h is imported from the
> > npapi-sdk which is shared code.
>
> No it did not, but but obviously can be. Who listens to plugin-futures?
> Before I do that though I'd like to get approval on the approach, including
> whatever I'll put together for bug 806513.
https://mail.mozilla.org/pipermail/plugin-futures/
Not a very busy list. I'll put something together to post at some point here.
Comment 10•12 years ago
|
||
Comment on attachment 699325 [details] [diff] [review]
metro browser tests
Review of attachment 699325 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/metro/base/tests/Makefile.in
@@ +17,5 @@
> browser_context_ui.js \
> browser_onscreen_keyboard.js \
> browser_onscreen_keyboard.html \
> browser_downloads.js \
> + browser_downloads.js \
Looks like a duplicate line snuck in by accident.
::: browser/metro/base/tests/browser_plugin_values.js
@@ +28,5 @@
> +
> + let utils = Cc["@mozilla.org/windows-metroutils;1"].createInstance(Ci.nsIWinMetroUtils);
> + is(plugin.getNPNVWindowsEnvironment(),
> + utils.immersive ? XRE_WindowsEnvironmentType_Metro : XRE_WindowsEnvironmentType_Desktop,
> + "Checking for expected windows environment");
Since these metro tests run only in the immersive environment, only one of these code paths will actually be tested. Should we add a corresponding desktop browser-chrome mochitest too?
::: browser/metro/profile/metro.js
@@ +395,5 @@
> +// test plugin so we can write tests for future plugin support.
> +pref("plugin.disable", false);
> +pref("dom.ipc.plugins.enabled", false);
> +pref("dom.ipc.plugins.java.enabled", false);
> +pref("dom.ipc.plugins.enabled.nptest.dll", true);
If possible, we should just set these prefs at the start of the plugin tests and reset them after the tests finish, rather than change our default config.
If I understand correctly, pref("dom.ipc.plugins.enabled", false) prevents plugins like Flash from running out-of-process but still lets them run in-process.
Attachment #699325 -
Flags: review?(mbrubeck) → review-
![]() |
Assignee | |
Comment 11•12 years ago
|
||
(In reply to Matt Brubeck (:mbrubeck) from comment #10)
> ::: browser/metro/base/tests/browser_plugin_values.js
> @@ +28,5 @@
> > +
> > + let utils = Cc["@mozilla.org/windows-metroutils;1"].createInstance(Ci.nsIWinMetroUtils);
> > + is(plugin.getNPNVWindowsEnvironment(),
> > + utils.immersive ? XRE_WindowsEnvironmentType_Metro : XRE_WindowsEnvironmentType_Desktop,
> > + "Checking for expected windows environment");
>
> Since these metro tests run only in the immersive environment, only one of
> these code paths will actually be tested. Should we add a corresponding
> desktop browser-chrome mochitest too?
Yes I've got a duplicate mochitest-plain test I can add to the test plugin tests that checks the value as well. I'll add it to the patch.
> ::: browser/metro/profile/metro.js
> @@ +395,5 @@
> > +// test plugin so we can write tests for future plugin support.
> > +pref("plugin.disable", false);
> > +pref("dom.ipc.plugins.enabled", false);
> > +pref("dom.ipc.plugins.java.enabled", false);
> > +pref("dom.ipc.plugins.enabled.nptest.dll", true);
>
> If possible, we should just set these prefs at the start of the plugin tests
> and reset them after the tests finish, rather than change our default config.
>
> If I understand correctly, pref("dom.ipc.plugins.enabled", false) prevents
> plugins like Flash from running out-of-process but still lets them run
> in-process.
I'll look. Maybe I can add something specific to metro tests somewhere. We set general pref in the test profile but I don't think I want to muck with those -
http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#372
Comment 12•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #11)
> I'll look. Maybe I can add something specific to metro tests somewhere. We
> set general pref in the test profile but I don't think I want to muck with
> those -
> http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#372
I just mean that you should use Services.prefs.setBoolPref("plugin.disable", false) at the start of your tests, and then clearUserPref("plugin.disable") in your test's cleanup code (or use SpecialPowers.pushPrefEnv which is a convenience function that does the same thing).
![]() |
Assignee | |
Comment 13•12 years ago
|
||
Attachment #699325 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 14•12 years ago
|
||
- pref cleanup
- moved update to PluginInstanceParent down to the plugins patch
Attachment #699447 -
Attachment is obsolete: true
Comment 15•12 years ago
|
||
Comment on attachment 699447 [details] [diff] [review]
metro browser tests
Review of attachment 699447 [details] [diff] [review]:
-----------------------------------------------------------------
r=mbrubeck but someone else should review the PluginInstanceParent.cpp change if they haven't already.
::: dom/plugins/test/mochitest/test_win8_values.html
@@ +1,3 @@
> +<html>
> +<head>
> + <title>Test New Windows 8 Related Values</title>
I think you need to add this to the Makefile.in (probably in a WINNT-only section).
Attachment #699447 -
Attachment is obsolete: false
Attachment #699447 -
Flags: review+
![]() |
Assignee | |
Comment 16•12 years ago
|
||
final rev with the makefile addition.
Attachment #699447 -
Attachment is obsolete: true
Attachment #699449 -
Attachment is obsolete: true
Attachment #699456 -
Flags: review+
Comment 17•12 years ago
|
||
Comment on attachment 699320 [details] [diff] [review]
plugins v.1
Review of attachment 699320 [details] [diff] [review]:
-----------------------------------------------------------------
The API should be proposed on plugin-futures, we can move on it quickly. Once we have a solution we can land in npapi-sdk and then sync NPAPI headers.
::: dom/plugins/ipc/PluginMessageUtils.h
@@ +892,5 @@
> }
> };
>
> +template <>
> +struct ParamTraits<NPWindowsEnvironment>
Is this type really necessary? Can we just use an int and cast?
Attachment #699320 -
Flags: review?(joshmoz) → review+
![]() |
Assignee | |
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•