mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 08:45:46 +00:00
Backed out changeset c2f648fbcbf1 (bug 1533861) for test_TelemetryEnvironment.js failures
This commit is contained in:
parent
386d23bfe7
commit
f7ff4f47cc
@ -1717,17 +1717,14 @@ EnvironmentCache.prototype = {
|
|||||||
profile: { // hdd where the profile folder is located
|
profile: { // hdd where the profile folder is located
|
||||||
model: getSysinfoProperty("profileHDDModel", null),
|
model: getSysinfoProperty("profileHDDModel", null),
|
||||||
revision: getSysinfoProperty("profileHDDRevision", null),
|
revision: getSysinfoProperty("profileHDDRevision", null),
|
||||||
type: getSysinfoProperty("profileHDDType", null),
|
|
||||||
},
|
},
|
||||||
binary: { // hdd where the application binary is located
|
binary: { // hdd where the application binary is located
|
||||||
model: getSysinfoProperty("binHDDModel", null),
|
model: getSysinfoProperty("binHDDModel", null),
|
||||||
revision: getSysinfoProperty("binHDDRevision", null),
|
revision: getSysinfoProperty("binHDDRevision", null),
|
||||||
type: getSysinfoProperty("binHDDType", null),
|
|
||||||
},
|
},
|
||||||
system: { // hdd where the system files are located
|
system: { // hdd where the system files are located
|
||||||
model: getSysinfoProperty("winHDDModel", null),
|
model: getSysinfoProperty("winHDDModel", null),
|
||||||
revision: getSysinfoProperty("winHDDRevision", null),
|
revision: getSysinfoProperty("winHDDRevision", null),
|
||||||
type: getSysinfoProperty("winHDDType", null),
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -141,17 +141,14 @@ Structure:
|
|||||||
profile: { // hdd where the profile folder is located
|
profile: { // hdd where the profile folder is located
|
||||||
model: <string>, // windows only or null on failure
|
model: <string>, // windows only or null on failure
|
||||||
revision: <string>, // windows only or null on failure
|
revision: <string>, // windows only or null on failure
|
||||||
type: <string>, // "SSD" or "HDD" windows only or null on failure
|
|
||||||
},
|
},
|
||||||
binary: { // hdd where the application binary is located
|
binary: { // hdd where the application binary is located
|
||||||
model: <string>, // windows only or null on failure
|
model: <string>, // windows only or null on failure
|
||||||
revision: <string>, // windows only or null on failure
|
revision: <string>, // windows only or null on failure
|
||||||
type: <string>, // "SSD" or "HDD" windows only or null on failure
|
|
||||||
},
|
},
|
||||||
system: { // hdd where the system files are located
|
system: { // hdd where the system files are located
|
||||||
model: <string>, // windows only or null on failure
|
model: <string>, // windows only or null on failure
|
||||||
revision: <string>, // windows only or null on failure
|
revision: <string>, // windows only or null on failure
|
||||||
type: <string>, // "SSD" or "HDD" windows only or null on failure
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
gfx: {
|
gfx: {
|
||||||
|
@ -606,7 +606,6 @@ function checkSystemSection(data) {
|
|||||||
for (let disk of EXPECTED_HDD_FIELDS) {
|
for (let disk of EXPECTED_HDD_FIELDS) {
|
||||||
Assert.ok(check(data.system.hdd[disk].model));
|
Assert.ok(check(data.system.hdd[disk].model));
|
||||||
Assert.ok(check(data.system.hdd[disk].revision));
|
Assert.ok(check(data.system.hdd[disk].revision));
|
||||||
Assert.ok(check(data.system.hdd[disk].type));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let gfxData = data.system.gfx;
|
let gfxData = data.system.gfx;
|
||||||
|
@ -101,10 +101,9 @@ static void SimpleParseKeyValuePairs(
|
|||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
namespace {
|
namespace {
|
||||||
nsresult GetHDDInfo(const char* aSpecialDirName, nsAutoCString& aModel,
|
nsresult GetHDDInfo(const char* aSpecialDirName, nsAutoCString& aModel,
|
||||||
nsAutoCString& aRevision, nsAutoCString& aType) {
|
nsAutoCString& aRevision) {
|
||||||
aModel.Truncate();
|
aModel.Truncate();
|
||||||
aRevision.Truncate();
|
aRevision.Truncate();
|
||||||
aType.Truncate();
|
|
||||||
|
|
||||||
nsCOMPtr<nsIFile> profDir;
|
nsCOMPtr<nsIFile> profDir;
|
||||||
nsresult rv =
|
nsresult rv =
|
||||||
@ -150,15 +149,6 @@ nsresult GetHDDInfo(const char* aSpecialDirName, nsAutoCString& aModel,
|
|||||||
free(deviceOutput);
|
free(deviceOutput);
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
queryParameters.PropertyId = StorageDeviceTrimProperty;
|
|
||||||
bytesRead = 0;
|
|
||||||
DEVICE_TRIM_DESCRIPTOR trimDescriptor = {sizeof(DEVICE_TRIM_DESCRIPTOR)};
|
|
||||||
if (!::DeviceIoControl(handle, IOCTL_STORAGE_QUERY_PROPERTY, &queryParameters,
|
|
||||||
sizeof(queryParameters), &trimDescriptor,
|
|
||||||
sizeof(trimDescriptor), &bytesRead, nullptr)) {
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
// Some HDDs are including product ID info in the vendor field. Since PNP
|
// Some HDDs are including product ID info in the vendor field. Since PNP
|
||||||
// IDs include vendor info and product ID concatenated together, we'll do
|
// IDs include vendor info and product ID concatenated together, we'll do
|
||||||
// that here and interpret the result as a unique ID for the HDD model.
|
// that here and interpret the result as a unique ID for the HDD model.
|
||||||
@ -176,11 +166,6 @@ nsresult GetHDDInfo(const char* aSpecialDirName, nsAutoCString& aModel,
|
|||||||
deviceOutput->ProductRevisionOffset;
|
deviceOutput->ProductRevisionOffset;
|
||||||
aRevision.CompressWhitespace();
|
aRevision.CompressWhitespace();
|
||||||
}
|
}
|
||||||
if (trimDescriptor.TrimEnabled) {
|
|
||||||
aType = "SSD";
|
|
||||||
} else {
|
|
||||||
aType = "HDD";
|
|
||||||
}
|
|
||||||
free(deviceOutput);
|
free(deviceOutput);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -797,25 +782,20 @@ nsresult nsSystemInfo::Init() {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nsAutoCString hddModel, hddRevision, hddType;
|
nsAutoCString hddModel, hddRevision;
|
||||||
if (NS_SUCCEEDED(GetHDDInfo(NS_GRE_DIR, hddModel, hddRevision, hddType))) {
|
if (NS_SUCCEEDED(GetHDDInfo(NS_GRE_DIR, hddModel, hddRevision))) {
|
||||||
rv = SetPropertyAsACString(NS_LITERAL_STRING("binHDDModel"), hddModel);
|
rv = SetPropertyAsACString(NS_LITERAL_STRING("binHDDModel"), hddModel);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
rv =
|
rv =
|
||||||
SetPropertyAsACString(NS_LITERAL_STRING("binHDDRevision"), hddRevision);
|
SetPropertyAsACString(NS_LITERAL_STRING("binHDDRevision"), hddRevision);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
rv = SetPropertyAsACString(NS_LITERAL_STRING("binHDDType"), hddType);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
}
|
}
|
||||||
if (NS_SUCCEEDED(
|
if (NS_SUCCEEDED(GetHDDInfo(NS_WIN_WINDOWS_DIR, hddModel, hddRevision))) {
|
||||||
GetHDDInfo(NS_WIN_WINDOWS_DIR, hddModel, hddRevision, hddType))) {
|
|
||||||
rv = SetPropertyAsACString(NS_LITERAL_STRING("winHDDModel"), hddModel);
|
rv = SetPropertyAsACString(NS_LITERAL_STRING("winHDDModel"), hddModel);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
rv =
|
rv =
|
||||||
SetPropertyAsACString(NS_LITERAL_STRING("winHDDRevision"), hddRevision);
|
SetPropertyAsACString(NS_LITERAL_STRING("winHDDRevision"), hddRevision);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
rv = SetPropertyAsACString(NS_LITERAL_STRING("winHDDType"), hddType);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoString countryCode;
|
nsAutoString countryCode;
|
||||||
@ -1082,9 +1062,8 @@ nsSystemInfo::Observe(nsISupports* aSubject, const char* aTopic,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsSystemInfo::GetProfileHDDInfo() {
|
nsresult nsSystemInfo::GetProfileHDDInfo() {
|
||||||
nsAutoCString hddModel, hddRevision, hddType;
|
nsAutoCString hddModel, hddRevision;
|
||||||
nsresult rv =
|
nsresult rv = GetHDDInfo(NS_APP_USER_PROFILE_50_DIR, hddModel, hddRevision);
|
||||||
GetHDDInfo(NS_APP_USER_PROFILE_50_DIR, hddModel, hddRevision, hddType);
|
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -1094,10 +1073,6 @@ nsresult nsSystemInfo::GetProfileHDDInfo() {
|
|||||||
}
|
}
|
||||||
rv = SetPropertyAsACString(NS_LITERAL_STRING("profileHDDRevision"),
|
rv = SetPropertyAsACString(NS_LITERAL_STRING("profileHDDRevision"),
|
||||||
hddRevision);
|
hddRevision);
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
rv = SetPropertyAsACString(NS_LITERAL_STRING("profileHDDType"), hddType);
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user