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

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

Issue 1606903002: tools/android/loading: Archive tracks in LoadingTrace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
Index: tools/android/loading/tracing_driver.py
diff --git a/tools/android/loading/tracing_driver.py b/tools/android/loading/tracing_driver.py
deleted file mode 100755
index c62e8705c2175fdf186397c8e8f30c8747221650..0000000000000000000000000000000000000000
--- a/tools/android/loading/tracing_driver.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /usr/bin/python
-# 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.
-
-"""Drive TracingConnection"""
-
-import argparse
-import json
-import logging
-import os.path
-import sys
-
-_SRC_DIR = os.path.abspath(os.path.join(
- os.path.dirname(__file__), '..', '..', '..'))
-
-sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'catapult', 'devil'))
-from devil.android import device_utils
-
-sys.path.append(os.path.join(_SRC_DIR, 'build', 'android'))
-import device_setup
-import page_track
-import tracing
-
-
-def main():
- logging.basicConfig(level=logging.INFO)
- parser = argparse.ArgumentParser()
- parser.add_argument('--url', required=True)
- parser.add_argument('--output', required=True)
- args = parser.parse_args()
- url = args.url
- if not url.startswith('http'):
- url = 'http://' + url
- device = device_utils.DeviceUtils.HealthyDevices()[0]
- with file(args.output, 'w') as output, \
- file(args.output + '.page', 'w') as page_output, \
- device_setup.DeviceConnection(device) as connection:
- track = tracing.TracingTrack(connection, fetch_stream=False)
- page = page_track.PageTrack(connection)
- connection.SetUpMonitoring()
- connection.SendAndIgnoreResponse('Page.navigate', {'url': url})
- connection.StartMonitoring()
- json.dump(page.GetEvents(), page_output, sort_keys=True, indent=2)
- json.dump(track.GetEvents(), output, sort_keys=True, indent=2)
-
-
-if __name__ == '__main__':
- main()

Powered by Google App Engine
This is Rietveld 408576698