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

Side by Side Diff: tools/page_cycler/webpagereplay/extension/page_cycler.js

Issue 9956045: Add Web Page Replay test to page cycler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review. Created 8 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 WriteReport(sessionLoader) {
6 var iterations = window.iterations;
7 var reportUrl = window.benchmarkConfiguration.reportUrl;
8 var resultsCollection = sessionLoader.getResultsCollection();
9 var times = resultsCollection.getTotalTimes();
10 var pages = resultsCollection.getPages();
11
12 reportUrl += "?n=" + iterations;
13 reportUrl += "&i=" + iterations * pages.length; // "cycles"
14 reportUrl += "&td=" + Array.sum(times); // total time
15 reportUrl += "&tf=" + 0; // fudge time
16 console.log('reportUrl: ' + reportUrl);
17 chrome.cookies.set({
18 "url": reportUrl,
19 "name": "__pc_done",
20 "value": "1",
21 "path": "/",
22 });
23 chrome.cookies.set({
24 "url": reportUrl,
25 "name": "__pc_pages",
26 "value": pages.map(function(x) {
27 return x.replace(/=/g, "%3D");
28 }).join(","),
29 "path": "/",
30 });
31 chrome.cookies.set({
32 "url": reportUrl,
33 "name": "__pc_timings",
34 "value": times.join(","),
35 "path": "/",
36 });
37
38 chrome.tabs.getSelected(null, function(tab) {
39 console.log("Navigate to the report.");
40 chrome.tabs.update(tab.id, {"url": reportUrl}, null);
41 });
42 }
43
44 AddBenchmarkCallback(WriteReport);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698