Commit 6455b508 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW UMA: integration tests for hardware fields

No change to production logic.

This adds tests for already-implemented UMA proto fields (specifically,
the hardware.* fields). This intentionally skips fields which don't
apply to Android OS (ex. hardware.form_factor, hardare.max_dpi_*). This
also skips fields where we're not logging a meaningful value (ex.
gpu.vendor_id), since such fields are effectively empty anyway.

Bug: 1011991, 1008534
Test: run_webview_instrumentation_test_apk -f AwMetricsMetadataTest.*
Change-Id: I871d81b1b669ddef4169744715fe9f043f7573be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888399Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711598}
parent 9810f16e
......@@ -148,4 +148,64 @@ public class AwMetricsMetadataTest {
Assert.assertTrue("Should have some os.build_fingerprint",
systemProfile.getOs().hasBuildFingerprint());
}
@Test
@MediumTest
@Feature({"AndroidWebView"})
public void testMetadata_hardwareMiscellaneous() throws Throwable {
ChromeUserMetricsExtension log = mPlatformServiceBridge.waitForNextMetricsLog();
SystemProfileProto systemProfile = log.getSystemProfile();
Assert.assertTrue("Should have some hardware.system_ram_mb",
systemProfile.getHardware().hasSystemRamMb());
Assert.assertTrue("Should have some hardware.hardware_class",
systemProfile.getHardware().hasHardwareClass());
}
@Test
@MediumTest
@Feature({"AndroidWebView"})
public void testMetadata_hardwareScreen() throws Throwable {
ChromeUserMetricsExtension log = mPlatformServiceBridge.waitForNextMetricsLog();
SystemProfileProto systemProfile = log.getSystemProfile();
Assert.assertTrue("Should have some hardware.screen_count",
systemProfile.getHardware().hasScreenCount());
Assert.assertTrue("Should have some hardware.primary_screen_width",
systemProfile.getHardware().hasPrimaryScreenWidth());
Assert.assertTrue("Should have some hardware.primary_screen_height",
systemProfile.getHardware().hasPrimaryScreenHeight());
Assert.assertTrue("Should have some hardware.primary_screen_scale_factor",
systemProfile.getHardware().hasPrimaryScreenScaleFactor());
}
@Test
@MediumTest
@Feature({"AndroidWebView"})
public void testMetadata_hardwareCpu() throws Throwable {
ChromeUserMetricsExtension log = mPlatformServiceBridge.waitForNextMetricsLog();
SystemProfileProto systemProfile = log.getSystemProfile();
Assert.assertTrue("Should have some hardware.cpu_architecture",
systemProfile.getHardware().hasCpuArchitecture());
Assert.assertTrue("Should have some hardware.cpu.vendor_name",
systemProfile.getHardware().getCpu().hasVendorName());
Assert.assertTrue("Should have some hardware.cpu.signature",
systemProfile.getHardware().getCpu().hasSignature());
Assert.assertTrue("Should have some hardware.cpu.num_cores",
systemProfile.getHardware().getCpu().hasNumCores());
Assert.assertTrue("Should have some hardware.cpu.is_hypervisor",
systemProfile.getHardware().getCpu().hasIsHypervisor());
}
@Test
@MediumTest
@Feature({"AndroidWebView"})
public void testMetadata_hardwareGpu() throws Throwable {
ChromeUserMetricsExtension log = mPlatformServiceBridge.waitForNextMetricsLog();
SystemProfileProto systemProfile = log.getSystemProfile();
Assert.assertTrue("Should have some hardware.gpu.driver_version",
systemProfile.getHardware().getGpu().hasDriverVersion());
Assert.assertTrue("Should have some hardware.gpu.gl_vendor",
systemProfile.getHardware().getGpu().hasGlVendor());
Assert.assertTrue("Should have some hardware.gpu.gl_renderer",
systemProfile.getHardware().getGpu().hasGlRenderer());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment