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

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance_test.py

Issue 2854823007: Move screenshot capture to Java-side. (Closed)
Patch Set: Move screenshot capture to Java-side. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for instrumentation_test_instance.""" 6 """Unit tests for instrumentation_test_instance."""
7 7
8 # pylint: disable=protected-access 8 # pylint: disable=protected-access
9 9
10 import collections 10 import collections
(...skipping 30 matching lines...) Expand all
41 mock.MagicMock(), mock.MagicMock(), lambda s: None) 41 mock.MagicMock(), mock.MagicMock(), lambda s: None)
42 42
43 _FlagAttributesArgs = collections.namedtuple( 43 _FlagAttributesArgs = collections.namedtuple(
44 '_FlagAttributesArgs', 44 '_FlagAttributesArgs',
45 [ 45 [
46 'command_line_flags', 46 'command_line_flags',
47 'device_flags_file', 47 'device_flags_file',
48 'strict_mode', 48 'strict_mode',
49 'regenerate_goldens', 49 'regenerate_goldens',
50 'test_arguments', 50 'test_arguments',
51 'gs_results_bucket',
52 'screenshot_dir',
51 ]) 53 ])
52 54
53 def createFlagAttributesArgs( 55 def createFlagAttributesArgs(
54 self, command_line_flags=None, device_flags_file=None, 56 self, command_line_flags=None, device_flags_file=None,
55 strict_mode=None, regenerate_goldens=None, test_arguments=None): 57 strict_mode=None, regenerate_goldens=None, test_arguments=None,
58 gs_results_bucket=None, screenshot_dir=None):
56 return self._FlagAttributesArgs( 59 return self._FlagAttributesArgs(
57 command_line_flags, device_flags_file, strict_mode, 60 command_line_flags, device_flags_file, strict_mode,
58 regenerate_goldens, test_arguments) 61 regenerate_goldens, test_arguments, gs_results_bucket, screenshot_dir)
59 62
60 def test_initializeFlagAttributes_commandLineFlags(self): 63 def test_initializeFlagAttributes_commandLineFlags(self):
61 o = self.createTestInstance() 64 o = self.createTestInstance()
62 args = self.createFlagAttributesArgs(command_line_flags=['--foo', '--bar']) 65 args = self.createFlagAttributesArgs(command_line_flags=['--foo', '--bar'])
63 o._initializeFlagAttributes(args) 66 o._initializeFlagAttributes(args)
64 self.assertEquals(o._flags, ['--enable-test-intents', '--foo', '--bar']) 67 self.assertEquals(o._flags, ['--enable-test-intents', '--foo', '--bar'])
65 68
66 def test_initializeFlagAttributes_deviceFlagsFile(self): 69 def test_initializeFlagAttributes_deviceFlagsFile(self):
67 o = self.createTestInstance() 70 o = self.createTestInstance()
68 with tempfile.NamedTemporaryFile() as flags_file: 71 with tempfile.NamedTemporaryFile() as flags_file:
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 }), 723 }),
721 ] 724 ]
722 results = instrumentation_test_instance.GenerateTestResults( 725 results = instrumentation_test_instance.GenerateTestResults(
723 None, None, statuses, 0, 1000) 726 None, None, statuses, 0, 1000)
724 self.assertEqual(1, len(results)) 727 self.assertEqual(1, len(results))
725 self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType()) 728 self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType())
726 729
727 730
728 if __name__ == '__main__': 731 if __name__ == '__main__':
729 unittest.main(verbosity=2) 732 unittest.main(verbosity=2)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698