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

Side by Side Diff: third_party/WebKit/PerformanceTests/Pywebsocket/resources/util_performance_test.js

Issue 2844633002: Remove blink_perf.pywebsocket tests (Closed)
Patch Set: Rebase Created 3 years, 7 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
OLDNEW
(Empty)
1 const numIterations = 10;
2 const numWarmUpIterations = 5;
3
4 function startPerformanceTest(connectionType, benchmarkName,
5 dataType, isWorker, async, verifyData){
6 var iframe = document.createElement('iframe');
7 if (connectionType === 'WebSocket') {
8 iframe.src = "http://localhost:8001/performance_test_iframe.html";
9 } else if (connectionType === 'XHR') {
10 iframe.src = "http://localhost:8001/xhr_performance_test_iframe.html";
11 } else {
12 iframe.src = "http://localhost:8001/fetch_performance_test_iframe.html";
13 }
14 iframe.onload = function() {
15 var child = iframe.contentWindow;
16 PerfTestRunner.prepareToMeasureValuesAsync({
17 done: function() {
18 child.postMessage({'command': 'stop'},
19 'http://localhost:8001');
20 },
21 unit: 'ms',
22 iterationCount: numIterations
23 });
24
25 child.postMessage({'command': 'start',
26 'connectionType': connectionType,
27 'benchmarkName': benchmarkName,
28 'dataType': dataType,
29 'isWorker': isWorker,
30 'async': async,
31 'verifyData': verifyData,
32 'numIterations': numIterations,
33 'numWarmUpIterations': numWarmUpIterations},
34 'http://localhost:8001');
35 };
36 document.body.appendChild(iframe);
37 }
38
39 onmessage = function(message) {
40 if (message.data.command === 'log') {
41 PerfTestRunner.log(message.data.value);
42 } else if (message.data.command === 'measureValue') {
43 PerfTestRunner.measureValueAsync(message.data.value);
44 PerfTestRunner.gc();
45 } else if (message.data.command === 'notifyAbort') {
46 PerfTestRunner.logFatalError("benchmark aborted");
47 }
48 };
OLDNEW
« no previous file with comments | « third_party/WebKit/PerformanceTests/Pywebsocket/resources/generate.py ('k') | tools/perf/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698