diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /tools/profiler/tests | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/profiler/tests')
16 files changed, 56 insertions, 47 deletions
diff --git a/tools/profiler/tests/browser/browser.toml b/tools/profiler/tests/browser/browser.toml index 57d8ad0875..fdbdd7c7ce 100644 --- a/tools/profiler/tests/browser/browser.toml +++ b/tools/profiler/tests/browser/browser.toml @@ -15,14 +15,12 @@ support-files = ["do_work_500ms.html"] support-files = ["do_work_500ms.html"] ["browser_test_marker_network_cancel.js"] -https_first_disabled = true support-files = ["simple.html"] ["browser_test_marker_network_private_browsing.js"] support-files = ["simple.html"] ["browser_test_marker_network_redirect.js"] -https_first_disabled = true support-files = [ "redirect.sjs", "simple.html", @@ -67,7 +65,6 @@ support-files = [ ] ["browser_test_marker_network_simple.js"] -https_first_disabled = true support-files = ["simple.html"] ["browser_test_marker_network_sts.js"] @@ -81,24 +78,20 @@ support-files = ["simple.html"] support-files = ["single_frame.html"] ["browser_test_profile_capture_by_pid.js"] -https_first_disabled = true support-files = ["single_frame.html"] ["browser_test_profile_fission.js"] support-files = ["single_frame.html"] ["browser_test_profile_multi_frame_page_info.js"] -https_first_disabled = true support-files = [ "multi_frame.html", "single_frame.html", ] ["browser_test_profile_single_frame_page_info.js"] -https_first_disabled = true support-files = ["single_frame.html"] ["browser_test_profile_slow_capture.js"] -https_first_disabled = true support-files = ["single_frame.html"] skip-if = ["!debug"] diff --git a/tools/profiler/tests/browser/browser_test_marker_network_cancel.js b/tools/profiler/tests/browser/browser_test_marker_network_cancel.js index df3de2b99a..4e144ba700 100644 --- a/tools/profiler/tests/browser/browser_test_marker_network_cancel.js +++ b/tools/profiler/tests/browser/browser_test_marker_network_cancel.js @@ -13,7 +13,7 @@ add_task(async function test_network_markers_early_cancel() { startProfilerForMarkerTests(); - const url = BASE_URL + "simple.html?cacheBust=" + Math.random(); + const url = BASE_URL_HTTPS + "simple.html?cacheBust=" + Math.random(); const options = { gBrowser, url: "about:blank", diff --git a/tools/profiler/tests/browser/browser_test_marker_network_redirect.js b/tools/profiler/tests/browser/browser_test_marker_network_redirect.js index 28478c2b3b..f5597e97e7 100644 --- a/tools/profiler/tests/browser/browser_test_marker_network_redirect.js +++ b/tools/profiler/tests/browser/browser_test_marker_network_redirect.js @@ -28,10 +28,10 @@ add_task(async function test_network_markers_redirect_simple() { const targetFileNameWithCacheBust = "simple.html"; const url = - BASE_URL + + BASE_URL_HTTPS + "redirect.sjs?" + encodeURIComponent(targetFileNameWithCacheBust); - const targetUrl = BASE_URL + targetFileNameWithCacheBust; + const targetUrl = BASE_URL_HTTPS + targetFileNameWithCacheBust; await BrowserTestUtils.withNewTab(url, async contentBrowser => { const contentPid = await SpecialPowers.spawn( @@ -149,7 +149,8 @@ add_task(async function test_network_markers_redirect_resources() { startProfilerForMarkerTests(); - const url = BASE_URL + "page_with_resources.html?cacheBust=" + Math.random(); + const url = + BASE_URL_HTTPS + "page_with_resources.html?cacheBust=" + Math.random(); await BrowserTestUtils.withNewTab(url, async contentBrowser => { const contentPid = await SpecialPowers.spawn( contentBrowser, @@ -225,6 +226,9 @@ add_task(async function test_network_markers_redirect_resources() { id: Expect.number(), pri: Expect.number(), innerWindowID: Expect.number(), + requestStart: Expect.number(), + responseStart: Expect.number(), + responseEnd: Expect.number(), }; // These properties are present when a connection is fully opened. This is @@ -239,9 +243,6 @@ add_task(async function test_network_markers_redirect_resources() { connectStart: Expect.number(), tcpConnectEnd: Expect.number(), connectEnd: Expect.number(), - requestStart: Expect.number(), - responseStart: Expect.number(), - responseEnd: Expect.number(), }; const expectedPropertiesForStopMarker = { @@ -250,7 +251,6 @@ add_task(async function test_network_markers_redirect_resources() { const expectedDataPropertiesForStopMarker = { ...expectedCommonDataProperties, - ...expectedConnectionProperties, status: "STATUS_STOP", URI: Expect.stringContains("/firefox-logo-nightly.svg"), contentType: "image/svg+xml", @@ -280,6 +280,7 @@ add_task(async function test_network_markers_redirect_resources() { ); Assert.objectContainsOnly(parentFirstStopMarker.data, { ...expectedDataPropertiesForStopMarker, + ...expectedConnectionProperties, // The cache information is missing from the content marker, it's only part // of the parent marker. See Bug 1544821. // Also, because the request races with the cache, these 2 values are valid: @@ -292,10 +293,10 @@ add_task(async function test_network_markers_redirect_resources() { contentFirstStopMarker, expectedPropertiesForStopMarker ); - Assert.objectContainsOnly( - contentFirstStopMarker.data, - expectedDataPropertiesForStopMarker - ); + Assert.objectContainsOnly(contentFirstStopMarker.data, { + ...expectedDataPropertiesForStopMarker, + ...expectedConnectionProperties, + }); Assert.objectContains( parentRedirectMarker, @@ -321,7 +322,11 @@ add_task(async function test_network_markers_redirect_resources() { parentSecondStopMarker, expectedPropertiesForStopMarker ); - Assert.objectContainsOnly(parentSecondStopMarker.data, { + // In Test-Verify mode, sometimes the properties from + // `expectedConnectionProperties` are missing. That's why they're not + // included here, and objectContains is used instead of objectContainsOnly + // like above. + Assert.objectContains(parentSecondStopMarker.data, { ...expectedDataPropertiesForStopMarker, // The "count" property is absent from the content marker. count: Expect.number(), @@ -333,7 +338,7 @@ add_task(async function test_network_markers_redirect_resources() { contentSecondStopMarker, expectedPropertiesForStopMarker ); - Assert.objectContainsOnly( + Assert.objectContains( contentSecondStopMarker.data, expectedDataPropertiesForStopMarker ); diff --git a/tools/profiler/tests/browser/browser_test_marker_network_simple.js b/tools/profiler/tests/browser/browser_test_marker_network_simple.js index 15894305a7..01f68216ee 100644 --- a/tools/profiler/tests/browser/browser_test_marker_network_simple.js +++ b/tools/profiler/tests/browser/browser_test_marker_network_simple.js @@ -13,7 +13,7 @@ add_task(async function test_network_markers() { startProfilerForMarkerTests(); - const url = BASE_URL + "simple.html?cacheBust=" + Math.random(); + const url = BASE_URL_HTTPS + "simple.html?cacheBust=" + Math.random(); await BrowserTestUtils.withNewTab(url, async contentBrowser => { const contentPid = await SpecialPowers.spawn( contentBrowser, diff --git a/tools/profiler/tests/browser/browser_test_markers_parent_process.js b/tools/profiler/tests/browser/browser_test_markers_parent_process.js index 28b82f8054..939271ee66 100644 --- a/tools/profiler/tests/browser/browser_test_markers_parent_process.js +++ b/tools/profiler/tests/browser/browser_test_markers_parent_process.js @@ -26,12 +26,13 @@ add_task(async function test_markers_parent_process() { ); ok(domEventStart, "A start DOMEvent was generated"); ok(domEventEnd, "An end DOMEvent was generated"); - ok( - domEventEnd.data.latency > 0, + Assert.greater( + domEventEnd.data.latency, + 0, "DOMEvent had a a latency value generated." ); - ok(domEventEnd.data.type === "DOMEvent"); - ok(domEventEnd.name === "DOMEvent"); + Assert.strictEqual(domEventEnd.data.type, "DOMEvent"); + Assert.strictEqual(domEventEnd.name, "DOMEvent"); } // Add more marker tests. }); diff --git a/tools/profiler/tests/browser/browser_test_profile_capture_by_pid.js b/tools/profiler/tests/browser/browser_test_profile_capture_by_pid.js index 14d76dbcaf..0d206a7148 100644 --- a/tools/profiler/tests/browser/browser_test_profile_capture_by_pid.js +++ b/tools/profiler/tests/browser/browser_test_profile_capture_by_pid.js @@ -26,7 +26,7 @@ async function test_with_filter(fnFilterWithContentId) { await Services.profiler.ClearAllPages(); info("Open a tab with single_frame.html in it."); - const url = BASE_URL + "single_frame.html"; + const url = BASE_URL_HTTPS + "single_frame.html"; return BrowserTestUtils.withNewTab(url, async function (contentBrowser) { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { return Services.appinfo.processID; @@ -107,7 +107,7 @@ add_task(async function browser_test_profile_capture_along_with_content_pid() { add_task(async function browser_test_profile_capture_along_with_other_pid() { const parentPid = Services.appinfo.processID; const { contentPid, pidsWithSamplerThread, profile } = await test_with_filter( - contentPid => ["GeckoMain", "pid:" + parentPid] + () => ["GeckoMain", "pid:" + parentPid] ); Assert.greater( @@ -174,9 +174,9 @@ add_task(async function browser_test_profile_capture_by_only_content_pid() { add_task(async function browser_test_profile_capture_by_only_parent_pid() { const parentPid = Services.appinfo.processID; - const { pidsWithSamplerThread, profile } = await test_with_filter( - contentPid => ["pid:" + parentPid] - ); + const { pidsWithSamplerThread, profile } = await test_with_filter(() => [ + "pid:" + parentPid, + ]); Assert.deepEqual( pidsWithSamplerThread, diff --git a/tools/profiler/tests/browser/browser_test_profile_multi_frame_page_info.js b/tools/profiler/tests/browser/browser_test_profile_multi_frame_page_info.js index 854587678d..b1dfbb60c3 100644 --- a/tools/profiler/tests/browser/browser_test_profile_multi_frame_page_info.js +++ b/tools/profiler/tests/browser/browser_test_profile_multi_frame_page_info.js @@ -23,7 +23,7 @@ add_task(async function test_profile_multi_frame_page_info() { info("Open a tab with multi_frame.html in it."); // multi_frame.html embeds single_frame.html inside an iframe. - const url = BASE_URL + "multi_frame.html"; + const url = BASE_URL_HTTPS + "multi_frame.html"; await BrowserTestUtils.withNewTab(url, async function (contentBrowser) { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { return Services.appinfo.processID; @@ -63,8 +63,8 @@ add_task(async function test_profile_multi_frame_page_info() { for (const page of contentProcess.pages) { // Child page (iframe) - if (page.url == BASE_URL + "single_frame.html") { - Assert.equal(page.url, BASE_URL + "single_frame.html"); + if (page.url == BASE_URL_HTTPS + "single_frame.html") { + Assert.equal(page.url, BASE_URL_HTTPS + "single_frame.html"); Assert.equal(typeof page.tabID, "number"); Assert.equal(page.tabID, activeTabID); Assert.equal(typeof page.innerWindowID, "number"); diff --git a/tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js b/tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js index 0385413c16..3249e728b7 100644 --- a/tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js +++ b/tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js @@ -22,7 +22,7 @@ add_task(async function test_profile_single_frame_page_info() { await startProfiler(); info("Open a tab with single_frame.html in it."); - const url = BASE_URL + "single_frame.html"; + const url = BASE_URL_HTTPS + "single_frame.html"; await BrowserTestUtils.withNewTab(url, async function (contentBrowser) { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { return Services.appinfo.processID; diff --git a/tools/profiler/tests/browser/browser_test_profile_slow_capture.js b/tools/profiler/tests/browser/browser_test_profile_slow_capture.js index 4a675b84d1..16684a35dd 100644 --- a/tools/profiler/tests/browser/browser_test_profile_slow_capture.js +++ b/tools/profiler/tests/browser/browser_test_profile_slow_capture.js @@ -13,7 +13,7 @@ add_task(async function browser_test_profile_slow_capture() { await startProfiler({ threads: ["GeckoMain", "test-debug-child-slow-json"] }); info("Open a tab with single_frame.html in it."); - const url = BASE_URL + "single_frame.html"; + const url = BASE_URL_HTTPS + "single_frame.html"; await BrowserTestUtils.withNewTab(url, async function (contentBrowser) { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { return Services.appinfo.processID; @@ -78,7 +78,7 @@ add_task(async function browser_test_profile_very_slow_capture() { }); info("Open a tab with single_frame.html in it."); - const url = BASE_URL + "single_frame.html"; + const url = BASE_URL_HTTPS + "single_frame.html"; await BrowserTestUtils.withNewTab(url, async function (contentBrowser) { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { return Services.appinfo.processID; diff --git a/tools/profiler/tests/browser/serviceworkers/serviceworker_no_fetch_handler.js b/tools/profiler/tests/browser/serviceworkers/serviceworker_no_fetch_handler.js index f656665ca0..7a8ed91d28 100644 --- a/tools/profiler/tests/browser/serviceworkers/serviceworker_no_fetch_handler.js +++ b/tools/profiler/tests/browser/serviceworkers/serviceworker_no_fetch_handler.js @@ -1,4 +1,4 @@ -self.addEventListener("install", event => { +self.addEventListener("install", () => { performance.mark("__serviceworker_event"); console.log("[SW]:", "Install event"); }); diff --git a/tools/profiler/tests/browser/serviceworkers/serviceworker_no_respondWith_in_fetch_handler.js b/tools/profiler/tests/browser/serviceworkers/serviceworker_no_respondWith_in_fetch_handler.js index 255c8269a1..ba0610665b 100644 --- a/tools/profiler/tests/browser/serviceworkers/serviceworker_no_respondWith_in_fetch_handler.js +++ b/tools/profiler/tests/browser/serviceworkers/serviceworker_no_respondWith_in_fetch_handler.js @@ -1,4 +1,4 @@ -self.addEventListener("install", event => { +self.addEventListener("install", () => { performance.mark("__serviceworker_event"); console.log("[SW]:", "Install event"); }); diff --git a/tools/profiler/tests/browser/serviceworkers/serviceworker_synthetized_response.js b/tools/profiler/tests/browser/serviceworkers/serviceworker_synthetized_response.js index 891b679a5f..13c529d0d3 100644 --- a/tools/profiler/tests/browser/serviceworkers/serviceworker_synthetized_response.js +++ b/tools/profiler/tests/browser/serviceworkers/serviceworker_synthetized_response.js @@ -1,4 +1,4 @@ -self.addEventListener("install", event => { +self.addEventListener("install", () => { performance.mark("__serviceworker_event"); dump("[SW]:", "Install event\n"); }); diff --git a/tools/profiler/tests/gtest/GeckoProfiler.cpp b/tools/profiler/tests/gtest/GeckoProfiler.cpp index 79ed7cb52a..c9a26250db 100644 --- a/tools/profiler/tests/gtest/GeckoProfiler.cpp +++ b/tools/profiler/tests/gtest/GeckoProfiler.cpp @@ -140,8 +140,10 @@ TEST(GeckoProfiler, ThreadRegistrationInfo) EXPECT_STREQ(trInfoHere.Name(), "Here"); EXPECT_NE(trInfoHere.Name(), "Here") << "ThreadRegistrationInfo should keep its own copy of the name"; - TimeStamp baseRegistrationTime = - baseprofiler::detail::GetThreadRegistrationTime(); + TimeStamp baseRegistrationTime; +#ifdef MOZ_GECKO_PROFILER + baseRegistrationTime = baseprofiler::detail::GetThreadRegistrationTime(); +#endif if (baseRegistrationTime) { EXPECT_EQ(trInfoHere.RegisterTime(), baseRegistrationTime); } else { @@ -3228,12 +3230,14 @@ TEST(GeckoProfiler, Markers) EXPECT_EQ(display[0u].asString(), "marker-chart"); EXPECT_EQ(display[1u].asString(), "marker-table"); - ASSERT_EQ(data.size(), 1u); + ASSERT_EQ(data.size(), 2u); ASSERT_TRUE(data[0u].isObject()); EXPECT_EQ_JSON(data[0u]["key"], String, "name"); EXPECT_EQ_JSON(data[0u]["label"], String, "Details"); EXPECT_EQ_JSON(data[0u]["format"], String, "string"); + EXPECT_EQ_JSON(data[1u]["label"], String, "Description"); + EXPECT_EQ_JSON(data[1u]["value"], String, "Generic text marker"); } else if (nameString == "NoPayloadUserData") { // TODO: Remove this when bug 1646714 lands. @@ -3252,12 +3256,14 @@ TEST(GeckoProfiler, Markers) EXPECT_EQ(display[1u].asString(), "marker-table"); EXPECT_EQ(display[2u].asString(), "timeline-overview"); - ASSERT_EQ(data.size(), 1u); + ASSERT_EQ(data.size(), 2u); ASSERT_TRUE(data[0u].isObject()); EXPECT_EQ_JSON(data[0u]["key"], String, "category"); EXPECT_EQ_JSON(data[0u]["label"], String, "Type"); EXPECT_EQ_JSON(data[0u]["format"], String, "string"); + EXPECT_EQ_JSON(data[1u]["label"], String, "Description"); + EXPECT_EQ_JSON(data[1u]["value"], String, "Generic tracing marker"); } else if (nameString == "BHR-detected hang") { EXPECT_EQ(display.size(), 2u); @@ -3913,7 +3919,10 @@ class GTestStackCollector final : public ProfilerStackCollector { virtual void CollectNativeLeafAddr(void* aAddr) { mFrames++; } virtual void CollectJitReturnAddr(void* aAddr) { mFrames++; } - virtual void CollectWasmFrame(const char* aLabel) { mFrames++; } + virtual void CollectWasmFrame(JS::ProfilingCategoryPair aCategory, + const char* aLabel) { + mFrames++; + } virtual void CollectProfilingStackFrame( const js::ProfilingStackFrame& aFrame) { mFrames++; diff --git a/tools/profiler/tests/shared-head.js b/tools/profiler/tests/shared-head.js index d1b2f6868a..b01ef6ed25 100644 --- a/tools/profiler/tests/shared-head.js +++ b/tools/profiler/tests/shared-head.js @@ -547,7 +547,7 @@ Object.assign(Assert, { const Expect = { any: () => - actual => {} /* We don't check anything more than the presence of this property. */, + () => {} /* We don't check anything more than the presence of this property. */, }; /* These functions are part of the Assert object, and we want to reuse them. */ diff --git a/tools/profiler/tests/xpcshell/test_feature_cpufreq.js b/tools/profiler/tests/xpcshell/test_feature_cpufreq.js index 1d8e0d9a36..4bab2d1019 100644 --- a/tools/profiler/tests/xpcshell/test_feature_cpufreq.js +++ b/tools/profiler/tests/xpcshell/test_feature_cpufreq.js @@ -87,7 +87,7 @@ function getInflatedCPUFreqMarkers(thread) { * schema: MarkerSchema; * }} */ -async function runProfilerWithCPUSpeed(features, filename) { +async function runProfilerWithCPUSpeed(features) { const entries = 10000; const interval = 10; const threads = []; diff --git a/tools/profiler/tests/xpcshell/xpcshell.toml b/tools/profiler/tests/xpcshell/xpcshell.toml index a04dcd6789..5c094899a4 100644 --- a/tools/profiler/tests/xpcshell/xpcshell.toml +++ b/tools/profiler/tests/xpcshell/xpcshell.toml @@ -39,6 +39,7 @@ skip-if = ["tsan"] # Times out on TSan, bug 1612707 skip-if = [ "release_or_beta", "os == 'win' && socketprocess_networking", + "tsan", # bug 1885381 ] ["test_feature_nativeallocations.js"] |