From 0ec0ca7bbaa2059d78f36522e2ef0f5882e05f0c Mon Sep 17 00:00:00 2001 From: "zach%zachlipton.com" Date: Sat, 5 Aug 2006 22:33:32 +0000 Subject: [PATCH] Use the new navigator.buildID construct as a build id detection method. Also, if [%defaultbuildid%] exists from the same testing session, default to that so we don't wipe out tbird build ids, etc... --- .../en/default/runtests/sysconfig.html.tmpl | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/webtools/litmus/templates/en/default/runtests/sysconfig.html.tmpl b/webtools/litmus/templates/en/default/runtests/sysconfig.html.tmpl index 9ccf646d41b4..3f7e573c2333 100755 --- a/webtools/litmus/templates/en/default/runtests/sysconfig.html.tmpl +++ b/webtools/litmus/templates/en/default/runtests/sysconfig.html.tmpl @@ -59,16 +59,20 @@ var appBuildID = [% IF defaultbuildid %] [% ELSE %] "0000000000"; [% END %] -try { - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); - var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] - .getService(Components.interfaces.nsIXULAppInfo); - if(appInfo.appBuildID) { - appBuildID = appInfo.appBuildID; - } -} catch (e) { - // Cascade to the next lookup method. -} +if (navigator.buildID && appBuildID == "0000000000") { + appBuildID=navigator.buildID; +} else if (appBuildID == "0000000000") { + try { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] + .getService(Components.interfaces.nsIXULAppInfo); + if(appInfo.appBuildID) { + appBuildID = appInfo.appBuildID; + } + } catch (e) { + // Cascade to the next lookup method. + } +} var buildIDHelpTitle = 'How do I determine the build ID?'; var buildIDHelpText = '

The build ID is a 10-digit number that identifies a Mozilla product build down to the date and hour of the build. By supplying the full, correct build ID, you will be making the job of the Mozilla QA team much easier. There are several different ways to determine the build ID of the build you are testing.

  1. Manually: Provided you have installed Talkback, this is the fail-safe method, and allows you to submit the build ID for products other than the one currently being used to submit the results. The Mozilla Quality Assurance wiki has instructions on how to manually verify the build ID.
  2. Nightly Tester Tools: Available for both Firefox and Thunderbird, the Nightly Tester Tools extension adds a number of useful features for testing Mozilla products. This includes a handy display of the build ID of the running build in the title bar. You can download this extension from addons.mozilla.org.
  3. Automatic detection: Litmus has JavaScript code built-in to automatically detect the build ID of the current build, but it relies on JavaScript codebase principals to do so. To enable codebase principals, testers must add this line to the prefs.js file in their Mozilla user profile dir, or simply edit the pref directly in about:config:

    user_pref("signed.applets.codebase_principal_support", true);

    NOTE: this will only be useful if you are submitting results for the currently running version of Firefox. If you are concerned about the security issues of enabling codebase support, you can read more about codebase principals here.
';