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

Unified Diff: chrome/test/functional/tracing/timeline_model.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 9 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: chrome/test/functional/tracing/timeline_model.py
===================================================================
--- chrome/test/functional/tracing/timeline_model.py (revision 261231)
+++ chrome/test/functional/tracing/timeline_model.py (working copy)
@@ -1,57 +0,0 @@
-# Copyright (c) 2012 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 json
-import os
-
-
-class TimelineModel(object):
- """A proxy for about:tracing's TimelineModel class.
-
- Test authors should never need to know that this class is a proxy.
- """
- @staticmethod
- def _EscapeForQuotedJavascriptExecution(js):
- # Poor man's string escape.
- return js.replace('\'', '\\\'');
-
- def __init__(self, js_executor, shim_id):
- self._js_executor = js_executor
- self._shim_id = shim_id
-
- # Warning: The JSON serialization process removes cyclic references.
- # TODO(eatnumber): regenerate these cyclic references on deserialization.
- def _CallModelMethod(self, method_name, *args):
- result = self._js_executor(
- """window.timelineModelShims['%s'].invokeMethod('%s', '%s')""" % (
- self._shim_id,
- self._EscapeForQuotedJavascriptExecution(method_name),
- self._EscapeForQuotedJavascriptExecution(json.dumps(args))
- )
- )
- if result['success']:
- return result['data']
- # TODO(eatnumber): Make these exceptions more reader friendly.
- raise RuntimeError(result)
-
- def __del__(self):
- self._js_executor("""
- window.timelineModelShims['%s'] = undefined;
- window.domAutomationController.send('');
- """ % self._shim_id)
-
- def GetAllThreads(self):
- return self._CallModelMethod('getAllThreads')
-
- def GetAllCpus(self):
- return self._CallModelMethod('getAllCpus')
-
- def GetAllProcesses(self):
- return self._CallModelMethod('getAllProcesses')
-
- def GetAllCounters(self):
- return self._CallModelMethod('getAllCounters')
-
- def FindAllThreadsNamed(self, name):
- return self._CallModelMethod('findAllThreadsNamed', name);
« no previous file with comments | « chrome/test/functional/tracing/tab_tracker.py ('k') | chrome/test/functional/tracing/timeline_model_shim.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698