-
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Replay quality option (#4035)
Added replay quality option
- Loading branch information
Showing
5 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Tests/SentryTests/Integrations/SessionReplay/SentryReplayOptionsTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Foundation | ||
@testable import Sentry | ||
import XCTest | ||
|
||
class SentryReplayOptionsTests: XCTestCase { | ||
|
||
func testQualityLow() { | ||
let options = SentryReplayOptions() | ||
|
||
XCTAssertEqual(options.quality, .low) | ||
XCTAssertEqual(options.replayBitRate, 20_000) | ||
XCTAssertEqual(options.sizeScale, 0.8) | ||
} | ||
|
||
func testQualityMedium() { | ||
let options = SentryReplayOptions() | ||
options.quality = .medium | ||
|
||
XCTAssertEqual(options.replayBitRate, 40_000) | ||
XCTAssertEqual(options.sizeScale, 1.0) | ||
} | ||
|
||
func testQualityHigh() { | ||
let options = SentryReplayOptions() | ||
options.quality = .high | ||
|
||
XCTAssertEqual(options.replayBitRate, 60_000) | ||
XCTAssertEqual(options.sizeScale, 1.0) | ||
} | ||
|
||
} |