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

Unified Diff: devil/devil/android/flag_changer_devicetest.py

Issue 2633133002: [devil] Upgrade parser/serializer for command line flags (Closed)
Patch Set: logging nit Created 3 years, 11 months 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
Index: devil/devil/android/flag_changer_devicetest.py
diff --git a/devil/devil/android/file_changer_devicetest.py b/devil/devil/android/flag_changer_devicetest.py
similarity index 83%
rename from devil/devil/android/file_changer_devicetest.py
rename to devil/devil/android/flag_changer_devicetest.py
index 277b96a4b03e7515580b32c27cb53459ede4826c..f5d19d6007a138c7d6b7bedf6ddd04319a6b2ff4 100644
--- a/devil/devil/android/file_changer_devicetest.py
+++ b/devil/devil/android/flag_changer_devicetest.py
@@ -48,7 +48,7 @@ class FlagChangerTest(device_test_case.DeviceTestCase):
# Write some custom chrome command line flags.
self.device.WriteFile(
- self.cmdline_path, 'chrome --custom --flags')
+ self.cmdline_path, 'chrome --some --old --flags')
# Write some more flags on a command line file in the legacy location.
self.device.WriteFile(
@@ -61,11 +61,16 @@ class FlagChangerTest(device_test_case.DeviceTestCase):
# right file.
self.assertFalse(self.device.PathExists(self.cmdline_path_legacy))
- changer.ReplaceFlags(['--my', '--new', '--flags'])
- # TODO(perezju): assert that new flags are now set.
+ # Write some new files, and check they are set.
+ new_flags = ['--my', '--new', '--flags=with special value']
+ self.assertItemsEqual(
+ changer.ReplaceFlags(new_flags),
+ new_flags)
- changer.Restore()
- # TODO(perezju): assert that flags are back to --custom --flags.
+ # Restore and go back to the old flags.
+ self.assertItemsEqual(
+ changer.Restore(),
+ ['--some', '--old', '--flags'])
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698