| 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 // Round a number to the 1's place. | 5 // Round a number to the 1's place. |
| 6 function formatNumber(str) { | 6 function formatNumber(str) { |
| 7 str += ''; | 7 str += ''; |
| 8 if (str == '0') { | 8 if (str == '0') { |
| 9 return 'N/A '; | 9 return 'N/A '; |
| 10 } | 10 } |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 chrome.benchmarking.closeConnections(); | 405 chrome.benchmarking.closeConnections(); |
| 406 } | 406 } |
| 407 setTimeout(me_.runPage, 100); | 407 setTimeout(me_.runPage, 100); |
| 408 } | 408 } |
| 409 | 409 |
| 410 // Update the UI | 410 // Update the UI |
| 411 me_.displayResults(); | 411 me_.displayResults(); |
| 412 }; | 412 }; |
| 413 } | 413 } |
| 414 | 414 |
| 415 chrome.extension.onConnect.addListener(function(port) { | 415 chrome.runtime.onConnect.addListener(function(port) { |
| 416 port.onMessage.addListener(function(data) { | 416 port.onMessage.addListener(function(data) { |
| 417 if (data.message == "load") { | 417 if (data.message == "load") { |
| 418 var benchmark = findBenchmark(data.url); | 418 var benchmark = findBenchmark(data.url); |
| 419 if (benchmark == undefined && benchmarkStillRunning()) { | 419 if (benchmark == undefined && benchmarkStillRunning()) { |
| 420 alert("Error: Loaded url(" + data.url + ") is not the same as what " + | 420 alert("Error: Loaded url(" + data.url + ") is not the same as what " + |
| 421 "you set in url box. This could happen if the request is " + | 421 "you set in url box. This could happen if the request is " + |
| 422 "redirected. Please use the redirected url for testing."); | 422 "redirected. Please use the redirected url for testing."); |
| 423 // Stop the test here. | 423 // Stop the test here. |
| 424 benchmarks = []; | 424 benchmarks = []; |
| 425 } | 425 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 if ( (urlSubStr1 == httpStr) || (urlSubStr2 == httpsStr) ) { | 484 if ( (urlSubStr1 == httpStr) || (urlSubStr2 == httpsStr) ) { |
| 485 return true; | 485 return true; |
| 486 } | 486 } |
| 487 return false; | 487 return false; |
| 488 } | 488 } |
| 489 | 489 |
| 490 // Run at startup | 490 // Run at startup |
| 491 chrome.windows.getCurrent(function(currentWindow) { | 491 chrome.windows.getCurrent(function(currentWindow) { |
| 492 window.windowId = currentWindow.id; | 492 window.windowId = currentWindow.id; |
| 493 }); | 493 }); |
| OLD | NEW |