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

Unified Diff: test/js-perf-test/Inspector/run.js

Issue 2962213002: Make String16 consturctors non-inline to save binary size (150kb) (Closed)
Patch Set: add perftest Created 3 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 side-by-side diff with in-line comments
Download patch
Index: test/js-perf-test/Inspector/run.js
diff --git a/test/js-perf-test/Inspector/run.js b/test/js-perf-test/Inspector/run.js
index 8636b004713734df94318125542e3ba9e4961152..cde30909279e6c308d7f8ab0590f75dd250679d0 100644
--- a/test/js-perf-test/Inspector/run.js
+++ b/test/js-perf-test/Inspector/run.js
@@ -5,8 +5,11 @@
load('../base.js');
load('debugger.js');
+load('runtime.js');
-var success = true;
+let success = true;
+let lastId = 0;
+let prevMessage = null;
function PrintResult(name, result) {
print(name + '-Inspector(Score): ' + result);
@@ -26,3 +29,19 @@ BenchmarkSuite.config.doDeterministic = undefined;
BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
NotifyError: PrintError,
NotifyStep: PrintStep });
+
+function receive(message) {
+ prevMessage = JSON.parse(message);
+}
+
+function SendMessage(method, params) {
+ let obj = {id: ++lastId, method: method};
+ if (params) {
+ obj.params = params;
+ }
+ send(JSON.stringify(obj));
+ if (prevMessage && prevMessage.id == lastId) {
+ return prevMessage;
+ }
+ return null;
+}

Powered by Google App Engine
This is Rietveld 408576698