Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡[RUMF-1344] Serialize scroll positions only for full snapshots #1670

Merged
merged 5 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ describe('rum track view metrics', () => {

describe('cumulativeLayoutShift', () => {
let isLayoutShiftSupported: boolean
let originalSupportedEntryTypes: PropertyDescriptor | undefined

function newLayoutShift(lifeCycle: LifeCycle, { value = 0.1, hadRecentInput = false }) {
lifeCycle.notify(LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED, [
{
Expand All @@ -351,10 +353,17 @@ describe('rum track view metrics', () => {
if (!('PerformanceObserver' in window) || !('supportedEntryTypes' in PerformanceObserver)) {
pending('No PerformanceObserver support')
}
originalSupportedEntryTypes = Object.getOwnPropertyDescriptor(PerformanceObserver, 'supportedEntryTypes')
isLayoutShiftSupported = true
spyOnProperty(PerformanceObserver, 'supportedEntryTypes', 'get').and.callFake(() =>
isLayoutShiftSupported ? ['layout-shift'] : []
)
Object.defineProperty(PerformanceObserver, 'supportedEntryTypes', {
get: () => (isLayoutShiftSupported ? ['layout-shift'] : []),
})
})

afterEach(() => {
if (originalSupportedEntryTypes) {
Object.defineProperty(PerformanceObserver, 'supportedEntryTypes', originalSupportedEntryTypes)
BenoitZugmeyer marked this conversation as resolved.
Show resolved Hide resolved
}
})

it('should be initialized to 0', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/browsers.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ module.exports = [
{
sessionName: 'Safari desktop',
name: 'Safari',
version: '12.0',
version: '13.1',
os: 'OS X',
osVersion: 'Mojave',
osVersion: 'Catalina',
},
{
sessionName: 'Chrome mobile',
Expand Down