Skip to content

Commit

Permalink
test: add function to cause frozen frames (#3218)
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight authored Aug 15, 2023
1 parent 9cc7e7c commit b066509
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
39 changes: 24 additions & 15 deletions Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@
<rect key="frame" x="8" y="80" width="304" height="455"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="Yzg-QH-aPg">
<rect key="frame" x="0.0" y="0.0" width="304" height="196"/>
<rect key="frame" x="0.0" y="0.0" width="304" height="224"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="FaL-DP-Rl6">
<rect key="frame" x="0.0" y="0.0" width="152" height="196"/>
<rect key="frame" x="0.0" y="0.0" width="152" height="224"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oag-iN-lAn">
<rect key="frame" x="0.0" y="0.0" width="152" height="28"/>
Expand Down Expand Up @@ -575,10 +575,19 @@
<action selector="flush:" destination="VqS-l1-kwe" eventType="touchUpInside" id="Noh-VX-qnf"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M3X-e9-STj">
<rect key="frame" x="0.0" y="196" width="152" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Cause frozen frames"/>
<connections>
<action selector="causeFrozenFrames:" destination="VqS-l1-kwe" eventType="touchUpInside" id="B96-yJ-Yof"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="ULj-Tl-kYs">
<rect key="frame" x="152" y="0.0" width="152" height="196"/>
<rect key="frame" x="152" y="0.0" width="152" height="224"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="weS-d7-IY1">
<rect key="frame" x="0.0" y="0.0" width="152" height="28"/>
Expand All @@ -589,31 +598,31 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ckT-1E-GWZ">
<rect key="frame" x="0.0" y="33.5" width="152" height="28"/>
<rect key="frame" x="0.0" y="39" width="152" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="Close SDK"/>
<connections>
<action selector="close:" destination="VqS-l1-kwe" eventType="touchUpInside" id="UwB-2M-pCr"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rpD-Rf-xbz">
<rect key="frame" x="0.0" y="67" width="152" height="28"/>
<rect key="frame" x="0.0" y="78.5" width="152" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="ANR fully blocking"/>
<connections>
<action selector="anrFullyBlocking:" destination="VqS-l1-kwe" eventType="touchUpInside" id="PLh-oH-8oF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2e4-48-rLl">
<rect key="frame" x="0.0" y="101" width="152" height="28"/>
<rect key="frame" x="0.0" y="117.5" width="152" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="ANR filling run loop"/>
<connections>
<action selector="anrFillingRunLoop:" destination="VqS-l1-kwe" eventType="touchUpInside" id="ON6-DV-3Tz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F0l-xf-cQd">
<rect key="frame" x="0.0" y="134.5" width="152" height="28"/>
<rect key="frame" x="0.0" y="157" width="152" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Start 100 threads"/>
Expand All @@ -622,7 +631,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Evt-B9-zEC">
<rect key="frame" x="0.0" y="168" width="152" height="28"/>
<rect key="frame" x="0.0" y="196" width="152" height="28"/>
<accessibility key="accessibilityConfiguration" identifier="breadcrumbInfoButton"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
Expand All @@ -636,44 +645,44 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="omd-Rj-xhq">
<rect key="frame" x="0.0" y="196" width="304" height="259"/>
<rect key="frame" x="0.0" y="224" width="304" height="231"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eMF-4u-JGE">
<rect key="frame" x="8" y="32" width="288" height="34"/>
<rect key="frame" x="8" y="32" width="288" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DSN " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FXp-oI-RdR">
<rect key="frame" x="8" y="66" width="288" height="33.5"/>
<rect key="frame" x="8" y="61" width="288" height="29.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="wzO-lb-yFR">
<rect key="frame" x="8" y="99.5" width="288" height="34"/>
<rect key="frame" x="8" y="90.5" width="288" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<connections>
<action selector="dsnChanged:" destination="VqS-l1-kwe" eventType="editingChanged" id="XYW-iO-EtQ"/>
</connections>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="te3-IR-L1y">
<rect key="frame" x="8" y="133.5" width="288" height="34"/>
<rect key="frame" x="8" y="119.5" width="288" height="29"/>
<state key="normal" title="Reset DSN"/>
<connections>
<action selector="resetDSN:" destination="VqS-l1-kwe" eventType="touchUpInside" id="3LJ-al-JGc"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Frames" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xua-qE-dXN" userLabel="frames">
<rect key="frame" x="8" y="167.5" width="288" height="33.5"/>
<rect key="frame" x="8" y="148.5" width="288" height="29.5"/>
<accessibility key="accessibilityConfiguration" identifier="framesStatsLabel"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last breadcrumb" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4M5-qM-BM9" userLabel="breadcrumb">
<rect key="frame" x="8" y="201" width="288" height="34"/>
<rect key="frame" x="8" y="178" width="288" height="29"/>
<accessibility key="accessibilityConfiguration" identifier="breadcrumbLabel"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
Expand Down
7 changes: 7 additions & 0 deletions Samples/iOS-Swift/iOS-Swift/ExtraViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ class ExtraViewController: UIViewController {
AppDelegate.startSentry()
}

@IBAction func causeFrozenFrames(_ sender: Any) {
var a = String()
for i in 0..<100_000_000 {
a.append(String(i))
}
}

private func calcPi() -> Double {
var denominator = 1.0
var pi = 0.0
Expand Down

0 comments on commit b066509

Please sign in to comment.