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

Side by Side Diff: third_party/mozprofile/tests/test_nonce.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
Property Changes:
Added: svn:eol-style
+ LF
Added: svn:executable
+ *
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 """
4 test nonce in prefs delimeters
5 see https://bugzilla.mozilla.org/show_bug.cgi?id=722804
6 """
7
8 import os
9 import tempfile
10 import time
11 import unittest
12 from mozprofile.prefs import Preferences
13 from mozprofile.profile import Profile
14
15 class PreferencesNonceTest(unittest.TestCase):
16
17 def test_nonce(self):
18
19 # make a profile with one preference
20 path = tempfile.mktemp()
21 profile = Profile(path,
22 preferences={'foo': 'bar'},
23 restore=False)
24 user_js = os.path.join(profile.profile, 'user.js')
25 self.assertTrue(os.path.exists(user_js))
26
27 # ensure the preference is correct
28 prefs = Preferences.read_prefs(user_js)
29 self.assertEqual(dict(prefs), {'foo': 'bar'})
30
31 del profile
32
33 # augment the profile with a second preference
34 profile = Profile(path,
35 preferences={'fleem': 'baz'},
36 restore=True)
37 prefs = Preferences.read_prefs(user_js)
38 self.assertEqual(dict(prefs), {'foo': 'bar', 'fleem': 'baz'})
39
40 # cleanup the profile;
41 # this should remove the new preferences but not the old
42 profile.cleanup()
43 prefs = Preferences.read_prefs(user_js)
44 self.assertEqual(dict(prefs), {'foo': 'bar'})
45
46 if __name__ == '__main__':
47 unittest.main()
OLDNEW
« no previous file with comments | « third_party/mozprofile/tests/server_locations.py ('k') | third_party/mozprofile/tests/test_preferences.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698