Bug 1745444 - Replace the arbitrary values in RecvTestTriggerMetrics with the PROCESS_TYPE_ constants, r=chutten.

Differential Revision: https://phabricator.services.mozilla.com/D133509
This commit is contained in:
Florian Quèze 2021-12-15 16:27:57 +00:00
parent e665115136
commit d18524b702
4 changed files with 6 additions and 4 deletions

View File

@ -48,6 +48,7 @@
#include "mozilla/ipc/ProcessUtils.h"
#include "nsDebugImpl.h"
#include "nsIXULRuntime.h"
#include "nsThreadManager.h"
#if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
@ -272,7 +273,7 @@ mozilla::ipc::IPCResult RDDParent::RecvFlushFOGData(
mozilla::ipc::IPCResult RDDParent::RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve) {
mozilla::glean::test_only_ipc::a_counter.Add(45327);
mozilla::glean::test_only_ipc::a_counter.Add(nsIXULRuntime::PROCESS_TYPE_RDD);
aResolve(true);
return IPC_OK();
}

View File

@ -58,6 +58,7 @@
#include "mozilla/webrender/WebRenderAPI.h"
#include "nsDebugImpl.h"
#include "nsIGfxInfo.h"
#include "nsIXULRuntime.h"
#include "nsThreadManager.h"
#include "nscore.h"
#include "prenv.h"
@ -627,7 +628,7 @@ mozilla::ipc::IPCResult GPUParent::RecvFlushFOGData(
mozilla::ipc::IPCResult GPUParent::RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve) {
mozilla::glean::test_only_ipc::a_counter.Add(45326);
mozilla::glean::test_only_ipc::a_counter.Add(nsIXULRuntime::PROCESS_TYPE_GPU);
aResolve(true);
return IPC_OK();
}

View File

@ -30,8 +30,8 @@ add_task(async () => {
await Services.fog.testFlushAllChildren();
is(
45326, // See gfx/ipc/GPUParent.cpp's RecvTestTriggerMetrics().
Glean.testOnlyIpc.aCounter.testGetValue(),
Ci.nsIXULRuntime.PROCESS_TYPE_GPU,
"Ensure the GPU-process-set value shows up in the parent process."
);
});

View File

@ -57,8 +57,8 @@ add_task(async () => {
await Services.fog.testFlushAllChildren();
is(
45327, // See dom/media/ipc/RDDParent.cpp's RecvTestTriggerMetrics().
Glean.testOnlyIpc.aCounter.testGetValue(),
Ci.nsIXULRuntime.PROCESS_TYPE_RDD,
"Ensure the RDD-process-set value shows up in the parent process."
);