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

Unified Diff: tools/android/loading/loading_trace_analyzer_unittest.py

Issue 1907603003: tools/android/loading: rm testdata/rollingstone.trace.gz (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | tools/android/loading/testdata/rollingstone.trace.gz » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/loading_trace_analyzer_unittest.py
diff --git a/tools/android/loading/loading_trace_analyzer_unittest.py b/tools/android/loading/loading_trace_analyzer_unittest.py
deleted file mode 100644
index b01aab2b9018cb0c187ab9ed5fe40383fdfc7d78..0000000000000000000000000000000000000000
--- a/tools/android/loading/loading_trace_analyzer_unittest.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2016 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.
-
-import gzip
-import os
-import re
-import shutil
-import subprocess
-import tempfile
-import unittest
-
-import loading_trace_analyzer
-
-LOADING_DIR = os.path.dirname(__file__)
-TEST_DATA_DIR = os.path.join(LOADING_DIR, 'testdata')
-
-
-class LoadingTraceAnalyzerTest(unittest.TestCase):
- _ROLLING_STONE = os.path.join(TEST_DATA_DIR, 'rollingstone.trace.gz')
-
- def setUp(self):
- self._temp_dir = tempfile.mkdtemp()
- self.trace_path = self._TmpPath('trace.json')
- with gzip.GzipFile(self._ROLLING_STONE) as f:
- with open(self.trace_path, 'w') as g:
- g.write(f.read())
-
- def tearDown(self):
- shutil.rmtree(self._temp_dir)
-
- def _TmpPath(self, name):
- return os.path.join(self._temp_dir, name)
-
- def testRequestsCmd(self):
- lines = [r for r in loading_trace_analyzer.ListRequests(self.trace_path)]
- self.assertNotEqual(0, len(lines))
-
- lines = [r for r in loading_trace_analyzer.ListRequests(self.trace_path,
- output_format='hello {protocol} world {url}')]
- self.assertNotEqual(0, len(lines))
- for line in lines:
- self.assertTrue(re.match(r'^hello \S+ world \S+$', line))
-
- lines = [r for r in loading_trace_analyzer.ListRequests(self.trace_path,
- where_format='{url}', where_statement=r'^http://.*$')]
- self.assertNotEqual(0, len(lines))
- for line in lines:
- self.assertTrue(line.startswith('http://'))
-
- lines = [r for r in loading_trace_analyzer.ListRequests(self.trace_path,
- where_format='{url}', where_statement=r'^https://.*$')]
- self.assertNotEqual(0, len(lines))
- for line in lines:
- self.assertTrue(line.startswith('https://'))
-
-
-if __name__ == '__main__':
- unittest.main()
« no previous file with comments | « no previous file | tools/android/loading/testdata/rollingstone.trace.gz » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698