diff options
Diffstat (limited to '')
-rw-r--r-- | src/TestBA/TestBA.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/TestBA/TestBA.cs b/src/TestBA/TestBA.cs index 1348ce98..b9f869a6 100644 --- a/src/TestBA/TestBA.cs +++ b/src/TestBA/TestBA.cs | |||
@@ -28,6 +28,7 @@ namespace WixToolset.Test.BA | |||
28 | 28 | ||
29 | private bool immediatelyQuit; | 29 | private bool immediatelyQuit; |
30 | private bool quitAfterDetect; | 30 | private bool quitAfterDetect; |
31 | private bool explicitlyElevateAndPlanFromOnElevateBegin; | ||
31 | private int redetectRemaining; | 32 | private int redetectRemaining; |
32 | private int sleepDuringCache; | 33 | private int sleepDuringCache; |
33 | private int cancelCacheAtProgress; | 34 | private int cancelCacheAtProgress; |
@@ -122,6 +123,12 @@ namespace WixToolset.Test.BA | |||
122 | redetectCount = 0; | 123 | redetectCount = 0; |
123 | } | 124 | } |
124 | 125 | ||
126 | string explicitlyElevateAndPlanFromOnElevateBegin = this.ReadPackageAction(null, "ExplicitlyElevateAndPlanFromOnElevateBegin"); | ||
127 | if (String.IsNullOrEmpty(explicitlyElevateAndPlanFromOnElevateBegin) || !Boolean.TryParse(explicitlyElevateAndPlanFromOnElevateBegin, out this.explicitlyElevateAndPlanFromOnElevateBegin)) | ||
128 | { | ||
129 | this.explicitlyElevateAndPlanFromOnElevateBegin = false; | ||
130 | } | ||
131 | |||
125 | string quitAfterDetect = this.ReadPackageAction(null, "QuitAfterDetect"); | 132 | string quitAfterDetect = this.ReadPackageAction(null, "QuitAfterDetect"); |
126 | if (String.IsNullOrEmpty(quitAfterDetect) || !Boolean.TryParse(quitAfterDetect, out this.quitAfterDetect)) | 133 | if (String.IsNullOrEmpty(quitAfterDetect) || !Boolean.TryParse(quitAfterDetect, out this.quitAfterDetect)) |
127 | { | 134 | { |
@@ -214,6 +221,10 @@ namespace WixToolset.Test.BA | |||
214 | { | 221 | { |
215 | this.ShutdownUiThread(); | 222 | this.ShutdownUiThread(); |
216 | } | 223 | } |
224 | else if (this.explicitlyElevateAndPlanFromOnElevateBegin) | ||
225 | { | ||
226 | this.Engine.Elevate(this.windowHandle); | ||
227 | } | ||
217 | else | 228 | else |
218 | { | 229 | { |
219 | this.Engine.Plan(this.action); | 230 | this.Engine.Plan(this.action); |
@@ -225,6 +236,17 @@ namespace WixToolset.Test.BA | |||
225 | } | 236 | } |
226 | } | 237 | } |
227 | 238 | ||
239 | protected override void OnElevateBegin(ElevateBeginEventArgs args) | ||
240 | { | ||
241 | if (this.explicitlyElevateAndPlanFromOnElevateBegin) | ||
242 | { | ||
243 | this.Engine.Plan(this.action); | ||
244 | |||
245 | // Simulate showing some UI since these tests won't actually show the UAC prompt. | ||
246 | MessagePump.ProcessMessages(10); | ||
247 | } | ||
248 | } | ||
249 | |||
228 | protected override void OnPlanPackageBegin(PlanPackageBeginEventArgs args) | 250 | protected override void OnPlanPackageBegin(PlanPackageBeginEventArgs args) |
229 | { | 251 | { |
230 | RequestState state; | 252 | RequestState state; |