Bug 1307516 - Port bug 1269807 to Thunderbird, set pref plugin.load_flash_only. r=aceman
authorJorg K
Wed, 05 Oct 2016 22:23:16 +0200
changeset 20516 b2a89654fd4bef893adeee46b18c2c2bf6abb53c
parent 20515 4f5fd1fc0bbaac8fcdd561c0348cbfb102196e7e
child 20517 86ced6e7669214ed2e09b49aaa4bb366b864e66c
push id12380
push usermozilla@jorgk.com
push dateWed, 05 Oct 2016 20:24:13 +0000
treeherdercomm-central@b2a89654fd4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1307516, 1269807
Bug 1307516 - Port bug 1269807 to Thunderbird, set pref plugin.load_flash_only. r=aceman
mail/test/mozmill/content-policy/prefs.js
mail/test/mozmill/content-policy/wrapper.py
mail/test/mozmill/content-tabs/prefs.js
new file mode 100644
--- /dev/null
+++ b/mail/test/mozmill/content-policy/prefs.js
@@ -0,0 +1,1 @@
+pref("plugin.load_flash_only", false);
new file mode 100644
--- /dev/null
+++ b/mail/test/mozmill/content-policy/wrapper.py
@@ -0,0 +1,24 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+import shutil
+import sys
+
+def on_profile_created(profiledir):
+    """
+    On profile creation, this copies prefs.js from the current folder to
+    profile_dir/preferences. This is a somewhat undocumented feature -- anything
+    in profile_dir/preferences gets treated as a default pref, which is what we
+    want here.
+    """
+    prefdir = os.path.join(profiledir, "preferences")
+    # This needs to be a directory, so if it's a file, raise an exception
+    if os.path.isfile(prefdir):
+        raise Exception("%s needs to be a directory, but is a file" % prefdir)
+    if not os.path.exists(prefdir):
+        os.mkdir(prefdir)
+    # The pref file is in the same directory this script is in.
+    preffile = os.path.join(os.path.dirname(__file__), "prefs.js")
+    shutil.copy(preffile, prefdir)
--- a/mail/test/mozmill/content-tabs/prefs.js
+++ b/mail/test/mozmill/content-tabs/prefs.js
@@ -1,1 +1,2 @@
 pref("extensions.blocklist.url", "http://localhost:43336/dummy.xml");
+pref("plugin.load_flash_only", false);