Bug 749795 - Use neglected code that properly obtains private browsing mode in plugins. r=josh

This commit is contained in:
Josh Matthews 2012-04-30 09:46:27 +02:00
parent af97db1f76
commit 2c88d5dfbc
2 changed files with 12 additions and 2 deletions

View File

@ -1126,8 +1126,7 @@ _getvalue(NPP aNPP,
case NPNVasdEnabledBool: // Intentional fall-through
case NPNVisOfflineBool: // Intentional fall-through
case NPNVSupportsXEmbedBool: // Intentional fall-through
case NPNVSupportsWindowless: // Intentional fall-through
case NPNVprivateModeBool: {
case NPNVSupportsWindowless: { // Intentional fall-through
NPError result;
bool value;
PluginModuleChild::current()->

View File

@ -65,6 +65,17 @@ function runTests() {
is(state1, true, "Private mode state reported incorrectly.");
is(state2, true, "Private mode state reported incorrectly.");
var officialState1, officialState2;
try {
officialState1 = pluginElement1.queryPrivateModeState();
officialState2 = pluginElement2.queryPrivateModeState();
} catch (e) {
exceptionThrown = true;
}
is(exceptionThrown, false, "Exception thrown getting private mode state.");
is(officialState1, state1, "Private mode reported and queried is inconsistent.");
is(officialState2, state2, "Private mode reported and queried is inconsistent.");
// reset preference states
privateBrowsing.privateBrowsingEnabled = false;
prefs.setBoolPref("browser.privatebrowsing.keep_current_session", keepCurrentSession);