OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 document.cookie = "__navigated_to_report=0; path=/"; | 5 document.cookie = "__navigated_to_report=0; path=/"; |
6 document.cookie = "__pc_done=0; path=/"; | 6 document.cookie = "__pc_done=0; path=/"; |
7 document.cookie = "__pc_timings=; path=/"; | 7 document.cookie = "__pc_timings=; path=/"; |
8 | 8 |
9 function dirname(path) { | 9 function dirname(path) { |
10 var match = path.match(/(.*)\//); | 10 var match = path.match(/(.*)\//); |
(...skipping 53 matching lines...) Loading... |
64 if (!config["shouldStart"]) { | 64 if (!config["shouldStart"]) { |
65 status_element.textContent = | 65 status_element.textContent = |
66 "Press 'Start' to continue (or load this page with 'auto=1')."; | 66 "Press 'Start' to continue (or load this page with 'auto=1')."; |
67 return; | 67 return; |
68 } | 68 } |
69 | 69 |
70 try { | 70 try { |
71 var reportDir = dirname(dirname(window.location.pathname)) + "/common"; | 71 var reportDir = dirname(dirname(window.location.pathname)) + "/common"; |
72 config["reportUrl"] = "file://" + reportDir + "/report.html"; | 72 config["reportUrl"] = "file://" + reportDir + "/report.html"; |
73 config["isRecordMode"] = isRecordMode; | 73 config["isRecordMode"] = isRecordMode; |
74 var port = chrome.extension.connect(); | 74 var port = chrome.runtime.connect(); |
75 port.postMessage({message: "start", benchmark: config}); | 75 port.postMessage({message: "start", benchmark: config}); |
76 console.log("sending start message: page count, " + | 76 console.log("sending start message: page count, " + |
77 config["pageSets"].length); | 77 config["pageSets"].length); |
78 } catch(err) { | 78 } catch(err) { |
79 console.log("TryStart retrying after exception: " + err); | 79 console.log("TryStart retrying after exception: " + err); |
80 status_element.textContent = "Exception: " + err; | 80 status_element.textContent = "Exception: " + err; |
81 setTimeout(TryStart, 1000); | 81 setTimeout(TryStart, 1000); |
82 return; | 82 return; |
83 } | 83 } |
84 status_element.textContent = "STARTING"; | 84 status_element.textContent = "STARTING"; |
85 } | 85 } |
86 | 86 |
87 // We wait before starting the test just to let chrome warm up better. | 87 // We wait before starting the test just to let chrome warm up better. |
88 setTimeout(TryStart, 250); | 88 setTimeout(TryStart, 250); |
OLD | NEW |