Bug 978045 - Move plugin tests in browser/base/content/tests/general to browser/base/content/tests/plugins. r=jaws

--HG--
rename : browser/base/content/test/general/blockNoPlugins.xml => browser/base/content/test/plugins/blockNoPlugins.xml
rename : browser/base/content/test/general/blockPluginHard.xml => browser/base/content/test/plugins/blockPluginHard.xml
rename : browser/base/content/test/general/blockPluginVulnerableNoUpdate.xml => browser/base/content/test/plugins/blockPluginVulnerableNoUpdate.xml
rename : browser/base/content/test/general/blockPluginVulnerableUpdatable.xml => browser/base/content/test/plugins/blockPluginVulnerableUpdatable.xml
rename : browser/base/content/test/general/browser_CTP_context_menu.js => browser/base/content/test/plugins/browser_CTP_context_menu.js
rename : browser/base/content/test/general/browser_CTP_crashreporting.js => browser/base/content/test/plugins/browser_CTP_crashreporting.js
rename : browser/base/content/test/general/browser_CTP_data_urls.js => browser/base/content/test/plugins/browser_CTP_data_urls.js
rename : browser/base/content/test/general/browser_CTP_drag_drop.js => browser/base/content/test/plugins/browser_CTP_drag_drop.js
rename : browser/base/content/test/general/browser_CTP_hide_overlay.js => browser/base/content/test/plugins/browser_CTP_hide_overlay.js
rename : browser/base/content/test/general/browser_CTP_multi_allow.js => browser/base/content/test/plugins/browser_CTP_multi_allow.js
rename : browser/base/content/test/general/browser_CTP_nonplugins.js => browser/base/content/test/plugins/browser_CTP_nonplugins.js
rename : browser/base/content/test/general/browser_CTP_notificationBar.js => browser/base/content/test/plugins/browser_CTP_notificationBar.js
rename : browser/base/content/test/general/browser_CTP_outsideScrollArea.js => browser/base/content/test/plugins/browser_CTP_outsideScrollArea.js
rename : browser/base/content/test/general/browser_CTP_resize.js => browser/base/content/test/plugins/browser_CTP_resize.js
rename : browser/base/content/test/general/browser_bug743421.js => browser/base/content/test/plugins/browser_bug743421.js
rename : browser/base/content/test/general/browser_bug744745.js => browser/base/content/test/plugins/browser_bug744745.js
rename : browser/base/content/test/general/browser_bug752516.js => browser/base/content/test/plugins/browser_bug752516.js
rename : browser/base/content/test/general/browser_bug787619.js => browser/base/content/test/plugins/browser_bug787619.js
rename : browser/base/content/test/general/browser_bug797677.js => browser/base/content/test/plugins/browser_bug797677.js
rename : browser/base/content/test/general/browser_bug812562.js => browser/base/content/test/plugins/browser_bug812562.js
rename : browser/base/content/test/general/browser_bug818118.js => browser/base/content/test/plugins/browser_bug818118.js
rename : browser/base/content/test/general/browser_bug820497.js => browser/base/content/test/plugins/browser_bug820497.js
rename : browser/base/content/test/general/browser_clearplugindata.html => browser/base/content/test/plugins/browser_clearplugindata.html
rename : browser/base/content/test/general/browser_clearplugindata.js => browser/base/content/test/plugins/browser_clearplugindata.js
rename : browser/base/content/test/general/browser_clearplugindata_noage.html => browser/base/content/test/plugins/browser_clearplugindata_noage.html
rename : browser/base/content/test/general/browser_pageInfo_plugins.js => browser/base/content/test/plugins/browser_pageInfo_plugins.js
rename : browser/base/content/test/general/browser_pluginCrashCommentAndURL.js => browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js
rename : browser/base/content/test/general/browser_pluginnotification.js => browser/base/content/test/plugins/browser_pluginnotification.js
rename : browser/base/content/test/general/browser_pluginplaypreview.js => browser/base/content/test/plugins/browser_pluginplaypreview.js
rename : browser/base/content/test/general/browser_pluginplaypreview2.js => browser/base/content/test/plugins/browser_pluginplaypreview2.js
rename : browser/base/content/test/general/browser_plugins_added_dynamically.js => browser/base/content/test/plugins/browser_plugins_added_dynamically.js
rename : browser/base/content/test/general/plugin_add_dynamically.html => browser/base/content/test/plugins/plugin_add_dynamically.html
rename : browser/base/content/test/general/plugin_alternate_content.html => browser/base/content/test/plugins/plugin_alternate_content.html
rename : browser/base/content/test/general/plugin_big.html => browser/base/content/test/plugins/plugin_big.html
rename : browser/base/content/test/general/plugin_both.html => browser/base/content/test/plugins/plugin_both.html
rename : browser/base/content/test/general/plugin_both2.html => browser/base/content/test/plugins/plugin_both2.html
rename : browser/base/content/test/general/plugin_bug744745.html => browser/base/content/test/plugins/plugin_bug744745.html
rename : browser/base/content/test/general/plugin_bug749455.html => browser/base/content/test/plugins/plugin_bug749455.html
rename : browser/base/content/test/general/plugin_bug752516.html => browser/base/content/test/plugins/plugin_bug752516.html
rename : browser/base/content/test/general/plugin_bug787619.html => browser/base/content/test/plugins/plugin_bug787619.html
rename : browser/base/content/test/general/plugin_bug797677.html => browser/base/content/test/plugins/plugin_bug797677.html
rename : browser/base/content/test/general/plugin_bug820497.html => browser/base/content/test/plugins/plugin_bug820497.html
rename : browser/base/content/test/general/plugin_clickToPlayAllow.html => browser/base/content/test/plugins/plugin_clickToPlayAllow.html
rename : browser/base/content/test/general/plugin_clickToPlayDeny.html => browser/base/content/test/plugins/plugin_clickToPlayDeny.html
rename : browser/base/content/test/general/pluginCrashCommentAndURL.html => browser/base/content/test/plugins/plugin_crashCommentAndURL.html
rename : browser/base/content/test/general/plugin_data_url.html => browser/base/content/test/plugins/plugin_data_url.html
rename : browser/base/content/test/general/plugin_hidden_to_visible.html => browser/base/content/test/plugins/plugin_hidden_to_visible.html
rename : browser/base/content/test/general/plugin_outsideScrollArea.html => browser/base/content/test/plugins/plugin_outsideScrollArea.html
rename : browser/base/content/test/general/plugin_overlayed.html => browser/base/content/test/plugins/plugin_overlayed.html
rename : browser/base/content/test/general/plugin_positioned.html => browser/base/content/test/plugins/plugin_positioned.html
rename : browser/base/content/test/general/plugin_small.html => browser/base/content/test/plugins/plugin_small.html
rename : browser/base/content/test/general/plugin_syncRemoved.html => browser/base/content/test/plugins/plugin_syncRemoved.html
rename : browser/base/content/test/general/plugin_test.html => browser/base/content/test/plugins/plugin_test.html
rename : browser/base/content/test/general/plugin_test2.html => browser/base/content/test/plugins/plugin_test2.html
rename : browser/base/content/test/general/plugin_test3.html => browser/base/content/test/plugins/plugin_test3.html
rename : browser/base/content/test/general/plugin_two_types.html => browser/base/content/test/plugins/plugin_two_types.html
rename : browser/base/content/test/general/plugin_unknown.html => browser/base/content/test/plugins/plugin_unknown.html
This commit is contained in:
Georg Fritzsche 2014-03-03 17:10:51 +01:00
parent 521adc80bb
commit 6b687dd749
62 changed files with 186 additions and 66 deletions

