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

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

Issue 10736055: Smoke test for tracing infrastructure in PyAuto (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Smoke test for tracing infrastructure in PyAuto 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 function invokeJsMethodFromPython(targetObject, methodName, args) {
2 var sendToPython = function(obj) {
nduca 2012/07/18 05:51:35 How about this being tracing_test_shim.js -- and f
nduca 2012/07/18 05:51:35 This is a private method, only to be called by the
3 // We use sendJSON here because domAutomationController's send() chokes
4 // on large amounts of data. Inside of send() it converts the arg to
5 // JSON and invokes sendJSON. The JSON conversion is what fails. This
nduca 2012/07/18 05:51:35 Why does the json conversion fail?
6 // way works around the bad code, but necessitates a double JSON
7 // conversion as the recieving python converts from JSON before passing
8 // it back to the pyauto test.
9 window.domAutomationController.sendJSON(
10 JSON.stringify(
nduca 2012/07/18 05:51:35 I'm so confused. This makes no sense. Also, does s
11 JSON.stringify(obj)
12 )
13 );
14 };
15 try {
nduca 2012/07/18 05:51:35 Why are you sourcing this file every time? You cou
16 sendToPython({
nduca 2012/07/18 05:51:35 Can't you break this up into individual lines inst
17 success: true,
18 data: targetObject[methodName].apply(targetObject, JSON.parse(args))
19 });
20 } catch( e ) {
21 var ret = {
22 success: false,
23 message: 'Unspecified error'
24 };
25 if( typeof(e) == 'string' || e instanceof String ) {
26 ret.message = e;
27 } else {
28 if( e.stack != undefined ) ret.stack = e.stack;
29 if( e.message != undefined ) ret.message = e.message;
30 }
31 // First we'll try sending with the exception embedded, and if that
32 // doesn't work, try sending without the exception.
nduca 2012/07/18 05:51:35 What? Why?
33 try {
34 sendToPython(ret);
35 } catch(e2) {
36 ret.exception = undefined;
37 sendToPython(ret);
38 }
39 throw e;
40 }
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698