From d8128bb293fbee28a6614389dbb1b7cdeee87f50 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 9 Aug 2004 21:24:03 +0000 Subject: [PATCH] Add DHTML performance test. Bug 169770, r=dbaron git-svn-id: svn://10.0.0.236/trunk@160549 18797224-902f-48f8-a5cc-f745e15eee43 --- .../tools/tinderbox/build-seamonkey-util.pl | 59 ++++++++++++++++++- mozilla/tools/tinderbox/tinder-defaults.pl | 2 + 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/mozilla/tools/tinderbox/build-seamonkey-util.pl b/mozilla/tools/tinderbox/build-seamonkey-util.pl index 7fcbe501e86..cfe1d7e7fc3 100644 --- a/mozilla/tools/tinderbox/build-seamonkey-util.pl +++ b/mozilla/tools/tinderbox/build-seamonkey-util.pl @@ -24,7 +24,7 @@ use Config; # for $Config{sig_name} and $Config{sig_num} use File::Find (); use File::Copy; -$::UtilsVersion = '$Revision: 1.268 $ '; +$::UtilsVersion = '$Revision: 1.269 $ '; package TinderUtils; @@ -1684,6 +1684,7 @@ sub run_all_tests { # if ($pref_file && $test_result eq 'success') { #XXX lame if($Settings::LayoutPerformanceTest or + $Settings::DHTMLPerformanceTest or $Settings::XULWindowOpenTest or $Settings::StartupPerformanceTest or $Settings::MailBloatTest or @@ -1879,6 +1880,21 @@ sub run_all_tests { @app_args); } + # DHTML performance test. + if ($Settings::DHTMLPerformanceTest and $test_result eq 'success') { + my @app_args; + if($Settings::BinaryName eq "TestGtkEmbed" || + $Settings::BinaryName =~ /^firefox/) { + @app_args = [$binary]; + } else { + @app_args = [$binary, "-P", $Settings::MozProfileName]; + } + + $test_result = DHTMLPerformanceTest("DHTMLPerformanceTest", + $build_dir, + @app_args); + } + # QA test: Client-side JS, DOM/HTML/Views, form submission. if ($Settings::QATest and $test_result eq 'success') { $test_result = QATest("QATest", @@ -2173,6 +2189,47 @@ sub LayoutPerformanceTest { return $layout_test_result; } +sub DHTMLPerformanceTest { + my ($test_name, $build_dir, $args) = @_; + my $dhtml_test_result; + my $dhtml_time; + my $dhtml_time_details; + my $binary_log = "$build_dir/$test_name.log"; + my $url = "http://www.mozilla.org/performance/test-cases/dhtml/runTests.html"; + + # Settle OS. + run_system_cmd("sync; sleep 5", 35); + + $dhtml_time = AliveTestReturnToken($test_name, + $build_dir, + [@$args, $url], + $Settings::LayoutPerformanceTestTimeout, + "_x_x_mozilla_dhtml", + ","); + + if($dhtml_time) { + $dhtml_test_result = 'success'; + } else { + $dhtml_test_result = 'testfailed'; + } + + if($dhtml_test_result eq 'success') { + my $time = POSIX::strftime "%Y:%m:%d:%H:%M:%S", localtime; + + if ($Settings::TestsPhoneHome) { + print_log "TinderboxPrint:" . + "Tdhtml:" . $dhtml_time . "ms\n"; + send_results_to_server($dhtml_time, "--", "dhtml", ::hostname()); + } else { + print_log "TinderboxPrint:" . + "Tdhtml:" . $dhtml_time . "ms\n"; + } + } + + return $dhtml_test_result; +} + # # Codesize test. Needs: cvs checkout mozilla/tools/codesighs diff --git a/mozilla/tools/tinderbox/tinder-defaults.pl b/mozilla/tools/tinderbox/tinder-defaults.pl index e0afbaf3527..a9d8fd96340 100644 --- a/mozilla/tools/tinderbox/tinder-defaults.pl +++ b/mozilla/tools/tinderbox/tinder-defaults.pl @@ -37,6 +37,7 @@ $EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns $MailBloatTest = 0; $EmbedTest = 0; # Assumes you wanted $BuildEmbed=1 $LayoutPerformanceTest = 0; # Tp +$DHTMLPerformanceTest = 0; # Tdhtml $QATest = 0; $XULWindowOpenTest = 0; # Txul $StartupPerformanceTest = 0; # Ts @@ -63,6 +64,7 @@ $XpcomGlueTestTimeout = 15; $CodesizeTestTimeout = 900; # seconds $CodesizeTestType = "auto"; # {"auto"|"base"} $LayoutPerformanceTestTimeout = 1200; # entire test, seconds +$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds $QATestTimeout = 1200; # entire test, seconds $LayoutPerformanceTestPageTimeout = 30000; # each page, ms $StartupPerformanceTestTimeout = 60; # seconds