View File

@ -6,15 +6,9 @@ support-files =
app_bug575561.html
app_subframe_bug575561.html
authenticate.sjs
blockNoPlugins.xml
blockPluginHard.xml
blockPluginVulnerableNoUpdate.xml
blockPluginVulnerableUpdatable.xml
browser_bug479408_sample.html
browser_bug678392-1.html
browser_bug678392-2.html
browser_clearplugindata.html
browser_clearplugindata_noage.html
browser_registerProtocolHandler_notification.html
browser_star_hsts.sjs
browser_tab_dragdrop2_frame1.xul
@ -65,32 +59,6 @@ support-files =
offlineQuotaNotification.cacheManifest
offlineQuotaNotification.html
page_style_sample.html
plugin_add_dynamically.html
plugin_alternate_content.html
plugin_big.html
plugin_both.html
plugin_both2.html
plugin_bug744745.html
plugin_bug749455.html
plugin_bug752516.html
plugin_bug787619.html
plugin_bug797677.html
plugin_bug820497.html
plugin_clickToPlayAllow.html
plugin_clickToPlayDeny.html
plugin_data_url.html
plugin_hidden_to_visible.html
plugin_outsideScrollArea.html
plugin_overlayed.html
plugin_positioned.html
plugin_small.html
plugin_syncRemoved.html
plugin_test.html
plugin_test2.html
plugin_test3.html
plugin_two_types.html
plugin_unknown.html
pluginCrashCommentAndURL.html
print_postdata.sjs
redirect_bug623155.sjs
test-mixedcontent-securityerrors.html
@ -111,18 +79,6 @@ support-files =
test_no_mcb_on_http_site_font2.css
xul_tooltiptext.xhtml
[browser_CTP_context_menu.js]
skip-if = toolkit == "gtk2" || toolkit == "gtk3" # browser_CTP_context_menu.js fails intermittently on Linux (bug 909342)
[browser_CTP_crashreporting.js]
run-if = crashreporter
[browser_CTP_data_urls.js]
[browser_CTP_drag_drop.js]
[browser_CTP_hide_overlay.js]
[browser_CTP_multi_allow.js]
[browser_CTP_nonplugins.js]
[browser_CTP_notificationBar.js]
[browser_CTP_outsideScrollArea.js]
[browser_CTP_resize.js]
[browser_URLBarSetURI.js]
[browser_aboutAccounts.js]
skip-if = os == "linux" # Bug 958026
@ -229,21 +185,13 @@ skip-if = os == "mac" # Intermittent failures, bug 925225
[browser_bug724239.js]
[browser_bug734076.js]
[browser_bug735471.js]
[browser_bug743421.js]
[browser_bug744745.js]
[browser_bug749738.js]
[browser_bug752516.js]
[browser_bug763468_perwindowpb.js]
[browser_bug767836_perwindowpb.js]
[browser_bug771331.js]
[browser_bug783614.js]
[browser_bug787619.js]
[browser_bug797677.js]
[browser_bug812562.js]
[browser_bug816527.js]
[browser_bug817947.js]
[browser_bug818118.js]
[browser_bug820497.js]
[browser_bug822367.js]
[browser_bug832435.js]
[browser_bug839103.js]
@ -252,7 +200,6 @@ skip-if = os == "mac" # Intermittent failures, bug 925225
[browser_bug902156.js]
[browser_bug906190.js]
[browser_canonizeURL.js]
[browser_clearplugindata.js]
[browser_contentAreaClick.js]
[browser_contextSearchTabPosition.js]
skip-if = os == "mac" # bug 967013, bug 926729
@ -288,16 +235,9 @@ skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (
[browser_offlineQuotaNotification.js]
[browser_overflowScroll.js]
[browser_pageInfo.js]
[browser_pageInfo_plugins.js]
[browser_page_style_menu.js]
[browser_pinnedTabs.js]
[browser_plainTextLinks.js]
[browser_pluginnotification.js]
[browser_pluginplaypreview.js]
[browser_pluginplaypreview2.js]
[browser_pluginCrashCommentAndURL.js]
run-if = crashreporter
[browser_plugins_added_dynamically.js]
[browser_popupNotification.js]
skip-if = toolkit == "windows" # Disabled on Windows due to frequent failures (bugs 825739, 841341)
[browser_popupUI.js]

View File

@ -0,0 +1,64 @@
[DEFAULT]
support-files =
blockNoPlugins.xml
blockPluginHard.xml
blockPluginVulnerableNoUpdate.xml
blockPluginVulnerableUpdatable.xml
browser_clearplugindata.html
browser_clearplugindata_noage.html
head.js
plugin_add_dynamically.html
plugin_alternate_content.html
plugin_big.html
plugin_both.html
plugin_both2.html
plugin_bug744745.html
plugin_bug749455.html
plugin_bug752516.html
plugin_bug787619.html
plugin_bug797677.html
plugin_bug820497.html
plugin_clickToPlayAllow.html
plugin_clickToPlayDeny.html
plugin_data_url.html
plugin_hidden_to_visible.html
plugin_outsideScrollArea.html
plugin_overlayed.html
plugin_positioned.html
plugin_small.html
plugin_syncRemoved.html
plugin_test.html
plugin_test2.html
plugin_test3.html
plugin_two_types.html
plugin_unknown.html
plugin_crashCommentAndURL.html
[browser_bug743421.js]
[browser_bug744745.js]
[browser_bug752516.js]
[browser_bug787619.js]
[browser_bug797677.js]
[browser_bug812562.js]
[browser_bug818118.js]
[browser_bug820497.js]
[browser_clearplugindata.js]
[browser_CTP_context_menu.js]
skip-if = toolkit == "gtk2" || toolkit == "gtk3" # browser_CTP_context_menu.js fails intermittently on Linux (bug 909342)
[browser_CTP_crashreporting.js]
run-if = crashreporter
[browser_CTP_data_urls.js]
[browser_CTP_drag_drop.js]
[browser_CTP_hide_overlay.js]
[browser_CTP_multi_allow.js]
[browser_CTP_nonplugins.js]
[browser_CTP_notificationBar.js]
[browser_CTP_outsideScrollArea.js]
[browser_CTP_resize.js]
[browser_pageInfo_plugins.js]
[browser_pluginnotification.js]
[browser_pluginplaypreview.js]
[browser_pluginplaypreview2.js]
[browser_pluginCrashCommentAndURL.js]
run-if = crashreporter
[browser_plugins_added_dynamically.js]

View File

@ -1,4 +1,5 @@
const gTestRoot = "http://mochi.test:8888/browser/browser/base/content/test/general/";
var rootDir = getRootDirectory(gTestPath);
const gTestRoot = rootDir.replace("chrome://mochitests/content/", "http://mochi.test:8888/");
var gTestBrowser = null;
var gNextTest = null;

View File

@ -3,9 +3,12 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
var rootDir = getRootDirectory(gTestPath);
const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://mochi.test:8888/");
// Test clearing plugin data using sanitize.js.
const testURL1 = "http://mochi.test:8888/browser/browser/base/content/test/general/browser_clearplugindata.html";
const testURL2 = "http://mochi.test:8888/browser/browser/base/content/test/general/browser_clearplugindata_noage.html";
const testURL1 = gHttpTestRoot + "browser_clearplugindata.html";
const testURL2 = gHttpTestRoot + "browser_clearplugindata_noage.html";
let tempScope = {};
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)

