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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
Added: svn:executable
+ *
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 import mozprofile
4 import os
5 import shutil
6 import tempfile
7 import unittest
8
9 here = os.path.dirname(os.path.abspath(__file__))
10
11 class Bug758250(unittest.TestCase):
12 """
13 use of --profile in mozrunner just blows away addon sources:
14 https://bugzilla.mozilla.org/show_bug.cgi?id=758250
15 """
16
17 def test_profile_addon_cleanup(self):
18
19 # sanity check: the empty addon should be here
20 empty = os.path.join(here, 'empty')
21 self.assertTrue(os.path.exists(empty))
22 self.assertTrue(os.path.isdir(empty))
23 self.assertTrue(os.path.exists(os.path.join(empty, 'install.rdf')))
24
25 # because we are testing data loss, let's make sure we make a copy
26 tmpdir = tempfile.mktemp()
27 shutil.copytree(empty, tmpdir)
28 self.assertTrue(os.path.exists(os.path.join(tmpdir, 'install.rdf')))
29
30 # make a starter profile
31 profile = mozprofile.FirefoxProfile()
32 path = profile.profile
33
34 # make a new profile based on the old
35 newprofile = mozprofile.FirefoxProfile(profile=path, addons=[tmpdir])
36 newprofile.cleanup()
37
38 # the source addon *should* still exist
39 self.assertTrue(os.path.exists(tmpdir))
40 self.assertTrue(os.path.exists(os.path.join(tmpdir, 'install.rdf')))
41
42 # remove vestiges
43 shutil.rmtree(tmpdir)
44
45 if __name__ == '__main__':
46 unittest.main()
OLDNEW
« 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