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

Unified Diff: tools/isolate/trace_inputs_smoke_test.py

Issue 10772002: Initial refactoring to eventually support touch-only access. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/isolate/trace_inputs.py ('k') | tools/isolate/trace_inputs_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/isolate/trace_inputs_smoke_test.py
diff --git a/tools/isolate/trace_inputs_smoke_test.py b/tools/isolate/trace_inputs_smoke_test.py
index dde74d4c933691aa5eaeaedaea42576d7a977998..c4fdca7f5e51383ad49694fa0ad4909a1a309fa0 100755
--- a/tools/isolate/trace_inputs_smoke_test.py
+++ b/tools/isolate/trace_inputs_smoke_test.py
@@ -559,6 +559,41 @@ class TraceInputsImport(TraceInputsBase):
self.assertTrue(actual['root'].pop('pid'))
self.assertEquals(expected, actual)
+ def _touch_expected(self, command):
+ # Look for file that were touched but not opened, using different APIs.
+ results = self._execute_trace(
+ [sys.executable, os.path.join('trace_inputs', 'touch_only.py'), command])
+ expected = {
+ 'root': {
+ 'children': [],
+ 'command': [
+ self.executable,
+ os.path.join('trace_inputs', 'touch_only.py'),
+ command,
+ ],
+ 'executable': self.real_executable,
+ 'files': [
+ {
+ 'path': os.path.join(u'data', 'trace_inputs', 'touch_only.py'),
+ 'size': self._size('data', 'trace_inputs', 'touch_only.py'),
+ },
+ ],
+ 'initial_cwd': self.initial_cwd,
+ },
+ }
+ actual = results.flatten()
+ self.assertTrue(actual['root'].pop('pid'))
+ self.assertEquals(expected, actual)
+
+ def test_trace_touch_only_access(self):
+ self._touch_expected('access')
+
+ def test_trace_touch_only_isfile(self):
+ self._touch_expected('isfile')
+
+ def test_trace_touch_only_stat(self):
+ self._touch_expected('stat')
+
if __name__ == '__main__':
VERBOSE = '-v' in sys.argv
« no previous file with comments | « tools/isolate/trace_inputs.py ('k') | tools/isolate/trace_inputs_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698