Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: third_party/mozprofile/tests/bug758250.py

Issue 108313011: Adding mozilla libraries required by Firefox interop test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/mozprofile/tests/addonid.py ('k') | third_party/mozprofile/tests/empty/install.rdf » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mozprofile/tests/bug758250.py
===================================================================
--- third_party/mozprofile/tests/bug758250.py (revision 0)
+++ third_party/mozprofile/tests/bug758250.py (revision 0)
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+import mozprofile
+import os
+import shutil
+import tempfile
+import unittest
+
+here = os.path.dirname(os.path.abspath(__file__))
+
+class Bug758250(unittest.TestCase):
+ """
+ use of --profile in mozrunner just blows away addon sources:
+ https://bugzilla.mozilla.org/show_bug.cgi?id=758250
+ """
+
+ def test_profile_addon_cleanup(self):
+
+ # sanity check: the empty addon should be here
+ empty = os.path.join(here, 'empty')
+ self.assertTrue(os.path.exists(empty))
+ self.assertTrue(os.path.isdir(empty))
+ self.assertTrue(os.path.exists(os.path.join(empty, 'install.rdf')))
+
+ # because we are testing data loss, let's make sure we make a copy
+ tmpdir = tempfile.mktemp()
+ shutil.copytree(empty, tmpdir)
+ self.assertTrue(os.path.exists(os.path.join(tmpdir, 'install.rdf')))
+
+ # make a starter profile
+ profile = mozprofile.FirefoxProfile()
+ path = profile.profile
+
+ # make a new profile based on the old
+ newprofile = mozprofile.FirefoxProfile(profile=path, addons=[tmpdir])
+ newprofile.cleanup()
+
+ # the source addon *should* still exist
+ self.assertTrue(os.path.exists(tmpdir))
+ self.assertTrue(os.path.exists(os.path.join(tmpdir, 'install.rdf')))
+
+ # remove vestiges
+ shutil.rmtree(tmpdir)
+
+if __name__ == '__main__':
+ unittest.main()
Property changes on: third_party/mozprofile/tests/bug758250.py
___________________________________________________________________
Added: svn:eol-style
+ LF
Added: svn:executable
+ *
« no previous file with comments | « third_party/mozprofile/tests/addonid.py ('k') | third_party/mozprofile/tests/empty/install.rdf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698