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

Side by Side Diff: tools/isolate/trace_inputs_smoke_test.py

Issue 10748009: Add touch-only detection for strace API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « tools/isolate/trace_inputs.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import shutil 9 import shutil
10 import subprocess 10 import subprocess
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 'root': { 567 'root': {
568 'children': [], 568 'children': [],
569 'command': [ 569 'command': [
570 self.executable, 570 self.executable,
571 os.path.join('trace_inputs', 'touch_only.py'), 571 os.path.join('trace_inputs', 'touch_only.py'),
572 command, 572 command,
573 ], 573 ],
574 'executable': self.real_executable, 574 'executable': self.real_executable,
575 'files': [ 575 'files': [
576 { 576 {
577 'path': os.path.join(u'data', 'trace_inputs', 'test_file.txt'),
578 'size': 0,
579 },
580 {
577 'path': os.path.join(u'data', 'trace_inputs', 'touch_only.py'), 581 'path': os.path.join(u'data', 'trace_inputs', 'touch_only.py'),
578 'size': self._size('data', 'trace_inputs', 'touch_only.py'), 582 'size': self._size('data', 'trace_inputs', 'touch_only.py'),
579 }, 583 },
580 ], 584 ],
581 'initial_cwd': self.initial_cwd, 585 'initial_cwd': self.initial_cwd,
582 }, 586 },
583 } 587 }
588 if sys.platform != 'linux2':
589 # TODO(maruel): Remove once properly implemented.
590 expected['root']['files'].pop(0)
591
584 actual = results.flatten() 592 actual = results.flatten()
585 self.assertTrue(actual['root'].pop('pid')) 593 self.assertTrue(actual['root'].pop('pid'))
586 self.assertEquals(expected, actual) 594 self.assertEquals(expected, actual)
587 595
588 def test_trace_touch_only_access(self): 596 def test_trace_touch_only_access(self):
589 self._touch_expected('access') 597 self._touch_expected('access')
590 598
591 def test_trace_touch_only_isfile(self): 599 def test_trace_touch_only_isfile(self):
592 self._touch_expected('isfile') 600 self._touch_expected('isfile')
593 601
594 def test_trace_touch_only_stat(self): 602 def test_trace_touch_only_stat(self):
595 self._touch_expected('stat') 603 self._touch_expected('stat')
596 604
597 605
598 if __name__ == '__main__': 606 if __name__ == '__main__':
599 VERBOSE = '-v' in sys.argv 607 VERBOSE = '-v' in sys.argv
600 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) 608 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
601 unittest.main() 609 unittest.main()
OLDNEW
« no previous file with comments | « tools/isolate/trace_inputs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698