Title: [130669] trunk/PerformanceTests
- Revision
- 130669
- Author
- [email protected]
- Date
- 2012-10-08 12:02:06 -0700 (Mon, 08 Oct 2012)
Log Message
Perf test pesults page takes forever to load on a machine with a slow Internet connection
https://bugs.webkit.org/show_bug.cgi?id=98561
Reviewed by Ojan Vafai.
Try loading jquery both locally and remotely, and use the same method to load the remaining
jquery plugins when either one succeeds.
* resources/results-template.html:
Modified Paths
Diff
Modified: trunk/PerformanceTests/ChangeLog (130668 => 130669)
--- trunk/PerformanceTests/ChangeLog 2012-10-08 19:00:38 UTC (rev 130668)
+++ trunk/PerformanceTests/ChangeLog 2012-10-08 19:02:06 UTC (rev 130669)
@@ -1,3 +1,15 @@
+2012-10-08 Ryosuke Niwa <[email protected]>
+
+ Perf test pesults page takes forever to load on a machine with a slow Internet connection
+ https://bugs.webkit.org/show_bug.cgi?id=98561
+
+ Reviewed by Ojan Vafai.
+
+ Try loading jquery both locally and remotely, and use the same method to load the remaining
+ jquery plugins when either one succeeds.
+
+ * resources/results-template.html:
+
2012-10-04 Hayato Ito <[email protected]>
[Refactoring] Introduce a traversal strategy in SelectorChecker
Modified: trunk/PerformanceTests/resources/results-template.html (130668 => 130669)
--- trunk/PerformanceTests/resources/results-template.html 2012-10-08 19:00:38 UTC (rev 130668)
+++ trunk/PerformanceTests/resources/results-template.html 2012-10-08 19:02:06 UTC (rev 130669)
@@ -2,13 +2,6 @@
<html>
<head>
<title>WebKit Performance Test Results</title>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script id="json" type="application/json">%PeformanceTestsResultsJSON%</script>
<style type="text/css">
section {
@@ -136,24 +129,56 @@
Result <span id="time-memory" class="checkbox"><span class="checked">Time</span><span>Memory</span></span>
Reference <span id="reference" class="checkbox"></span>
</div>
+<table id="container"></table>
<script>
-$(document).ready(function () {
- $('.checkbox').each(function (index, checkbox) {
- $(checkbox).children('span').click(function (event) {
- if ($(this).hasClass('checked'))
- return;
- $(checkbox).children('span').removeClass('checked');
- $(this).addClass('checked');
- $(checkbox).trigger('change', $(this));
+(function () {
+ var jQuery = ['PerformanceTests/Dromaeo/resources/dromaeo/web/lib/jquery-1.6.4.js'];
+ var plugins = ['PerformanceTests/resources/jquery.flot.min.js', 'PerformanceTests/resources/jquery.tablesorter.min.js'];
+ var localPath = '%AbsolutePathToWebKitTrunk%';
+ var remotePath = 'https://svn.webkit.org/repository/webkit/trunk';
+ var numberOfFailures = 0;
+ var startedLoadingPlugins = false;
+ var numberOfLoadedPlugins = 0;
+
+ function loadScript(src, loaded, failed) {
+ var script = document.createElement('script');
+ script.async = true;
+ script.src = ""
+ script._onload_ = loaded;
+ if (failed)
+ script._onerror_ = failed;
+ document.body.appendChild(script);
+ }
+
+ function loadPlugins(trunkPath) {
+ for (var i = 0; i < plugins.length; i++)
+ loadScript(trunkPath + '/' + plugins[i], loadedPlugin, createFailedToLoadPlugin(plugins[i]));
+ }
+
+ function loadedPlugin() {
+ numberOfLoadedPlugins++;
+ if (numberOfLoadedPlugins == plugins.length)
+ setTimeout(init, 0);
+ }
+
+ function createFailedToLoadPlugin(plugin) {
+ return function () { alert("Failed to load " + plugin); }
+ }
+
+ function createLoadedJQuery(trunkPath) {
+ return function () { loadPlugins(trunkPath); }
+ }
+
+ loadScript(localPath + '/' + jQuery,
+ createLoadedJQuery(localPath),
+ function () {
+ loadScript(remotePath + '/' + jQuery,
+ createLoadedJQuery(localPath),
+ function () { alert("Failed to load jQuery."); });
});
- });
-})
+})();
-</script>
-<table id="container"></table>
-<script>
-
function TestResult(associatedTest, result, associatedRun) {
this.unit = function () { return result.unit; }
this.test = function () { return associatedTest; }
@@ -480,6 +505,16 @@
}
function init() {
+ $('.checkbox').each(function (index, checkbox) {
+ $(checkbox).children('span').click(function (event) {
+ if ($(this).hasClass('checked'))
+ return;
+ $(checkbox).children('span').removeClass('checked');
+ $(this).addClass('checked');
+ $(checkbox).trigger('change', $(this));
+ });
+ });
+
$.tablesorter.addParser({
id: 'comparison',
is: function(s) {
@@ -523,8 +558,7 @@
});
}
-init();
-
</script>
+<script id="json" type="application/json">%PeformanceTestsResultsJSON%</script>
</body>
</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes