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

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

Issue 2633133002: [devil] Upgrade parser/serializer for command line flags (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | devil/devil/android/file_changer_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/file_changer_devicetest.py
diff --git a/devil/devil/android/file_changer_devicetest.py b/devil/devil/android/file_changer_devicetest.py
deleted file mode 100644
index 277b96a4b03e7515580b32c27cb53459ede4826c..0000000000000000000000000000000000000000
--- a/devil/devil/android/file_changer_devicetest.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
perezju 2017/01/16 14:12:19 Didn't notice on my previous CL, file should be na
-# Copyright 2017 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""
-Unit tests for the contents of flag_changer.py.
-The test will invoke real devices
-"""
-
-import os
-import posixpath
-import sys
-import unittest
-
-if __name__ == '__main__':
- sys.path.append(
- os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', )))
-
-from devil.android import device_test_case
-from devil.android import device_utils
-from devil.android import flag_changer
-from devil.android.sdk import adb_wrapper
-
-
-_CMDLINE_FILE = 'dummy-command-line'
-
-
-class FlagChangerTest(device_test_case.DeviceTestCase):
-
- def setUp(self):
- super(FlagChangerTest, self).setUp()
- self.adb = adb_wrapper.AdbWrapper(self.serial)
- self.adb.WaitForDevice()
- self.device = device_utils.DeviceUtils(
- self.adb, default_timeout=10, default_retries=0)
- # pylint: disable=protected-access
- self.cmdline_path = posixpath.join(flag_changer._CMDLINE_DIR, _CMDLINE_FILE)
- self.cmdline_path_legacy = posixpath.join(
- flag_changer._CMDLINE_DIR_LEGACY, _CMDLINE_FILE)
-
- def tearDown(self):
- self.device.RemovePath(
- [self.cmdline_path, self.cmdline_path_legacy], force=True, as_root=True)
-
- def testFlagChanger(self):
- if not self.device.HasRoot():
- self.skipTest('Test needs a rooted device')
-
- # Write some custom chrome command line flags.
- self.device.WriteFile(
- self.cmdline_path, 'chrome --custom --flags')
-
- # Write some more flags on a command line file in the legacy location.
- self.device.WriteFile(
- self.cmdline_path_legacy, 'some --stray --flags', as_root=True)
- self.assertTrue(self.device.PathExists(self.cmdline_path_legacy))
-
- changer = flag_changer.FlagChanger(self.device, _CMDLINE_FILE)
-
- # Legacy command line file is removed, ensuring Chrome picks up the
- # 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.
-
- changer.Restore()
- # TODO(perezju): assert that flags are back to --custom --flags.
-
-
-if __name__ == '__main__':
- unittest.main()
« no previous file with comments | « no previous file | devil/devil/android/file_changer_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698