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

Unified Diff: Source/WebCore/inspector/front-end/TestController.js

Issue 12224049: Merge 140539 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 10 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: Source/WebCore/inspector/front-end/TestController.js
===================================================================
--- Source/WebCore/inspector/front-end/TestController.js (revision 142083)
+++ Source/WebCore/inspector/front-end/TestController.js (working copy)
@@ -28,33 +28,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/**
- * @constructor
- */
-WebInspector.TestController = function()
-{
-}
-
-WebInspector.TestController.prototype = {
- notifyDone: function(callId, result)
- {
- var message = typeof result === "undefined" ? "\"<undefined>\"" : JSON.stringify(result);
- RuntimeAgent.evaluate("didEvaluateForTestInFrontend(" + callId + ", " + message + ")", "test");
- }
-}
-
WebInspector.evaluateForTestInFrontend = function(callId, script)
{
- window.isUnderTest = true;
+ if (!InspectorFrontendHost.isUnderTest())
+ return;
+
function invokeMethod()
{
+ var message;
try {
script = script + "//@ sourceURL=evaluateInWebInspector" + callId + ".js";
var result = window.eval(script);
- WebInspector.TestController.prototype.notifyDone(callId, result);
+ message = typeof result === "undefined" ? "\"<undefined>\"" : JSON.stringify(result);
} catch (e) {
- WebInspector.TestController.prototype.notifyDone(callId, e.toString());
+ message = e.toString();
}
+ RuntimeAgent.evaluate("didEvaluateForTestInFrontend(" + callId + ", " + message + ")", "test");
}
InspectorBackend.runAfterPendingDispatches(invokeMethod);
}
« no previous file with comments | « Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js ('k') | Source/WebCore/inspector/front-end/externs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698