View File

@ -4,7 +4,7 @@
Cu.import("resource://gre/modules/Services.jsm");
const CRASH_URL = "http://example.com/browser/browser/base/content/test/general/pluginCrashCommentAndURL.html";
const CRASH_URL = "http://example.com/browser/browser/base/content/test/plugins/plugin_crashCommentAndURL.html";
const SERVER_URL = "http://example.com/browser/toolkit/crashreporter/test/browser/crashreport.sjs";

View File

@ -1,4 +1,5 @@
const gTestRoot = "http://mochi.test:8888/browser/browser/base/content/test/general/";
var rootDir = getRootDirectory(gTestPath);
const gTestRoot = rootDir.replace("chrome://mochitests/content/", "http://mochi.test:8888/");
let gTestBrowser = null;
let gNextTest = null;

View File

@ -0,0 +1,110 @@
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/commonjs/sdk/core/promise.js");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
function whenDelayedStartupFinished(aWindow, aCallback) {
Services.obs.addObserver(function observer(aSubject, aTopic) {
if (aWindow == aSubject) {
Services.obs.removeObserver(observer, aTopic);
executeSoon(aCallback);
}
}, "browser-delayed-startup-finished", false);
}
function findChromeWindowByURI(aURI) {
let windows = Services.wm.getEnumerator(null);
while (windows.hasMoreElements()) {
let win = windows.getNext();
if (win.location.href == aURI)
return win;
}
return null;
}
function waitForCondition(condition, nextTest, errorMsg) {
var tries = 0;
var interval = setInterval(function() {
if (tries >= 30) {
ok(false, errorMsg);
moveOn();
}
var conditionPassed;
try {
conditionPassed = condition();
} catch (e) {
ok(false, e + "\n" + e.stack);
conditionPassed = false;
}
if (conditionPassed) {
moveOn();
}
tries++;
}, 100);
var moveOn = function() { clearInterval(interval); nextTest(); };
}
function getTestPlugin(aName) {
var pluginName = aName || "Test Plug-in";
var ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
var tags = ph.getPluginTags();
// Find the test plugin
for (var i = 0; i < tags.length; i++) {
if (tags[i].name == pluginName)
return tags[i];
}
ok(false, "Unable to find plugin");
return null;
}
// call this to set the test plugin(s) initially expected enabled state.
// it will automatically be reset to it's previous value after the test
// ends
function setTestPluginEnabledState(newEnabledState, pluginName) {
var plugin = getTestPlugin(pluginName);
var oldEnabledState = plugin.enabledState;
plugin.enabledState = newEnabledState;
SimpleTest.registerCleanupFunction(function() {
getTestPlugin(pluginName).enabledState = oldEnabledState;
});
}
// after a test is done using the plugin doorhanger, we should just clear
// any permissions that may have crept in
function clearAllPluginPermissions() {
let perms = Services.perms.enumerator;
while (perms.hasMoreElements()) {
let perm = perms.getNext();
if (perm.type.startsWith('plugin')) {
Services.perms.remove(perm.host, perm.type);
}
}
}
function updateBlocklist(aCallback) {
var blocklistNotifier = Cc["@mozilla.org/extensions/blocklist;1"]
.getService(Ci.nsITimerCallback);
var observer = function() {
Services.obs.removeObserver(observer, "blocklist-updated");
SimpleTest.executeSoon(aCallback);
};
Services.obs.addObserver(observer, "blocklist-updated", false);
blocklistNotifier.notify(null);
}
var _originalTestBlocklistURL = null;
function setAndUpdateBlocklist(aURL, aCallback) {
if (!_originalTestBlocklistURL)
_originalTestBlocklistURL = Services.prefs.getCharPref("extensions.blocklist.url");
Services.prefs.setCharPref("extensions.blocklist.url", aURL);
updateBlocklist(aCallback);
}
function resetBlocklist() {
Services.prefs.setCharPref("extensions.blocklist.url", _originalTestBlocklistURL);
}

View File

@ -325,7 +325,7 @@ function resetBlocklist(aCallback) {
// XXX - this has "forked" from the head.js helpers in our parent directory :(
// But let's reuse their blockNoPlugins.xml. Later, we should arrange to
// use their head.js helpers directly
let noBlockedURL = "http://example.com/browser/browser/base/content/test/general/blockNoPlugins.xml";
let noBlockedURL = "http://example.com/browser/browser/base/content/test/plugins/blockNoPlugins.xml";
setAndUpdateBlocklist(noBlockedURL, function() {
Services.prefs.setCharPref("extensions.blocklist.url", _originalTestBlocklistURL);
if (aCallback)

View File

@ -15,6 +15,7 @@ MOCHITEST_CHROME_MANIFESTS += [
BROWSER_CHROME_MANIFESTS += [
'content/test/general/browser.ini',
'content/test/newtab/browser.ini',
'content/test/plugins/browser.ini',
'content/test/social/browser.ini',
]