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

Side by Side Diff: chrome/test/functional/tracing/timeline_model_shim.js

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function TimelineModelShim() {
6 tracing.TimelineModel.apply(this, arguments);
7 }
8
9 TimelineModelShim.prototype = {
10 __proto__: tracing.TimelineModel.prototype,
11
12 invokeMethod: function(methodName, args) {
13 var sendToPython = function(obj) {
14 // We use sendJSON here because domAutomationController's send() chokes on
15 // large amounts of data. Inside of send() it converts the arg to JSON and
16 // invokes sendJSON. The JSON conversion is what fails. This way works
17 // around the bad code, but note that the recieving python converts from
18 // JSON before passing it back to the pyauto test.
19 window.domAutomationController.sendJSON(
20 JSON.stringify(obj)
21 );
22 };
23 var result;
24 try {
25 result = this[methodName].apply(this, JSON.parse(args));
26 } catch( e ) {
27 var ret = {
28 success: false,
29 message: 'Unspecified error',
30 };
31 // We'll try sending the entire exception. If that doesn't work, it's ok.
32 try {
33 ret.exception = JSON.stringify(e);
34 } catch(e2) {}
35 if( typeof(e) == 'string' || e instanceof String ) {
36 ret.message = e;
37 } else {
38 if( e.stack != undefined ) ret.stack = e.stack;
39 if( e.message != undefined ) ret.message = e.message;
40 }
41 sendToPython(ret);
42 throw e;
43 }
44 sendToPython({
45 success: true,
46 data: result
47 });
48 }
49 },
50
51 // This causes the PyAuto ExecuteJavascript call which executed this file to
52 // return.
53 window.domAutomationController.send('');
OLDNEW
« no previous file with comments | « chrome/test/functional/tracing/timeline_model.py ('k') | chrome/test/functional/tracing/tracer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698