Merge branch 'master' into master

This commit is contained in:
uhliksk 2020-09-22 23:34:18 +02:00 committed by GitHub
commit 1419e822b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
747 changed files with 127872 additions and 48097 deletions

99
.clang-format Normal file
View file

@ -0,0 +1,99 @@
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 160
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Single
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
#...
# unsupported rules
#BreakInheritanceList: AfterColon
#Language: None
#ObjCBinPackProtocolList: Auto
#PenaltyBreakTemplateDeclaration: 10
#SpaceBeforeCpp11BracedList: false
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
#SpaceBeforeRangeBasedForLoopColon: true

23
.gitattributes vendored
View file

@ -12,29 +12,6 @@
############################################################################### ###############################################################################
*.cs diff=csharp *.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
*.sln merge=binary
*.csproj merge=binary
*.vbproj merge=binary
*.vcxproj merge=binary
*.vcproj merge=binary
*.dbproj merge=binary
*.fsproj merge=binary
*.lsproj merge=binary
*.wixproj merge=binary
*.modelproj merge=binary
*.sqlproj merge=binary
*.wwaproj merge=binary
############################################################################### ###############################################################################
# behavior for image files # behavior for image files
# #

View file

@ -6,36 +6,55 @@ labels: ''
assignees: '' assignees: ''
--- ---
<!--Before filing a bug <!--
Before filing a bug
- Ensure the bug reproduces on the latest version of the app. - Ensure the bug reproduces on the latest version of the app.
- Search existing issues and make sure this issue is not already filed.--> - Search existing issues and make sure this issue is not already filed.
-->
**Describe the bug** **Describe the bug**
<!--A clear and concise description of what the bug is.--> <!-- A clear and concise description of what the bug is. -->
**Steps To Reproduce** **Steps To Reproduce**
<!--Steps to reproduce the behavior: <!--
Steps to reproduce the behavior:
1. Go to '...' 1. Go to '...'
2. Click on '....' 2. Click on '....'
3. Scroll down to '....' 3. Scroll down to '....'
4. See error--> 4. See error
-->
**Expected behavior** **Expected behavior**
<!--A clear and concise description of what you expected to happen.--> <!-- A clear and concise description of what you expected to happen. -->
**Screenshots** **Screenshots**
<!--If applicable, add screenshots to help explain your problem.--> <!-- If applicable, add screenshots to help explain your problem. -->
**Device and Application Information (please complete the following information):** **Device and Application Information**
- OS Build: - OS Build:
- Architecture: - Architecture:
- Application Version: - Application Version:
- Region:
- Dev Version Installed:
<!--Run the following commands in Powershell and copy/paste the output. <!--
Run the following commands in Powershell and copy/paste the output.
" - OS Build: $([Environment]::OSVersion.Version)" " - OS Build: $([Environment]::OSVersion.Version)"
" - Architecture: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)" " - Architecture: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)"
" - Application Version: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)" " - Application Version: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)"
" - Region: $((Get-Culture).Name)"
" - Dev Version Installed: $($null -ne (Get-AppxPackage -Name Microsoft.WindowsCalculator.Dev))"
--> -->
**Additional context** **Additional context**
<!--Add any other context about the problem here.--> <!-- Add any other context about the problem here. -->
**Requested Assignment**
<!--
Some people just want to report a bug and let someone else fix it.
Other people want to not only submit the bug report, but fix it as well.
Both scenarios are completely ok. We just want to know which one it is.
Please indicate which bucket you fall into by keeping one and removing the other.
-->
If possible, I would like to fix this.
I'm just reporting this problem. I don't want to fix it.

View file

@ -2,42 +2,53 @@
name: Feature request name: Feature request
about: Propose a new feature in the app about: Propose a new feature in the app
title: '' title: ''
labels: '' labels: 'Enhancement'
assignees: '' assignees: ''
--- ---
<!-- <!--
See https://github.com/Microsoft/calculator/blob/master/docs/NewFeatureProcess.md for suggestions on how to write a good feature pitch. Just want to submit an idea quickly? Try Feedback Hub instead: https://insider.windows.com/en-us/fb/?contextid=130
See https://github.com/Microsoft/calculator/blob/master/docs/NewFeatureProcess.md for
suggestions on how to write a good feature pitch. Just want to submit an idea quickly? Try Feedback
Hub instead: https://insider.windows.com/en-us/fb/?contextid=130
--> -->
**Problem Statement** **Problem Statement**
<!-- What problem are we trying to solve? Whos the target audience? Is there a customer need or <!--
pain point we need to remedy? Is there a business goal or metric we are trying to improve? Do we What problem are we trying to solve? Whos the target audience? Is there a customer need or pain point we need to remedy? Is there a business goal or metric we are trying to improve? Do we have a hypothesis we want to prove or disprove?
have a hypothesis we want to prove or disprove? --> -->
**Evidence or User Insights** **Evidence or User Insights**
<!-- Why should we do this? Potential sources of data: Feedback Hub, other GitHub issues, other <!--
anecdotes from listening to customers in person or online, request from another team, telemetry Why should we do this? Potential sources of data: Feedback Hub, other GitHub issues, other anecdotes from listening to customers in person or online, request from another team, telemetry data, user research, market or competitive research
data, user research, market or competitive research --> -->
**Proposal** **Proposal**
<!-- How will the solution/feature help us solve the problem? How will it meet the target <!--
audiences needs? If there are business goals or metrics, how does this improve them? --> How will the solution/feature help us solve the problem? How will it meet the target audiences needs? If there are business goals or metrics, how does this improve them?
-->
**Goals** **Goals**
<!-- What you want to accomplish with this feature. Typical examples include <!--
“User Can *perform some task*” --> What you want to accomplish with this feature. Typical examples include
"User Can *perform some task*"
-->
**Non-Goals** **Non-Goals**
<!-- Things we are explicitly not doing or supporting or that are out of scope, including reasons <!--
why. --> Things we are explicitly not doing or supporting or that are out of scope, including reasons why.
-->
**Low-Fidelity Concept** **Low-Fidelity Concept**
<!-- Show as much of the experience as needed to explain the idea. This can be as simple as a <!--
napkin drawing but can also be a code prototype, a PowerPoint walkthrough, or a design Show as much of the experience as needed to explain the idea. This can be as simple as a napkin drawing but can also be a code prototype, or a design comp. Keep it simple at this stage, as it can be refined later during the pre-production stage.
comp. --> -->
**Requested Assignment**
<!--
Some people just want to suggest a feature and let someone else implement it.
Other people want to not only suggest a feature, but implement it as well.
Both scenarios are completely ok. We just want to know which one it is.
We are likely to prioritize the review of feature requests if they already have someone who can implement them.
Please indicate which bucket you fall into by keeping one and removing the other.
-->
If possible, I would like to implement this.
I'm just suggesting this idea. I don't want to implement it.

View file

@ -0,0 +1,54 @@
---
name: Localization Suggestion
about: Report a problem or suggested change to Calculator's localized content.
title: '[Localization] '
labels: 'Area: World-Readiness'
assignees: ''
---
<!--
PLEASE NOTE:
We cannot _merge_ any suggested localization changes to our localized resources files. These files are automatically generated from an internal localization process. Any suggestion submitted this way will be duplicated into our internal localization system, and then closed here.
Alternatively, you can launch feedback-hub://, click on the "Language Community" tab on the left-side of the app, and follow the steps to submit a localization suggestion that way. (The "Language Community" tab currently will only be visible if your system is running a non-English language).
Before filing a bug
- Ensure the bug reproduces on the latest version of the app.
- Search existing issues and make sure this issue is not already filed.
-->
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->
**Steps To Reproduce**
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->
**Device and Application Information**
- OS Build:
- Architecture:
- Application Version:
- Region:
- Dev Version Installed:
<!--
Run the following commands in Powershell and copy/paste the output.
" - OS Build: $([Environment]::OSVersion.Version)"
" - Architecture: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)"
" - Application Version: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)"
" - Region: $((Get-Culture).Name)"
" - Dev Version Installed: $($null -ne (Get-AppxPackage -Name Microsoft.WindowsCalculator.Dev))"
-->
**Additional context**
<!-- Add any other context about the problem here. -->

10
.gitignore vendored
View file

@ -289,5 +289,11 @@ __pycache__/
# Calculator specific # Calculator specific
Generated Files/ Generated Files/
!/build/config/TRexDefs/** src/GraphControl/GraphingImplOverrides.props
!src/CalculatorUnitTests/CalculatorUnitTests_TemporaryKey.pfx src/CalcViewModel/DataLoaders/DataLoaderConstants.h
!src/Calculator/WindowsDev_TemporaryKey.pfx
!src/CalculatorUnitTests/WindowsDev_TemporaryKey.pfx
!src/x64
!src/x86
!src/out
!src/ARM

View file

@ -3,7 +3,8 @@ The Calculator team encourages community feedback and contributions. Thank you f
making Calculator better! There are several ways you can get involved. making Calculator better! There are several ways you can get involved.
## Reporting issues and suggesting new features ## Reporting issues and suggesting new features
If Calculator is not working properly, please file a report in the [Feedback Hub](https://insider.windows.com/en-us/fb/?contextid=130&newFeedback=True). If Calculator is not working properly, please file a report in the
[Feedback Hub](https://insider.windows.com/en-us/fb/?contextid=130&newFeedback=True).
Feedback Hub reports automatically include diagnostic data, such as the version of Calculator Feedback Hub reports automatically include diagnostic data, such as the version of Calculator
you're using. you're using.
@ -17,21 +18,38 @@ all community interactions must abide by the [Code of Conduct](CODE_OF_CONDUCT.m
## Finding issues you can help with ## Finding issues you can help with
Looking for something to work on? Looking for something to work on?
[Issues marked *good first issue*](https://github.com/Microsoft/calculator/labels/good%20first%20issue) Issues marked [``good first issue``](https://github.com/Microsoft/calculator/labels/good%20first%20issue)
are a good place to start. are a good place to start.
You can also check [the *help wanted* tag](https://github.com/Microsoft/calculator/labels/help%20wanted) You can also check the [``help wanted``](https://github.com/Microsoft/calculator/labels/help%20wanted) tag to find
to find other issues to help with. other issues to help with. If you're interested in working on a fix, leave a comment to let everyone know and to help
avoid duplicated effort from others.
## Contributions we accept ## Contributions we accept
We welcome your contributions to the Calculator project, especially to fix bugs and to make We welcome your contributions to the Calculator project, especially to fix bugs and to make
improvements which address the top issues reported by Calculator users. improvements which address the top issues reported by Calculator users. Some general guidelines:
We have a high bar for new features and changes to the user experience. We prefer to evaluate * **DO** create one pull request per Issue, and ensure that the Issue is linked in the pull request.
*prototypes* to ensure that the design meets users' needs before we start discussing implementation * **DO** follow our [Coding and Style](#style-guidelines) guidelines, and keep code changes as small as possible.
details and reviewing code. We follow a [user-centered process for developing features](docs/NewFeatureProcess.md). * **DO** include corresponding tests whenever possible.
New features need sponsorship from the Calculator team, but we welcome community contributions at * **DO** check for additional occurrences of the same problem in other parts of the codebase before submitting your PR.
many stages of the process. * **DO** [link the issue](https://github.com/blog/957-introducing-issue-mentions) you are addressing in the
pull request.
* **DO** write a good description for your pull request. More detail is better. Describe *why* the change is being
made and *why* you have chosen a particular solution. Describe any manual testing you performed to validate your change.
* **DO NOT** submit a PR unless it is linked to an Issue marked
[`triage approved`](https://github.com/Microsoft/calculator/issues?q=is%3Aissue+is%3Aopen+label%3A%22Triage%3A+Approved%22).
This enables us to have a discussion on the idea before anyone invests time in an implementation.
* **DO NOT** merge multiple changes into one PR unless they have the same root cause.
* **DO NOT** submit pure formatting/typo changes to code that has not been modified otherwise.
We follow a [user-centered process for developing features](docs/NewFeatureProcess.md). New features
need sponsorship from the Calculator team, but we welcome community contributions at many stages of
the process.
> Submitting a pull request for an approved Issue is not a guarantee it will be approved.
> The change must meet our high bar for code quality, architecture, and performance, as well as
> [other requirements](#docs/NewFeatureProcess.md#technical-review).
## Making changes to the code ## Making changes to the code
@ -41,7 +59,8 @@ To learn how to build the code and run tests, follow the instructions in the [RE
### Style guidelines ### Style guidelines
The code in this project uses several different coding styles, depending on the age and history of The code in this project uses several different coding styles, depending on the age and history of
the code. Please attempt to match the style of surrounding code as much as possible. In new the code. Please attempt to match the style of surrounding code as much as possible. In new
components, prefer the patterns described in the [C++ core guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) components, prefer the patterns described in the
[C++ core guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)
and the [modern C++/WinRT language projections](https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/). and the [modern C++/WinRT language projections](https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/).
### Testing ### Testing
@ -61,18 +80,9 @@ to group your changes into a small number of commits which we can review one at
When completing a pull request, we will generally squash your changes into a single commit. Please When completing a pull request, we will generally squash your changes into a single commit. Please
let us know if your pull request needs to be merged as separate commits. let us know if your pull request needs to be merged as separate commits.
## Submitting a pull request and participating in code review ## Review Process
Writing a good description for your pull request is crucial to help reviewers and future
maintainers understand your change. More detail is better.
- [Link the issue you're addressing in the pull request](https://github.com/blog/957-introducing-issue-mentions).
- Describe *why* the change is being made and *why* you've chosen a particular solution.
- Describe any manual testing you performed to validate your change.
Please submit one pull request per issue. Large pull requests which have unrelated changes can be
difficult to review.
After submitting a pull request, members of the calculator team will review your code. We will After submitting a pull request, members of the calculator team will review your code. We will
assign the request to an appropriate reviewer within two days. Any member of the community may assign the request to an appropriate reviewer. Any member of the community may
participate in the review, but at least one member of the Calculator team will ultimately approve participate in the review, but at least one member of the Calculator team will ultimately approve
the request. the request.

View file

@ -37,3 +37,211 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
---
Appium DotNet Driver
Copyright 2014-2015 Appium Contributors
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -12,9 +12,13 @@ Calculator ships regularly with new features and bug fixes. You can get the late
- Standard Calculator functionality which offers basic operations and evaluates commands immediately as they are entered. - Standard Calculator functionality which offers basic operations and evaluates commands immediately as they are entered.
- Scientific Calculator functionality which offers expanded operations and evaluates commands using order of operations. - Scientific Calculator functionality which offers expanded operations and evaluates commands using order of operations.
- Programmer Calculator functionality which offers common mathematical operations for developers including conversion between common bases. - Programmer Calculator functionality which offers common mathematical operations for developers including conversion between common bases.
- Date Calculation functionality which offers the difference between two dates, as well as the ability to add/subtract years, months and/or days to/from a given input date.
- Calculation history and memory capabilities. - Calculation history and memory capabilities.
- Conversion between many units of measurement. - Conversion between many units of measurement.
- Currency conversion based on data retrieved from [Bing](https://www.bing.com). - Currency conversion based on data retrieved from [Bing](https://www.bing.com).
- [Infinite precision](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic) for basic
arithmetic operations (addition, subtraction, multiplication, division) so that calculations
never lose precision.
## Getting started ## Getting started
Prerequisites: Prerequisites:
@ -34,6 +38,9 @@ Prerequisites:
- Open [src\Calculator.sln](/src/Calculator.sln) in Visual Studio to build and run the Calculator app. - Open [src\Calculator.sln](/src/Calculator.sln) in Visual Studio to build and run the Calculator app.
- For a general description of the Calculator project architecture see [ApplicationArchitecture.md](docs/ApplicationArchitecture.md). - For a general description of the Calculator project architecture see [ApplicationArchitecture.md](docs/ApplicationArchitecture.md).
- To run the UI Tests, you need to make sure that
[Windows Application Driver (WinAppDriver)](https://github.com/microsoft/WinAppDriver/releases/latest)
is installed.
## Contributing ## Contributing
Want to contribute? The team encourages community feedback and contributions. Please follow our [contributing guidelines](CONTRIBUTING.md). Want to contribute? The team encourages community feedback and contributions. Please follow our [contributing guidelines](CONTRIBUTING.md).
@ -44,19 +51,24 @@ We also welcome [issues submitted on GitHub](https://github.com/Microsoft/calcul
## Roadmap ## Roadmap
For information regarding Windows Calculator plans and release schedule, please see the [Windows Calculator Roadmap](docs/Roadmap.md). For information regarding Windows Calculator plans and release schedule, please see the [Windows Calculator Roadmap](docs/Roadmap.md).
## Data / Telemetry ### Graphing Mode
Adding graphing calculator functionality [is on the project roadmap](https://github.com/Microsoft/calculator/issues/338) and we hope that this project can create a great end-user experience around graphing. To that end, the UI from the official in-box Windows Calculator is currently part of this repository, although the proprietary Microsoft-built graphing engine, which also drives graphing in Microsoft Mathematics and OneNote, is not. Community members can still be involved in the creation of the UI, however developer builds will not have graphing functionality due to the use of a [mock implementation of the engine](/src/GraphingImpl/Mocks) built on top of a
[common graphing API](/src/GraphingInterfaces).
## Diagnostic Data
This project collects usage data and sends it to Microsoft to help improve our products and services. This project collects usage data and sends it to Microsoft to help improve our products and services.
Read our [privacy statement](https://go.microsoft.com/fwlink/?LinkId=521839) to learn more. Read our [privacy statement](https://go.microsoft.com/fwlink/?LinkId=521839) to learn more.
Telemetry is disabled in development builds by default, and can be enabled with the `SEND_TELEMETRY` Diagnostic data is disabled in development builds by default, and can be enabled with the `SEND_DIAGNOSTICS`
build flag. build flag.
## Currency Converter
Windows Calculator includes a currency converter feature that uses mock data in developer builds. The data that
Microsoft uses for the currency converter feature (e.g., in the retail version of the application) is not licensed
for your use. The mock data will be clearly identifiable as it references planets instead of countries,
and remains static regardless of selected inputs.
## Reporting Security Issues ## Reporting Security Issues
Security issues and bugs should be reported privately, via email, to the Please refer to [SECURITY.md](./SECURITY.md).
Microsoft Security Response Center (MSRC) at <[secure@microsoft.com](mailto:secure@microsoft.com)>.
You should receive a response within 24 hours. If for some reason you do not, please follow up via
email to ensure we received your original message. Further information, including the
[MSRC PGP](https://technet.microsoft.com/en-us/security/dn606155) key, can be found in the
[Security TechCenter](https://technet.microsoft.com/en-us/security/default).
## License ## License
Copyright (c) Microsoft Corporation. All rights reserved. Copyright (c) Microsoft Corporation. All rights reserved.

48
SECURITY.md Normal file
View file

@ -0,0 +1,48 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.1 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all
source code repositories managed through our GitHub organizations, which include
[Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure),
[DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet),
[Xamarin](https://github.com/xamarin), and [many more](https://opensource.microsoft.com/).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets
Microsoft's [definition](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10))
of a security vulnerability, please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.** Instead, please
report them to the Microsoft Security Response Center at [secure@microsoft.com](mailto:secure@microsoft.com).
If possible, encrypt your message with our PGP key; please download it from the
[Microsoft Security Response Center PGP Key page](https://technet.microsoft.com/en-us/security/dn606155).
You should receive a response within 24 hours. If for some reason you do not, please follow up via
email to ensure we received your original message. Additional information can be found at
[microsoft.com/msrc](https://www.microsoft.com/msrc).
Please include the requested information listed below (as much as you can provide) to help us better
understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of
[Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->

View file

@ -0,0 +1,91 @@
<#
.DESCRIPTION
Helper script to format all header and source files in the repository.
By default, the script will recursively search under the repo root for
files to format. Users can give explicit parameters indicating how the
search should include and exclude filetypes.
If users don't want the search functionality, they can instead provide
an explicit list of files to format.
.PARAMETER RepoRoot
Full path to the root of the repository which is the target of the search.
Will default to the root of the current working directory.
.PARAMETER Include
Array of filetype extensions to target for formatting.
By default, targets standard extensions for header and source files.
Follows the same rules as the -Include parameter for Get-ChildItem.
.PARAMETER Exclude
Array of filetype extensions to exclude from formatting.
By default, excludes generated XAML files.
Follows the same rules as the -Exclude paramter for Get-ChildItem.
.PARAMETER Files
Array of files to format. The script will exit if one of the provided
filepaths does not exist.
.EXAMPLE
.\clang-format-all.ps1
Formats all header and source files under the repository root.
.EXAMPLE
.\clang-format-all.ps1 -RepoRoot 'S:\repos\calculator' -Include '*.h', '*.cpp' -Exclude '*.g.*'
Formats all *.h and *.cpp files under 'S:\repos\calculator', excluding files with an extension
like *.g.*
.EXAMPLE
.\clang-format-all.ps1 -File 'S:\repos\calculator\src\CalcViewModel\UnitConverterViewModel.h', 'S:\repos\calculator\src\CalcViewModel\MemoryItemViewModel.cpp'
Formats the specified files.
#>
[CmdletBinding( DefaultParameterSetName = 'Search' )]
param(
[Parameter( ParameterSetName = 'Search' )]
[ValidateScript({ Test-Path -PathType Container -Path $_ })]
[string] $RepoRoot = "$( git rev-parse --show-toplevel )",
[Parameter( ParameterSetName = 'Search' )]
[string[]] $Include = ( '*.h', '*.hh', '*.hpp', '*.c', '*.cc', '*.cpp' ),
[Parameter( ParameterSetName = 'Search' )]
[string[]] $Exclude = '*.g.*',
[Parameter(
ParameterSetName = 'Explicit',
Mandatory)]
[ValidateScript({
$_ | Where-Object { -not (Test-Path -PathType Leaf -Path $_) } |
ForEach-Object { throw "Could not find file: [$_]" }
return $true
})]
[string[]] $Files
)
if ($PSCmdlet.ParameterSetName -eq 'Explicit')
{
# Use the file paths we were given.
$targetFiles = @($Files)
}
else
{
# Gather the files to be formatted.
$targetFiles = @(
Get-ChildItem -Recurse -Path $RepoRoot -Include $Include -Exclude $Exclude |
Select-Object -ExpandProperty FullName
)
}
# Format the files.
$formatParams = @(
'-i' # In-place
'-style=file' # Search for a .clang-format file in the parent directory of the source file.
'-verbose'
)
clang-format $formatParams $targetFiles

View file

@ -0,0 +1,53 @@
#!/bin/bash
function usage {
echo "Usage: $0 DIR..."
exit 1
}
# Variable that will hold the name of the clang-format command
FMT=""
# Some distros just call it clang-format. Others (e.g. Ubuntu) are insistent
# that the version number be part of the command. We prefer clang-format if
# that's present, otherwise we work backwards from highest version to lowest
# version.
for clangfmt in clang-format{,-{4,3}.{9,8,7,6,5,4,3,2,1,0}}; do
if which "$clangfmt" &>/dev/null; then
FMT="$clangfmt"
break
fi
done
# Check if we found a working clang-format
if [ -z "$FMT" ]; then
echo "failed to find clang-format"
exit 1
fi
SRC_PATH="$@"
if [ -z "$SRC_PATH" ]; then
SRC_PATH="../../../src"
fi
# Check all of the arguments first to make sure they're all directories
for dir in "$SRC_PATH"; do
if [ ! -d "${dir}" ]; then
echo "${dir} is not a directory"
usage
fi
done
# Run clang-format -i on all of the things
for dir in "$SRC_PATH"; do
pushd "${dir}" &>/dev/null
find . \
\( -name '*.c' \
-o -name '*.cc' \
-o -name '*.cpp' \
-o -name '*.h' \
-o -name '*.hh' \
-o -name '*.hpp' \) \
-exec "${FMT}" -style=file -i '{}' \;
popd &>/dev/null
done

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Modules>
<Module
name="Microsoft.Windows.Apps.Calculator"
tdbuildteamid="86">
<File
location="Calculator"
path="%TFS_SOURCESDIRECTORY%\src\Calculator\Resources\en-US\Resources.resw" />
<File
location="Calculator"
path="%TFS_SOURCESDIRECTORY%\src\Calculator\Resources\en-US\CEngineStrings.resw" />
</Module>
</Modules>

View file

@ -1,5 +0,0 @@
<SignConfigXML>
<job platform="" configuration="" certSubject="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" jobname="EngFunSimpleSign" approvers="gstolt;vigarg">
<file src="__INPATHROOT__\Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle" signType="136020001" dest="__OUTPATHROOT__\Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle" />
</job>
</SignConfigXML>

View file

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE AMD64 Desktop WinPerf Test Run</BuildLogName>
<TemplateId>134858</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Performance_AMD64.testlist</RelativeFilePath>
<!-- Needed to be able to process multiple results for the same test case but not have reliability run checked on the task -->
<OptionalMetadataItems>
<OptionalMetadataItem>
<Key>VSTS\IsReliabilityRun</Key>
<Value>True</Value>
</OptionalMetadataItem>
</OptionalMetadataItems>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<TReXRunConfiguration>
<BuildLogName>RS4_RELEASE AMD64 DesktopVM Test Run</BuildLogName>
<TemplateId>139642</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_AMD64.testlist</RelativeFilePath>
<Branch>rs4_release</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<!-- RS5_RELEASE Desktop x64 VM run -->
<TReXRunConfiguration>
<BuildLogName>RS5_RELEASE AMD64 DesktopVM Test Run</BuildLogName>
<TemplateId>139642</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_AMD64.testlist</RelativeFilePath>
<Branch>rs5_release</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE AMD64 DesktopVM Test Run</BuildLogName>
<TemplateId>139642</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_AMD64.testlist</RelativeFilePath>
<Branch>rs_apps_validate</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE AMD64 WCOS Test Run</BuildLogName>
<TemplateId>153648</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>WCOS_AMD64.testlist</RelativeFilePath>
<Branch>rs_apps_validate</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<!--RS_PRERELEASE ARM WinCoreOS WinPerf run. -->
<TReXRunConfiguration>
<BuildLogName>RS_PRERELEASE ARM WindowsCore WinPerf Test Run</BuildLogName>
<TemplateId>135258</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Performance_ARM.testlist</RelativeFilePath>
<!-- Needed to be able to process multiple results for the same test case but not have reliability run checked on the task -->
<OptionalMetadataItems>
<OptionalMetadataItem>
<Key>VSTS\IsReliabilityRun</Key>
<Value>True</Value>
</OptionalMetadataItem>
</OptionalMetadataItems>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<!-- RS_APPS_VALIDATE WindowsCore ARM Device run -->
<!-- Disabling this until we have a testlist template -->
<!--<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE ARM WCOS Test Run</BuildLogName>
<TemplateId>140487</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_ARM.testlist</RelativeFilePath>
<Branch>rs_apps_validate</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>-->
</TReXRunConfigurations>

View file

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<!-- RS_APPS_VALIDATE Desktop x86 VM run -->
<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE x86 DesktopVM Test Run</BuildLogName>
<TemplateId>139643</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_x86.testlist</RelativeFilePath>
<Branch>rs4_release</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<!-- RS_PRERELEASE Desktop x86 VM run -->
<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE x86 DesktopVM Test Run</BuildLogName>
<TemplateId>139643</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_x86.testlist</RelativeFilePath>
<Branch>rs5_release</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TReXRunConfigurations>
<!-- RS_APPS_VALIDATE Desktop x86 VM run -->
<TReXRunConfiguration>
<BuildLogName>RS_APPS_VALIDATE x86 DesktopVM Test Run</BuildLogName>
<TemplateId>139643</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>Desktop_x86.testlist</RelativeFilePath>
<Branch>rs_apps_validate</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
<!-- RS_APPS_VALIDATE WindowsCore x86 VM run -->
<TReXRunConfiguration>
<BuildLogName>RS_PRERELEASE x86 WindowsCoreVM Test Run</BuildLogName>
<TemplateId>153715</TemplateId>
<Owner>paxeedev</Owner>
<PrivateRun>true</PrivateRun>
<CopyFirstJobSettingWithJobOverride>true</CopyFirstJobSettingWithJobOverride>
<RelativeFilePath>WCOS_x86.testlist</RelativeFilePath>
<Branch>rs_apps_validate</Branch>
<WorkflowParameters>
<WorkflowParameter>
<Key>AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
<WorkflowParameter>
<Key>_AlternatePackageRoot</Key>
<Value>\\pkges\release\TAEF\validation.taef.provenance\1812.20007-develop\UniversalTestPackages;\\edge-svcs\Release\MITALite\Apps_eng.mitalite_ci\Latest.tst</Value>
</WorkflowParameter>
</WorkflowParameters>
</TReXRunConfiguration>
</TReXRunConfigurations>

View file

@ -1,12 +0,0 @@
{
"$schema": "http://universaltest/schema/testlist-2.json",
"TestMDs": [
{
"FilePath": "Calculator.UITests\\Prebuilt\\Test\\arm\\fre\\Calculator.UITests.testmd",
"ExecutionProfile": "All"
},
{
"FilePath": "CalculatorUnitTests\\Prebuilt\\Test\\arm\\fre\\CalculatorUnitTests.testmd",
}
]
}

View file

@ -1,9 +0,0 @@
{
"$schema": "http://universaltest/schema/testlist-2.json",
"TestMDs": [
{
"FilePath": "Calculator.UITests\\Prebuilt\\Test\\arm\\fre\\Calculator.UITests.testmd",
"ExecutionProfile": "Performance"
}
]
}

View file

@ -1,12 +0,0 @@
{
"$schema": "http://universaltest/schema/testlist-2.json",
"TestMDs": [
{
"FilePath": "Calculator.UITests\\Prebuilt\\Test\\arm\\fre\\Calculator.UITests.testmd",
"ExecutionProfile": "All"
},
{
"FilePath": "CalculatorUnitTests\\Prebuilt\\Test\\arm\\fre\\CalculatorUnitTests.testmd",
}
]
}

View file

@ -1,12 +0,0 @@
{
"$schema": "http://universaltest/schema/testlist-2.json",
"TestMDs": [
{
"FilePath": "Calculator.UITests\\Prebuilt\\Test\\arm64\\fre\\Calculator.UITests.testmd",
"ExecutionProfile": "All"
},
{
"FilePath": "CalculatorUnitTests\\Prebuilt\\Test\\arm64\\fre\\CalculatorUnitTests.testmd",
}
]
}

View file

@ -1,12 +0,0 @@
{
"$schema": "http://universaltest/schema/testlist-2.json",
"TestMDs": [
{
"FilePath": "Calculator.UITests\\Prebuilt\\Test\\arm64\\fre\\Calculator.UITests.testmd",
"ExecutionProfile": "All"
},
{
"FilePath": "CalculatorUnitTests\\Prebuilt\\Test\\arm64\\fre\\CalculatorUnitTests.testmd",
}
]
}

View file

@ -1,28 +0,0 @@
{
"Branch": [
{
"collection":"microsoft",
"project":"OS",
"repo":"os",
"name":"official/rs_apps_utils",
"CheckinFiles": [
{
"source":"vpack/app/calculator.app.man",
"path": "/redist/mspartners/ipa/Calculator",
"type": "File"
},
{
"source":"vpack/app/calculator.app.man",
"path": "/onecoreuap/redist/mspartners/ipa/Calculator",
"type": "File"
}
]
}
],
"Email": [
{
"sendTo":"paxeedev",
"sendOnErrorOnly": "True"
}
]
}

View file

@ -1,28 +0,0 @@
{
"Branch": [
{
"collection":"microsoft",
"project":"OS",
"repo":"os",
"name":"official/rs_apps_validate",
"CheckinFiles": [
{
"source":"vpack/app/calculator.app.man",
"path": "/redist/mspartners/ipa/Calculator",
"type": "File"
},
{
"source":"vpack/app/calculator.app.man",
"path": "/onecoreuap/redist/mspartners/ipa/Calculator",
"type": "File"
}
]
}
],
"Email": [
{
"sendTo":"paxeedev",
"sendOnErrorOnly": "True"
}
]
}

View file

@ -6,10 +6,12 @@
trigger: trigger:
- master - master
- servicing/* - release/*
- feature/*
pr: pr:
- master - master
- servicing/* - release/*
- feature/*
name: 0.$(Date:yyMM).$(DayOfMonth)$(Rev:rr).0 name: 0.$(Date:yyMM).$(DayOfMonth)$(Rev:rr).0
@ -33,18 +35,17 @@ jobs:
platform: ARM64 platform: ARM64
condition: not(eq(variables['Build.Reason'], 'PullRequest')) condition: not(eq(variables['Build.Reason'], 'PullRequest'))
- template: ./templates/run-ui-tests.yaml
parameters:
platform: x64
runsettingsFileName: CalculatorUITests.ci.runsettings
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x64 platform: x64
reimageServiceConnection: essential-experiences-interactive-reimage
reimageSubscriptionId: a8f5eb47-e59c-44b4-8e42-e70811a047b5
reimageResourceGroup: EETestPublic
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x86 platform: x86
reimageServiceConnection: essential-experiences-interactive-reimage
reimageSubscriptionId: a8f5eb47-e59c-44b4-8e42-e70811a047b5
reimageResourceGroup: EETestPublic
- template: ./templates/package-appxbundle.yaml - template: ./templates/package-appxbundle.yaml

View file

@ -15,30 +15,32 @@ name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
jobs: jobs:
- job: Localize - job: Localize
pool: pool:
name: Package ES Custom Demands Lab A vmImage: windows-2019
demands: variables:
- ClientAlias -equals PKGESUTILAPPS skipComponentGovernanceDetection: true
workspace:
clean: outputs
steps: steps:
- checkout: self - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@1
clean: true displayName: Send resources to Touchdown Build
- task: PkgESSetupBuild@10
displayName: Initialize Package ES
inputs: inputs:
productName: Calculator teamId: 86
branchVersion: true authId: d3dd8113-65b3-4526-bdca-a00a7d1c37ba
authKey: $(LocServiceKey)
isPreview: false
relativePathRoot: src/Calculator/Resources/en-US/
resourceFilePath: '*.resw'
outputDirectoryRoot: src/Calculator/Resources/
- task: PkgESTouchdownLocService@10 - script: |
displayName: Package ES Touchdown Loc Service cd $(Build.SourcesDirectory)
git add -A
git diff --cached --exit-code
echo ##vso[task.setvariable variable=hasChanges]%errorlevel%
git diff --cached > $(Build.ArtifactStagingDirectory)\LocalizedStrings.patch
displayName: Check for changes and create patch file
- task: PublishPipelineArtifact@0
displayName: Publish patch file as artifact
condition: eq(variables['hasChanges'], '1')
inputs: inputs:
IsCallToServiceStepSelected: true artifactName: Patch
IsCheckedInFileSelected: true targetPath: $(Build.ArtifactStagingDirectory)
CheckinFilesAtOriginFilePath: true
GitLocPath: Loc/Resources
LocConfigFile: build/config/LocConfigPackageEs.xml
AuthenticationMode: OAuth
ClientApplicationID: d3dd8113-65b3-4526-bdca-a00a7d1c37ba
ApplicationKeyID: $(LocServiceKey)
SendToLoc: true

View file

@ -9,8 +9,8 @@ pr: none
variables: variables:
versionMajor: 10 versionMajor: 10
versionMinor: 1902 versionMinor: 2009
versionBuild: $[counter('10.1902.*', 0)] versionBuild: $[counter('10.2009.*', 0)]
versionPatch: 0 versionPatch: 0
name: '$(versionMajor).$(versionMinor).$(versionBuild).$(versionPatch)' name: '$(versionMajor).$(versionMinor).$(versionBuild).$(versionPatch)'
@ -30,25 +30,26 @@ jobs:
platform: ARM platform: ARM
condition: not(eq(variables['Build.Reason'], 'PullRequest')) condition: not(eq(variables['Build.Reason'], 'PullRequest'))
- template: ./templates/build-app-internal.yaml - template: ./templates/run-ui-tests.yaml
parameters: parameters:
platform: ARM64 platform: x64
condition: not(eq(variables['Build.Reason'], 'PullRequest')) runsettingsFileName: CalculatorUITests.release.runsettings
- template: ./templates/run-ui-tests.yaml
parameters:
platform: x86
runsettingsFileName: CalculatorUITests.release.runsettings
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x64 platform: x64
reimageServiceConnection: macool-sandbox-interactiveDesktopRS5
reimageSubscriptionId: 012a8008-c00f-45b3-9828-41ebba30141d
reimageResourceGroup: interactiveDesktopRS5
- template: ./templates/run-unit-tests.yaml - template: ./templates/run-unit-tests.yaml
parameters: parameters:
platform: x86 platform: x86
reimageServiceConnection: macool-sandbox-interactiveDesktopRS5
reimageSubscriptionId: 012a8008-c00f-45b3-9828-41ebba30141d
reimageResourceGroup: interactiveDesktopRS5
- template: ./templates/package-appxbundle.yaml - template: ./templates/package-appxbundle.yaml
parameters:
signBundle: true
- template: ./templates/prepare-release-internalonly.yaml - template: ./templates/prepare-release-internalonly.yaml

View file

@ -12,7 +12,7 @@ jobs:
displayName: Build ${{ parameters.platform }} displayName: Build ${{ parameters.platform }}
condition: ${{ parameters.condition }} condition: ${{ parameters.condition }}
pool: pool:
vmImage: vs2017-win2016 vmImage: windows-2019
variables: variables:
BuildConfiguration: Release BuildConfiguration: Release
BuildPlatform: ${{ parameters.platform }} BuildPlatform: ${{ parameters.platform }}
@ -27,9 +27,9 @@ jobs:
inputs: inputs:
command: download command: download
downloadDirectory: $(Build.SourcesDirectory) downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsApps vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-internals vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.7 vstsPackageVersion: 0.0.50
- template: ./build-single-architecture.yaml - template: ./build-single-architecture.yaml
parameters: parameters:

View file

@ -10,7 +10,7 @@ jobs:
displayName: Build ${{ parameters.platform }} displayName: Build ${{ parameters.platform }}
condition: ${{ parameters.condition }} condition: ${{ parameters.condition }}
pool: pool:
vmImage: vs2017-win2016 vmImage: windows-2019
variables: variables:
BuildConfiguration: Release BuildConfiguration: Release
BuildPlatform: ${{ parameters.platform }} BuildPlatform: ${{ parameters.platform }}

View file

@ -5,11 +5,10 @@ parameters:
extraMsBuildArgs: '' extraMsBuildArgs: ''
steps: steps:
- task: NuGetToolInstaller@0 - task: NuGetToolInstaller@1
displayName: Use NuGet 4.7.1 displayName: Use NuGet 5.x
inputs: inputs:
versionSpec: 4.7.1 versionSpec: 5.x
checkLatest: true
# In most accounts, you can just use 'NuGetCommand' instead of this GUID. # In most accounts, you can just use 'NuGetCommand' instead of this GUID.
# In the microsoft.visualstudio.com account, NuGetCommand is ambiguous so the GUID is needed. # In the microsoft.visualstudio.com account, NuGetCommand is ambiguous so the GUID is needed.
@ -17,7 +16,7 @@ steps:
displayName: NuGet restore src/Calculator.sln displayName: NuGet restore src/Calculator.sln
inputs: inputs:
command: custom command: custom
arguments: restore src/Calculator.sln -Verbosity Detailed -NonInteractive arguments: restore src/Calculator.sln -Verbosity Detailed
- task: PowerShell@2 - task: PowerShell@2
displayName: Set version number in AppxManifest displayName: Set version number in AppxManifest
@ -29,8 +28,8 @@ steps:
displayName: 'Build solution src/Calculator.sln' displayName: 'Build solution src/Calculator.sln'
inputs: inputs:
solution: src/Calculator.sln solution: src/Calculator.sln
vsVersion: 15.0 vsVersion: 16.0
msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:AppVersion=$(Build.BuildNumber) ${{ parameters.extraMsBuildArgs }} msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:AppVersion=$(Build.BuildNumber) /t:Publish /p:PublishDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\publish\ ${{ parameters.extraMsBuildArgs }}
platform: $(BuildPlatform) platform: $(BuildPlatform)
configuration: $(BuildConfiguration) configuration: $(BuildConfiguration)
clean: true clean: true

View file

@ -1,25 +1,28 @@
# This template contains a job which takes .appx packages which were built separately for each # This template contains a job which takes .appx packages which were built separately for each
# architecture (arm, x86, etc.) and combines them into a single .appxbundle. # architecture (arm, x86, etc.) and combines them into a single .appxbundle.
parameters:
signBundle: false
jobs: jobs:
- job: Package - job: Package
dependsOn: dependsOn:
- Buildx64 - Buildx64
- Buildx86 - Buildx86
- BuildARM - BuildARM
- BuildARM64
condition: | condition: |
and and
( (
in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'), in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'), in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'), in(dependencies.BuildARM.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')
in(dependencies.BuildARM64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')
) )
pool: pool:
vmImage: vs2017-win2016 vmImage: windows-2019
workspace: workspace:
clean: outputs clean: outputs
variables:
skipComponentGovernanceDetection: true
steps: steps:
- checkout: self - checkout: self
clean: true clean: true
@ -36,10 +39,13 @@ jobs:
filePath: $(Build.SourcesDirectory)\build\scripts\CreateAppxBundleMapping.ps1 filePath: $(Build.SourcesDirectory)\build\scripts\CreateAppxBundleMapping.ps1
arguments: '-InputPath $(Build.ArtifactStagingDirectory)\drop\Release -ProjectName Calculator -OutputFile $(Build.BinariesDirectory)\AppxBundleMapping.txt' arguments: '-InputPath $(Build.ArtifactStagingDirectory)\drop\Release -ProjectName Calculator -OutputFile $(Build.BinariesDirectory)\AppxBundleMapping.txt'
- script: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\MakeAppx.exe" bundle /v /bv %BUNDLEVERSION% /f %MAPPINGFILEPATH% /p %OUTPUTPATH%' - powershell: |
$buildVersion = [version]$Env:BUILDVERSION
$bundleVersion = "2020.$($buildVersion.Minor).$($buildVersion.Build).$($buildVersion.Revision)"
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\MakeAppx.exe" bundle /v /bv $bundleVersion /f $Env:MAPPINGFILEPATH /p $Env:OUTPUTPATH
displayName: Make AppxBundle displayName: Make AppxBundle
env: env:
BUNDLEVERSION: $(Build.BuildNumber) BUILDVERSION: $(Build.BuildNumber)
MAPPINGFILEPATH: $(Build.BinariesDirectory)\AppxBundleMapping.txt MAPPINGFILEPATH: $(Build.BinariesDirectory)\AppxBundleMapping.txt
OUTPUTPATH: $(Build.BinariesDirectory)\Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle OUTPUTPATH: $(Build.BinariesDirectory)\Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
@ -55,3 +61,43 @@ jobs:
inputs: inputs:
artifactName: appxBundle artifactName: appxBundle
pathToPublish: $(Build.ArtifactStagingDirectory)\appxBundle pathToPublish: $(Build.ArtifactStagingDirectory)\appxBundle
- ${{ if eq(parameters.signBundle, true) }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: Send appxbundle to code signing service
inputs:
ConnectedServiceName: Essential Experiences Codesign
FolderPath: $(Build.ArtifactStagingDirectory)\appxBundle
Pattern: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
signConfigType: inlineSignParams
inlineOperation: |
[
{
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"KeyCode": "Dynamic",
"OperationCode": "SigntoolvNextSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"CertTemplateName": "WINMSAPP1ST",
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
"KeyCode": "Dynamic",
"OperationCode": "SigntoolvNextVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- task: PublishBuildArtifacts@1
displayName: Publish AppxBundleSigned artifact
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)\appxBundle
artifactName: appxBundleSigned

View file

@ -1,9 +1,7 @@
# This template contains a job which builds artifacts needed to release the app to the store and to # This template contains a job which builds artifacts needed to release the app to the store and to
# Windows using Microsoft-internal systems. It relies Microsoft-internal resources and will not # Windows using Microsoft-internal systems. It relies on Microsoft-internal resources and will not
# work outside of Microsoft. # work outside of Microsoft.
# Specifically, this job: # Specifically, this job:
# - Signs the bundle using a secure system. If you want to build your own, use SignTool following
# the example in the continuous integration pipeline.
# - Builds VPacks for including the app in the Windows OS build. Azure DevOps Universal Packages # - Builds VPacks for including the app in the Windows OS build. Azure DevOps Universal Packages
# offers similar capabilities. # offers similar capabilities.
# - Creates StoreBroker packages containing Microsoft Store assets. Although the Store assets for # - Creates StoreBroker packages containing Microsoft Store assets. Although the Store assets for
@ -17,6 +15,14 @@ jobs:
name: Package ES Lab E name: Package ES Lab E
workspace: workspace:
clean: outputs clean: outputs
variables:
skipComponentGovernanceDetection: true
SBMediaRootPath: '$(TEMP)\SBMedia'
SBPackagePath: '$(Build.ArtifactStagingDirectory)\storeBrokerPayload'
SBLogPath: '$(SBPackagePath)\StoreBroker.log'
FlightId: '161f0975-cb5f-475b-8ef6-26383c37621f'
AppId: '9WZDNCRFHVN5'
ProductId: '00009007199266248474'
steps: steps:
- checkout: self - checkout: self
clean: true clean: true
@ -31,34 +37,21 @@ jobs:
env: env:
XES_DISABLEPROV: true XES_DISABLEPROV: true
- task: NuGetToolInstaller@0 - task: NuGetToolInstaller@1
displayName: Use NuGet 4.7.1 displayName: Use NuGet 5.x
inputs: inputs:
versionSpec: 4.7.1 versionSpec: 5.x
checkLatest: true
- task: DownloadBuildArtifacts@0 - task: DownloadBuildArtifacts@0
displayName: Download appxBundle artifact displayName: Download appxBundleSigned artifact
inputs: inputs:
artifactName: appxBundle artifactName: appxBundleSigned
- task: PkgESCodeSign@10
displayName: Send bundle to Package ES code signing service
inputs:
signConfigXml: build\config\SignConfig.xml
inPathRoot: $(Build.ArtifactStagingDirectory)\appxBundle
outPathRoot: $(Build.ArtifactStagingDirectory)\appxBundleSigned
- task: PublishBuildArtifacts@1
displayName: Publish AppxBundleSigned artifact
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)\appxBundleSigned
artifactName: AppxBundleSigned
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy signed AppxBundle to vpack staging folder displayName: Copy signed AppxBundle to vpack staging folder
inputs: inputs:
sourceFolder: $(Build.ArtifactStagingDirectory)\appxBundleSigned sourceFolder: $(Build.ArtifactStagingDirectory)\appxBundleSigned
contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
targetFolder: $(Build.ArtifactStagingDirectory)\vpack\appxBundle targetFolder: $(Build.ArtifactStagingDirectory)\vpack\appxBundle
- task: PkgESVPack@10 - task: PkgESVPack@10
@ -71,6 +64,8 @@ jobs:
pushPkgName: calculator.app pushPkgName: calculator.app
version: $(versionMajor).$(versionMinor).$(versionBuild) version: $(versionMajor).$(versionMinor).$(versionBuild)
owner: paxeeapps owner: paxeeapps
provData: false
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: Publish vpack\app artifact with vpack manifest displayName: Publish vpack\app artifact with vpack manifest
@ -78,68 +73,79 @@ jobs:
pathtoPublish: $(XES_VPACKMANIFESTDIRECTORY)\$(XES_VPACKMANIFESTNAME) pathtoPublish: $(XES_VPACKMANIFESTDIRECTORY)\$(XES_VPACKMANIFESTNAME)
artifactName: vpack\app artifactName: vpack\app
# TODO (macool): create and push internal test packages and test config
- task: UniversalPackages@0 - task: UniversalPackages@0
displayName: Download internals package displayName: Download internals package
inputs: inputs:
command: download command: download
downloadDirectory: $(Build.SourcesDirectory) downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsApps vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-internals vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.7 vstsPackageVersion: 0.0.50
- task: PkgESStoreBrokerPackage@10 - powershell: |
displayName: Create StoreBroker Packages # Just modify this line to indicate where your en-us PDP file is. Leave the other lines alone.
env: $enUSPdpFilePath = "$(Build.SourcesDirectory)\PDP\en-US\PDP.xml"
XES_SERIALPOSTBUILDREADY: True
# This is going to save the release value from the PDP file to $(SBMediaReleaseVersion)
# which you can then refer to in the UniversalPackages task.
$release = ([xml](Get-Content $enUSPdpFilePath)).ProductDescription.Release.Trim()
Write-Host "##vso[task.setvariable variable=SBMediaReleaseVersion;]$release"
displayName: Determine the PDP Media release version from the en-us PDP file
- task: UniversalPackages@0
displayName: Download PDP media (screenshots, trailers) universal package
inputs: inputs:
addToFlight: false command: download
configPath: tools/Build/StoreBroker/SBCalculatorConfig.json downloadDirectory: $(SBMediaRootPath)/$(SBMediaReleaseVersion)
PDPRootPath: $(Build.SourcesDirectory)\PDP vstsFeed: WindowsInboxApps
imagesRootPath: $(Build.SourcesDirectory)\PDPMediaRoot vstsFeedPackage: calculator-pdp-media
appxPath: $(Build.ArtifactStagingDirectory)\appxBundleSigned\Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle vstsPackageVersion: $(SBMediaReleaseVersion)
useArtifactServiceForMedia: true
outPath: $(Build.ArtifactStagingDirectory)\StoreBrokerPayload - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@2
paToken: $(System.AccessToken) displayName: Create StoreBroker Payload
logRootPath: $(Build.ArtifactStagingDirectory)/StoreBrokerLogs inputs:
serviceEndpoint: StoreBrokerProxy
sbConfigPath: Tools/Build/StoreBroker/SBCalculatorConfig.json
sourceFolder: $(Build.ArtifactStagingDirectory)/appxBundleSigned
contents: Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle
pdpPath: '$(Build.SourcesDirectory)\PDP'
pdpInclude: PDP.xml
pdpMediaPath: '$(SBMediaRootPath)'
outSBPackagePath: '$(SBPackagePath)'
outSBName: SBCalculator
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
displayName: Publish StoreBrokerPayload artifact displayName: Publish StoreBroker Payload artifact
inputs: inputs:
pathtoPublish: '$(SBPackagePath)'
artifactName: storeBrokerPayload artifactName: storeBrokerPayload
pathToPublish: $(Build.ArtifactStagingDirectory)/StoreBrokerPayload
- task: PkgESStoreBrokerFlight@10 - task: MS-RDX-MRO.windows-store-publish-dev.flight-task.store-flight@2
displayName: 'Flight StoreBroker Payload to team ring'
name: StoreBrokerFlight name: StoreBrokerFlight
displayName: Flight package with StoreBroker
env:
XES_SERIALPOSTBUILDREADY: True
inputs: inputs:
packageToFlight: Custom serviceEndpoint: StoreBrokerProxy
appId: 9WZDNCRFHVN5 appId: '$(AppId)'
flightId: 161f0975-cb5f-475b-8ef6-26383c37621f flightId: '$(FlightId)'
submissionDataPath: $(Build.ArtifactStagingDirectory)/StoreBrokerPayload/SBCalculator.json inputMethod: JsonAndZip
packagePath: $(Build.ArtifactStagingDirectory)/StoreBrokerPayload/SBCalculator.zip jsonPath: '$(SBPackagePath)\SBCalculator.json'
updatePackageAction: AddPackages zipPath: '$(SBPackagePath)\SBCalculator.zip'
logRootPath: $(Build.ArtifactStagingDirectory)/StoreBrokerLogs force: true
skipPolling: true
- task: PublishBuildArtifacts@1 targetPublishMode: Immediate
displayName: Publish StoreBrokerLogs artifact logPath: '$(SBLogPath)'
inputs:
artifactName: storeBrokerLogs
pathToPublish: $(Build.ArtifactStagingDirectory)/StoreBrokerLogs
- task: PkgESStoreBrokerAeroUpload@10 - task: PkgESStoreBrokerAeroUpload@10
displayName: Upload to Aero flighting dashboard displayName: Upload to Aero flighting dashboard
env: env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken) SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs: inputs:
productId: 00009007199266248474 ProductId: '$(ProductId)'
flightId: 161f0975-cb5f-475b-8ef6-26383c37621f FlightId: '$(FlightId)'
submissionId: $(StoreBrokerFlight.WS_SubmissionId) SubmissionId: '$(StoreBrokerFlight.WS_SubmissionId)'
submissionDataPath: $(Build.ArtifactStagingDirectory)/StoreBrokerPayload/SBCalculator.json SubmissionDataPath: '$(SBPackagePath)\SBCalculator.json'
packagePath: $(Build.ArtifactStagingDirectory)/StoreBrokerPayload/SBCalculator.zip PackagePath: '$(SBPackagePath)\SBCalculator.zip'
AeroEnvironment: Production
- task: PkgESLateTasks@10 - task: PkgESLateTasks@10
displayName: Run PackageES LateTasks displayName: Run PackageES LateTasks

View file

@ -0,0 +1,52 @@
# This template contains jobs to run UI tests using WinAppDriver.
parameters:
platform: ''
runsettingsFileName: ''
jobs:
- job: UITests${{ parameters.platform }}
displayName: UITests ${{ parameters.platform }}
dependsOn: Build${{ parameters.platform }}
condition: succeeded()
pool:
vmImage: windows-2019
variables:
skipComponentGovernanceDetection: true
steps:
- checkout: none
- powershell: Set-DisplayResolution -Width 1920 -Height 1080 -Force
displayName: Set resolution to 1920x1080
continueOnError: true
- task: DownloadBuildArtifacts@0
displayName: Download AppxBundle and CalculatorUITests
inputs:
artifactName: drop
itemPattern: |
drop/Release/${{ parameters.platform }}/Calculator/AppPackages/**
drop/Release/${{ parameters.platform }}/publish/**
- task: PowerShell@2
displayName: Install certificate
inputs:
filePath: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1
arguments: -CertificatePath $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Calculator_$(Build.BuildNumber)_${{ parameters.platform }}.cer -Force
- task: PowerShell@2
displayName: Install app
inputs:
filePath: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/Calculator/AppPackages/Calculator_$(Build.BuildNumber)_Test/Add-AppDevPackage.ps1
arguments: -Force
- task: VSTest@2
displayName: Run CalculatorUITests
inputs:
testAssemblyVer2: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/publish/CalculatorUITests.dll
vsTestVersion: 16.0
runSettingsFile: $(Build.ArtifactStagingDirectory)/drop/Release/${{ parameters.platform }}/publish/${{ parameters.runsettingsFileName }}
platform: ${{ parameters.platform }}
configuration: Release
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
testFiltercriteria: Priority=0

View file

@ -1,28 +1,21 @@
# This template contains jobs to run unit tests on the interactive test agents. # This template contains jobs to run unit tests.
parameters: parameters:
platform: '' platform: ''
reimageServiceConnection: '' runsettingsFileName: ''
reimageSubscriptionId: ''
reimageResourceGroup: ''
jobs: jobs:
- job: UnitTests${{ parameters.platform }} - job: UnitTests${{ parameters.platform }}
displayName: UnitTests ${{ parameters.platform }} displayName: UnitTests ${{ parameters.platform }}
dependsOn: Build${{ parameters.platform }} dependsOn: Build${{ parameters.platform }}
condition: succeeded()
pool: pool:
name: Essential Experiences Interactive vmImage: windows-2019
workspace: variables:
clean: outputs skipComponentGovernanceDetection: true
steps: steps:
- checkout: none - checkout: none
- powershell: Write-Host "##vso[task.setvariable variable=agentInstanceId;isOutput=true]$($env:AgentName -replace '\D+' -as [int])"
name: LogAgentStep
displayName: Log this agent's instance for later cleanup
env:
AgentName: $(Agent.Name)
- task: DownloadBuildArtifacts@0 - task: DownloadBuildArtifacts@0
displayName: Download CalculatorUnitTests displayName: Download CalculatorUnitTests
inputs: inputs:
@ -40,18 +33,3 @@ jobs:
inputs: inputs:
testAssemblyVer2: $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.appx testAssemblyVer2: $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.appx
otherConsoleOptions: /Platform:${{ parameters.platform }} otherConsoleOptions: /Platform:${{ parameters.platform }}
- job: CleanUpUnitTests${{ parameters.platform }}
dependsOn: UnitTests${{ parameters.platform }}
condition: and(always(), ne(dependencies.UnitTests${{ parameters.platform }}.Outputs['LogAgentStep.agentInstanceId'], ''))
pool: server
variables:
agentInstanceId: $[ dependencies.UnitTests${{ parameters.platform }}.outputs['LogAgentStep.agentInstanceId'] ]
steps:
- task: InvokeRESTAPI@1
displayName: Reimage test machine
inputs:
connectionType: connectedServiceNameARM
azureServiceConnection: ${{ parameters.reimageServiceConnection }}
urlSuffix: subscriptions/${{ parameters.reimageSubscriptionId }}/resourceGroups/${{ parameters.reimageResourceGroup }}/providers/Microsoft.Compute/virtualMachineScaleSets/essential/reimage?api-version=2018-10-01
body: '{ "instanceIds": ["$(agentInstanceId)"] }'

View file

@ -153,7 +153,9 @@ The CalcEngine contains the logic for interpreting and performing operations acc
### RatPack ### RatPack
The RatPack (short for Rational Pack) is the core of the Calculator model and contains the logic for performing its mathematical operations. The interface to this layer is defined in [ratpak.h][ratpak.h]. The RatPack (short for Rational Pack) is the core of the Calculator model and contains the logic for
performing its mathematical operations (using [infinite precision][Infinite Precision] arithmetic
instead of regular floating point arithmetic). The interface to this layer is defined in [ratpak.h][ratpak.h].
[References]:#################################################################################################### [References]:####################################################################################################
@ -199,4 +201,5 @@ The RatPack (short for Rational Pack) is the core of the Calculator model and co
[CalcManager folder]: ../src/CalcManager [CalcManager folder]: ../src/CalcManager
[CalculatorManager.h]: ../src/CalcManager/CalculatorManager.h [CalculatorManager.h]: ../src/CalcManager/CalculatorManager.h
[CalcEngine.h]: ../src/CalcManager/Header&#32;Files/CalcEngine.h [CalcEngine.h]: ../src/CalcManager/Header&#32;Files/CalcEngine.h
[Infinite Precision]: https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic
[ratpak.h]: ../src/CalcManager/Ratpack/ratpak.h [ratpak.h]: ../src/CalcManager/Ratpack/ratpak.h

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 256 KiB

Before After
Before After

View file

@ -54,6 +54,59 @@ Steps:
2. Select “miles” as the unit type in the output field 2. Select “miles” as the unit type in the output field
*Expected: The output starts with is “3.106856”* *Expected: The output starts with is “3.106856”*
### Always-on-Top
**Test 1**
Steps:
1. Launch the "Calculator" app and navigate to "Standard" Calculator
*Expected: Always-on-Top button's tooltip says "Keep on top"*
2. Click the Always-on-Top button
*Expected: Always-on-Top button's tooltip now says "Back to full view"*
3. Launch the "Notepad" app and put it in full-screen mode
*Expected: Calculator is still on top of Notepad and in Always-on-Top mode*
**Test 2**
Steps:
1. Launch the "Calculator" app and from "Standard" Calculator, input “3”, “+”, “3” (do not press “Enter”)
2. Tab over the Always-on-Top button and press "Enter" on the keyboard
*Expected: The application title, hamburger menu, calculator type title, calculation expression (the secondary line above the main display), history button and memory buttons are no longer visible. The main display shows "3"*
2. Press “Enter”
*Expected: The main display shows "6"*
3. Press "Ctrl-H" on the keyboard
*Expected: Nothing happens (history keyboard shortcuts are disabled)*
4. Press "Ctrl-P" on the keyboard, then tab over the Always-on-Top button and press "Enter" on the keyboard again
5. Open the Memory panel
*Expected: Nothing is stored in memory (memory keyboard shortcuts are disabled in Always-on-Top mode) and "6" is in history*
**Test 3**
Steps:
1. Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
2. Resize the window horizontally
*Expected: The buttons automatically expand or shrink to fit the available screen size*
3. Resize the window vertically
*Expected: The buttons automatically expand or shrink to fit the available screen size and the percent, square-root, squared and reciprocal buttons disappear when the screen height is small*
4. Click the Always-on-Top button again
*Expected: Calculator is in Standard mode and the original window layout from before Step 1 is restored*
5. Click the Always-on-Top button again
*Expected: Calculator is in Always-on-Top mode and the window size from after Step 3 is restored*
6. Close the "Calculator" app
7. Launch the "Calculator" app again and click the Always-on-Top button
*Expected: The window size from right before closing from Always-on-Top mode (ie. after Step 5) is restored*
**Test 4**
Steps:
1. Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
2. Input "/", "0", “Enter” on the keyboard
*Expected: "Result is undefined" is displayed in the system default app language*
3. Click the Always-on-Top button again
*Expected: Calculator is in Standard mode and all operator (except for "CE", "C", "Delete" and "=") and memory buttons are disabled
**Test 5**
Steps:
1. Launch the "Calculator" app and navigate to "Scientific" Calculator
*Expected: The Always-on-Top button is hidden*
2. Navigate to "Standard" Calculator
*Expected: The Always-on-Top button is visible*
## Basic Verification Tests ## Basic Verification Tests
@ -207,17 +260,19 @@ Steps:
4. While in the Menu: Check the About Page 4. While in the Menu: Check the About Page
*Expected: Everything in the about page fits into its window* *Expected: Everything in the about page fits into its window*
5. For Scientific Mode: At a Larger Scale 5. For Scientific Mode: At a Larger Scale
*Expected: All buttons are present and the up arrow is grayed out.* *Expected: All buttons are present and the 2nd button is grayed out.*
6. For Scientific Mode: At a Smaller Scale 6. For Scientific Mode: At a Smaller Scale
*Expected: All buttons are present and the up arrow is able to be toggled.* *Expected: All buttons are present and the 2nd button is able to be toggled.*
7. For Programmer Mode: At a Any Scale 7. For Programmer Mode: At a Any Scale
*Expected: All buttons are present and the up arrow is able to be toggled.* *Expected: All buttons are present and the 2nd button is able to be toggled.*
8. For Converter Mode: While Scaling 8. For Converter Mode: While Scaling
*Expected: The number pad and input areas move around each other gracefully.* *Expected: The number pad and input areas move around each other gracefully.*
9. Changing Language: Open Settings app > Time & language > Region & language > Add a language > Select a Right to Left (RTL) language such as Hebrew > Install the associated files> Set it to the system default. 9. For Graphing Mode: While Scaling
10. Set the system number format preference: Open a Run dialog (WIN + R) > type intl.cpl > Enter > In the format dropdown list > Select Hebrew > Apply. *Expected: The number pad, graph area, and input areas move around each other gracefully.*
11. Initiating the change: Package has completed installing > Sign out > Sign in. (This change to the app may also require a reinstallation of the build) 10. Changing Language: Open Settings app > Time & language > Region & language > Add a language > Select a Right to Left (RTL) language such as Hebrew > Install the associated files> Set it to the system default.
12. Repeat Steps 2-6 again in a (RTL) language. 11. Set the system number format preference: Open a Run dialog (WIN + R) > type intl.cpl > Enter > In the format dropdown list > Select Hebrew > Apply.
12. Initiating the change: Package has completed installing > Sign out > Sign in. (This change to the app may also require a reinstallation of the build)
13. Repeat Steps 2-6 again in a (RTL) language.
*Expected: No elements fall out of intended boundaries.* *Expected: No elements fall out of intended boundaries.*
@ -249,11 +304,60 @@ Verify the following:
11. "Bin" Binary: 11. "Bin" Binary:
*Expected: A B C D E F 2 3 4 5 6 7 8 9 are inactive. A maximum of 64 characters can be entered.* *Expected: A B C D E F 2 3 4 5 6 7 8 9 are inactive. A maximum of 64 characters can be entered.*
**Graphing Mode Test: Verify Graphing mode functions**
Steps:
1. Launch the "Calculator" app
2. Navigate to "Graphing" Calculator
3. Enter a function of x in the input field <br>
*Expected: Function is plotted in the graph area. Line color matches the colored square next to the input field*
4. Select the "+" button below the function input and enter more functions in the fields that appear <br>
*Expected: All functions are plotted in the graph area and match the colors of the input field squares*
5. Select the colored square for any function <br>
*Expected: Visibility of the function in the graph is toggled off/on*
6. Select the "Zoom In", "Zoom Out", and "Reset View' buttons in the graph area <br>
*Expected: Both X and Y axes zoom in, out, and revert to default settings, respectively*
7. Select the Trace button, then click + drag the graph until the red square is near a graphed function<br>
*Expected: Closest (X, Y) coordinates of the function to the red square are displayed with a black dot to indicate the location*
8. Enter "y=mx+b" into a function input field, then select "Variables" button <br>
*Expected: y=x+1 function is plotted in the graph, "Variables" modal window shows two variables "m" and "b" with values set to 1.*
9. Adjust the value, minimum, maximum, and step for each variable <br>
*Expected: y=mx+b graph adjusts to the new values for m and b, step size changes the increments of the slider for each value*
10. Share the graph via OneNote, Outlook/Mail, Twitter, and Feedback Hub <br>
*Expected: Modifiable message that contains an image of the graph customized for the chosen application opens*
11. Verify Key Graph Features tab shows the correct information for the following functions: <br>
*(Note: IP = Inflection Points, VA = Vertical Asymptotes, HA = Horizontal Asymptotes, OA = Oblique Asymptotes)* <br>
a. **y=x** <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: ⁅y∈⁆; X/Y Intercepts: (0)/(0); Max: none; Min: none; IP: none; VA: none; HA: none; OA: none; Parity: Odd; Monotonicity: (-∞, ∞) Increasing* <br>
b. **y=1/x** <br>
*Expected: Domain: ⁅𝑥≠0⁆; Range: ⁅y∈\{0}⁆; X/Y Intercepts: ø/ø; Max: none; Min: none; IP: none; VA: x=0; HA: y=0; OA: none; Parity: Odd; Monotonicity: (0, ∞) Decreasing, (-∞, 0) Increasing* <br>
c. **y=x^2** <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: ⁅y∈{0, ∞)⁆; X/Y Intercepts: (0)/(0); Max: none; Min: (0,0); IP: none; VA: none; HA: none; OA: none; Parity: Even; Monotonicity: (0, ∞) Increasing, (-∞, 0) Decreasing* <br>
d. **y=x^3** <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: ⁅y∈⁆; X/Y Intercepts: (0)/(0); Max: none; Min: none; IP: (0,0); VA: none; HA: none; OA: none; Parity: Odd; Monotonicity: (-∞, ∞) Increasing* <br>
e. **y=e^x** <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: ⁅y∈(0, ∞)⁆; X/Y Intercepts: ø/(1); Max: none; Min: none; IP: none; VA: none; HA: y=0; OA: none; Parity: none; Monotonicity: (-∞, ∞) Increasing* <br>
f. **y=ln(x)** <br>
*Expected: Domain: ⁅𝑥>0⁆; Range: ⁅y∈⁆; X/Y Intercepts: (1)/ø; Max: none; Min: none; IP: none; VA: x=0; HA: none; OA: none; Parity: none; Monotonicity: (0, ∞) Increasing* <br>
g. **y=sin(x)** <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: ⁅𝑦∈[1,1]⁆; X/Y Intercepts: (⁅𝜋n1,n1∈⁆)/(0); Max: ⁅(2𝜋n1+𝜋/2,1),n1∈⁆; Min: ⁅(2𝜋n1+3𝜋/2,1),n1∈⁆; IP: ⁅(𝜋n1,0),n1∈⁆; VA: none; HA: none; OA: none; Parity: Odd; Monotonicity: ⁅(2𝜋n1+𝜋/2,2𝜋n1+3𝜋/2),n1∈⁆ Decreasing; ⁅(2𝜋n1+3𝜋/2,2𝜋n1+5𝜋/2),n1∈⁆ Increasing; Period: 2𝜋* <br>
h. **y=cos(x)** <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: ⁅𝑦∈[1,1]⁆; X/Y Intercepts: (⁅𝜋n1+𝜋/2,n1∈⁆)/(1); Max: ⁅(2𝜋n1,1),n1∈⁆; Min: ⁅(2𝜋n1+𝜋,-1),n1∈⁆; IP: ⁅(𝜋n1+𝜋/2,0),n1∈⁆; VA: none; HA: none; OA: none; Parity: Even; Monotonicity: ⁅(2𝜋n1+𝜋,2𝜋n1+2𝜋),n1∈⁆ Increasing, ⁅(2𝜋n1,2𝜋n1+𝜋),n1∈⁆ Decreasing; Period: 2𝜋* <br>
i. **y=tan(x)** <br>
*Expected: Domain: ⁅x≠𝜋n1+𝜋/2,∀n1∈⁆; Range: ⁅𝑦∈ℝ⁆; X/Y Intercepts: (x=𝜋n1, n1 ∈ℤ)/(0); Max: none; Min: none; IP: x=𝜋n1, n1 ∈ℤ; VA: x=𝜋n1+𝜋/2, n1∈; HA: none; OA: none; Parity: Odd; Monotonicity: ⁅(𝜋n1+𝜋/2,𝜋n1+3𝜋/2),n1∈⁆ Increasing; Period: 𝜋* <br>
j. **y=sqrt(25-x^2)** <br>
*Expected: Domain: ⁅x∈[-5,5]⁆; Range: ⁅𝑦∈[0,5]⁆; X/Y Intercepts: (5),(-5)/(5); Max: (0,5); Min: (-5,0) and (5,0); IP: none; VA: none; HA: none; OA: none; Parity: Even; Monotonicity: (0,5) Decreasing, (-5,0) Increasing* <br>
k. **y=(-3x^2+2)/(x-1)** <br>
*Expected: Domain: ⁅x≠1⁆; Range: ⁅𝑦∈(-∞, -2√3 - 6}U{2√3 -6,∞⁆; X/Y Intercepts: (-√6/3),(√6/3)/(-2); Max: ⁅(√3/3+1,-2√36)⁆; Min: ⁅(√3/3+1,2√36)⁆; IP: none; VA: x=1; HA: none; OA: y=-3x-3; Parity: none; Monotonicity: (√3/3+1,∞) Decreasing, (1,√3/3+1,) Increasing(-√3/3+1,1), Increasing, (-∞,-√3/3+1) Decreasing* <br>
l. **y=sin(sin(x))** ("too complex" error test) <br>
*Expected: Domain: ⁅𝑥∈ℝ⁆; Range: Unable to calculate range for this function; X/Y Intercepts: none; Max: none; Min: none; IP: none; VA: none; HA: none; OA: none; Parity: odd; Monotonicity: Unable to determine the monotonicity of the function* <br>
*These features are too complex for Calculator to calculate: Range, X Intercept, Period, Minima, Maxima, Inflection Points, Monotonicity*
m. **y=mx+b** <br>
*Expected: Analysis is not supported for this function*
**Date Calculation Test: Verify dates can be calculated.** **Date Calculation Test: Verify dates can be calculated.**
Steps: Steps:
1. Launch the "Calculator" app. 1. Launch the "Calculator" app
2. Navigate to "Date Calculation" Calculator. 2. Navigate to "Date Calculation" Calculator
3. With "Difference between dates" Selected 3. With "Difference between dates" Selected
Change the various date input fields Change the various date input fields
*Expected: From and To reflect dates input respectively.* *Expected: From and To reflect dates input respectively.*
@ -278,78 +382,113 @@ Steps:
Steps: Steps:
1. Launch the "Calculator" app. 1. Launch the "Calculator" app.
For All Applicable Modes verify the following: For All Applicable Modes verify the following (note: only 11-15 and 20 work in Always-on-Top mode):
2. Press **Alt +1** to Enter "Standard" mode 2. Press **Alt +1** to enter "Standard" mode
*Expected: Move to "Standard" screen.* *Expected: Move to "Standard" screen.*
3. Press **Alt +2** to Enter "Scientific" mode 3. Press **Alt +2** to enter "Scientific" mode
*Expected: Move to "Scientific" screen.* *Expected: Move to "Scientific" screen.*
4. Press **Alt +3** to Enter "Programmer" mode 4. Press **Alt +3** to enter "Programmer" mode
*Expected: Move to "Programming" screen.* *Expected: Move to "Programming" screen.*
5. Press **Alt +4** to Enter "Date Calculation" mode 5. Press **Alt +4** to enter "Date Calculation" mode
*Expected: Move to "Date Calculation" screen.* *Expected: Move to "Date Calculation" screen.*
6. Press **Ctrl +M** to Store in Memory 6 Press **Alt +5** to enter "Graphing" mode
7. Press **Ctrl +P** to Add to Active Memory *Expected: Move to "Graphing" screen.*
8. Press **Ctrl +Q** to Subtract form Active Memory 7. Press **Ctrl +M** to Store in Memory
9. Press **Ctrl +R** to Recall from Memory 8. Press **Ctrl +P** to Add to Active Memory
10. Press **Ctrl +L** to Clear from Memory 9. Press **Ctrl +Q** to Subtract form Active Memory
11. Press **Delete** to Clear Current Input 'CE' 10. Press **Ctrl +R** to Recall from Memory
12. Press **Esc** to Full Clear Input 'C' 11. Press **Ctrl +L** to Clear from Memory
13. Press **F9** to Toggle '±' 12. Press **Delete** to Clear Current Input 'CE'
14. Press **R** to Select '1/x' 13. Press **Esc** to Full Clear Input 'C'
15. Press **@** to Select '√' 14. Press **F9** to Toggle '±'
16. Press **Ctrl + H** to Toggle History Panel 15. Press **R** to Select '1/x'
16. Press **@** to Select '√'
17. Press **Ctrl + H** to Toggle History Panel
*Expected: Function when in small scale window.* *Expected: Function when in small scale window.*
17. Press **Up arrow** to Move up History Panel 18. Press **Up arrow** to Move up History Panel
*Expected: Function when in small scale window.* *Expected: Function when in small scale window.*
18. Press **Down arrow** to Move Down History Panel 19. Press **Down arrow** to Move Down History Panel
*Expected: Function when in small scale window.* *Expected: Function when in small scale window.*
19. Press **Ctrl + Shift + D** to Clear History Panel 20. Press **Ctrl + Shift + D** to Clear History Panel
*Expected: Function when in small scale window.* *Expected: Function when in small scale window.*
20. Press **Spacebar** to Repeat Last Input 21. Press **Spacebar** to Repeat Last Input
Verify the following in Scientific Mode Verify the following in Scientific Mode
21. Press **F3** to Select 'DEG' 22. Press **F3** to Select 'DEG'
22. Press **F4** to Select 'RAD' 23. Press **F4** to Select 'RAD'
23. Press **F5** to Select 'GRAD' 24. Press **F5** to Select 'GRAD'
24. Press **Ctrl +G** to Select '10ˣ' 25. Press **Ctrl +G** to Select '10ˣ'
25. Press **Ctrl +Y** to Select 'y√x' 26. Press **Ctrl +Y** to Select 'y√x'
26. Press **Shift +O** to Select 'sin-1' 27. Press **Shift +O** to Select 'sin-1'
27. Press **Shift + S** to Select 'cos-1' 28. Press **Shift + S** to Select 'cos-1'
28. Press **Shift +T** to Select 'tan-1' 29. Press **Shift +T** to Select 'tan-1'
29. Press **Ctrl +O** to Select 'Cosh' 30. Press **Ctrl +O** to Select 'Cosh'
30. Press **Ctrl +S** to Select 'Sinh' 31. Press **Ctrl +S** to Select 'Sinh'
31. Press **Ctrl +T** to Select 'Tanh' 32. Press **Ctrl +T** to Select 'Tanh'
32. Press **D** to Select 'Mod' 33. Press **D** to Select 'Mod'
33. Press **L** to Select 'log' 34. Press **L** to Select 'log'
34. Press **M** to Select 'dms' 35. Press **M** to Select 'dms'
35. Press **N** to Select 'ln' 36. Press **N** to Select 'ln'
36. Press **Ctrl +N** to Select 'ex' 37. Press **Ctrl +N** to Select 'ex'
37. Press **O** to Select 'Cos' 38. Press **O** to Select 'Cos'
38. Press **P** to Select 'π' 39. Press **P** to Select 'π'
39. Press **Q** to Select 'x²' 40. Press **Q** to Select 'x²'
40. Press **S** to Select 'Sin' 41. Press **S** to Select 'Sin'
41. Press **T** to Select 'Tan' 42. Press **T** to Select 'Tan'
42. Press **V** to Toggle 'F-E' 43. Press **V** to Toggle 'F-E'
43. Press **X** to Select 'Exp' 44. Press **X** to Select 'Exp'
44. Press **Y** or **^** to Select 'xʸ' 45. Press **Y** or **^** to Select 'xʸ'
45. Press **#** to Select 'x³' 46. Press **#** to Select 'x³'
46. Press **!** to Select 'n!' 47. Press **!** to Select 'n!'
Verify the following in Programmer Mode Verify the following in Programmer Mode
47. Press **F2** to Select 'DWORD' 48. Press **F2** to Select 'DWORD'
48. Press **F3** to Select 'WORD' 49. Press **F3** to Select 'WORD'
49. Press **F4** to Select 'BYTE' 50. Press **F4** to Select 'BYTE'
50. Press **F5** to Select 'HEX' 51. Press **F5** to Select 'HEX'
51. Press **F6** to Select 'DEC' 52. Press **F6** to Select 'DEC'
52. Press **F7** to Select 'OCT' 53. Press **F7** to Select 'OCT'
53. Press **F8** to Select 'BIN' 54. Press **F8** to Select 'BIN'
54. Press **F12** to Select 'QWORD' 55. Press **F12** to Select 'QWORD'
55. Press **A-F** to Input in HEX 56. Press **A-F** to Input in HEX
56. Press **J** to Select 'RoL' 57. Press **J** to Select 'RoL'
57. Press **K** to Select 'RoR' 58. Press **K** to Select 'RoR'
58. Press **<** to Select 'Lsh' 59. Press **<** to Select 'Lsh'
59. Press **>** to Select 'Rsh' 60. Press **>** to Select 'Rsh'
60. Press **%** to Select 'Mod' 61. Press **%** to Select 'Mod'
61. Press **|** to Select 'Or' 62. Press **|** to Select 'Or'
62. Press **~** to Select 'Not' 63. Press **~** to Select 'Not'
63. Press **&** to Select 'And' 64. Press **&** to Select 'And'
Verify the following in Graphing Mode
65. Press **x** to Select 'x'
66. Press **y** to Select 'y'
67. Press **Ctrl +[Numpad+]** to Select 'Zoom In'
68. Press **Ctrl +[Numpad-]** to Select 'Zoom Out'
## Localization Tests
### Always-on-Top
**Test 1**
Steps:
1. Change the system default app language to Arabic
2. Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
*Expected: UI/Menu is localized (for example, the title bar buttons is in right-to-left order)*
3. Input "/", "0", “Enter” on the keyboard
*Expected: Error message is in Arabic*
## Ease of Access Tests
### Always-on-Top
**Test 1**
Steps:
1. Open the "Narrator" app
2. Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
3. Tab over the Always-on-Top button
*Expected: Narrator reads the localized version of "Back to full view"*
4. Tab over the main results field
*Expected: Narrator reads the localized version of exactly what's displayed (ie. "0")*
5. Tab over the rest of the UI elements
*Expected: Narrator reads the localized version of the UI elements' contents*

View file

@ -1,7 +1,8 @@
# New feature process # New feature process
## Where do I submit my idea for a new feature? ## Where do I submit my idea for a new feature?
The easiest way to submit new feature requests is through [Feedback Hub](https://insider.windows.com/en-us/fb/?contextid=130). The easiest way to submit new feature requests is through
[Feedback Hub](https://insider.windows.com/en-us/fb/?contextid=130).
In Feedback Hub, any Windows user (even if they aren't on GitHub) can upvote suggestions. The In Feedback Hub, any Windows user (even if they aren't on GitHub) can upvote suggestions. The
Calculator team reviews these suggestions regularly, and when we're ready to work on an idea we Calculator team reviews these suggestions regularly, and when we're ready to work on an idea we
create [feature pitch issues here on GitHub](https://github.com/Microsoft/calculator/issues?q=is%3Aissue+is%3Aopen+project%3AMicrosoft%2Fcalculator%2F1). create [feature pitch issues here on GitHub](https://github.com/Microsoft/calculator/issues?q=is%3Aissue+is%3Aopen+project%3AMicrosoft%2Fcalculator%2F1).
@ -12,73 +13,45 @@ product. The [Feature Tracking board](https://github.com/Microsoft/calculator/pr
all the features we're working on and where they're at in the process. all the features we're working on and where they're at in the process.
## Do I need to follow this process? Can I just start coding and submit a PR? ## Do I need to follow this process? Can I just start coding and submit a PR?
You *do not* need to follow this process for bug fixes, performance improvements, or changes to the You **do not** need to follow this process for bug fixes, performance improvements, or changes to the
development tools. To contribute these changes, [discuss the proposed change in an issue](https://github.com/Microsoft/calculator/issues/new) development tools. To contribute these changes,
[discuss the proposed change in an issue](https://github.com/Microsoft/calculator/issues/new)
and then submit a pull request. and then submit a pull request.
You *do* need to follow this process for any change which "users will notice". This applies You **do** need to follow this process for any change which "users will notice". This applies
especially to new features and major visual changes. especially to new features and major visual changes.
## Step 1: Feature pitch ## Step 1: Feature pitch
The feature pitch concisely describes a point of view on the problem the new feature should solve. Feature pitches are submitted as issues on GitHub using the
It will typically include these sections: [Feature Request template](https://github.com/Microsoft/calculator/issues/new?assignees=&labels=&template=feature_request.md&title=).
We encourage discussion on open issues, and as discussion progresses we will edit the issue description to refine the
idea until it is ready for review.
* **Problem Statement**: What problem are we trying to solve? Whos the target audience? Is there a We review pitches regularly, and will approve or close issues based on whether they broadly align with the
customer need or pain point we need to remedy? Is there a business goal or metric we are trying [Calculator roadmap](https://github.com/Microsoft/calculator/blob/master/docs/Roadmap.md). Approved pitches are moved
to improve? Do we have a hypothesis we want to prove or disprove? into [planning](https://github.com/Microsoft/calculator/projects/1) on the feature tracking board.
* **Evidence or User Insights**: Why should we do this? Potential sources of data: Feedback Hub,
other GitHub issues, other anecdotes from listening to customers in person or online, request
from another team, telemetry data, user research, market or competitive research
* **Proposal**: How will the solution/feature help us solve the problem? How will it meet the
target audiences needs? If there are business goals or metrics, how does this improve them?
* **Goals**: What you want to accomplish with this feature. Typical examples include “User Can
*perform some task*
* **Non-Goals**: Things we are explicitly not doing or supporting or that are out of scope,
including reasons why.
* **Low-Fidelity Concept**: Show as much of the experience as needed to explain the idea. This
can be as simple as a napkin drawing but can also be a code prototype, a PowerPoint walkthrough,
or a design comp.
The low-fidelity concept should be kept simple at this stage and refined during the pre-production ## Step 2: Planning
process. For most features, the output of this phase is a specification which describes how the feature will work, supported by
design renderings and code prototypes as needed. The original issue will continue to track the overall progress of the
feature, but we will create and iterate on spec documentation in the
[Calculator Spec repo](https://github.com/Microsoft/calculator-specs). Sometimes we'll learn new things about a feature
proposal during planning, and we'll edit or close the original pitch.
Feature pitches are submitted as issues on GitHub. We encourage discussion on open issues, and as We welcome community participation throughout planning. The best ideas often come from trying many ideas during
discussion progresses we will edit the issue description to refine the idea. the planning phase. To enable rapid
## Step 2: Pre-production
In the pre-production phase, we experiment with a variety of ways to address the goals described in
the feature pitch. The output of this phase is a specification which demonstrates how the feature
will work, supported by design renderings and code prototypes as needed. Sometimes we'll learn new
things about a feature proposal during pre-production, and we'll edit or close the original pitch.
We welcome community participation in the pre-production process. The GitHub issue will be the
primary place to share progress updates.
The best ideas often come from trying many ideas during the pre-production phase. To enable rapid
experimentation, we encourage developing and sharing rough ideas&mdash;maybe even with pencil and experimentation, we encourage developing and sharing rough ideas&mdash;maybe even with pencil and
paper&mdash;before making designs pixel-perfect or making code robust and maintainable. paper&mdash;before making designs pixel-perfect or making code robust and maintainable.
### Spec review After the [spec review](https://github.com/Microsoft/calculator-specs#spec-review) is completed, we will move the issue
Once there is a high-fidelity design which addresses the goals described in the original pitch, the into [implementation](https://github.com/Microsoft/calculator/projects/1) on the feature tracking board. In _some_ cases,
Microsoft product team will review the prototype and ensure all items on this checklist are all of the details of an idea can be captured concisely in original feature pitch. When that happens, we may move ideas
addressed: directly into implementation.
- [ ] Is there a high-fidelity design which gives reviewers a clear idea of how the feature will ## Step 3: Implementation
look and function when implemented? A feature can be implemented by the original submitter, a Microsoft team member, or by other
- [ ] Has the plan been shared with the community (documented on the wiki and updates posted in the community members. Code contributions and testing help are greatly appreciated. Please let everyone know if you're
original issue) and have others been given an opportunity to provide suggestions? actively working on a feature to help avoid duplicated efforts from others.
- [ ] Are [Fluent design principles](https://docs.microsoft.com/en-us/windows/uwp/design/fluent-design-system/)
followed? If we do something which deviates from the guidelines, do we have a good reason?
- [ ] Does the design include provisions for [all users](https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/designing-inclusive-software)
and [all cultures](https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/guidelines-and-checklist-for-globalizing-your-app)?
- [ ] Is it technically feasible to build this feature? Take a look at the "before committing"
checklist below and identify any issues which are likely to be blockers.
## Step 3: Production
A feature can be implemented by the original proposer, a Microsoft team member, or by other
community members. Code contributions and testing help are greatly appreciated. Please let us know
in the issue comments if you're actively working on a feature so we can ensure it's assigned to
you.
You might be able to reuse code written during the prototype process, although there will typically You might be able to reuse code written during the prototype process, although there will typically
be more work required to make the solution robust. Once the code is ready, you can begin be more work required to make the solution robust. Once the code is ready, you can begin
@ -122,7 +95,8 @@ new features, the Microsoft team considers at least these items:
- [ ] Run the perf tests to measure any increase in startup time. Move work out of the startup - [ ] Run the perf tests to measure any increase in startup time. Move work out of the startup
path if possible. path if possible.
- [ ] If the change adds additional logging: - [ ] If the change adds additional logging:
- [ ] All logging should use [TraceLogging](https://docs.microsoft.com/en-us/windows/desktop/tracelogging/trace-logging-about). - [ ] All logging should use
[TraceLogging](https://docs.microsoft.com/en-us/windows/desktop/tracelogging/trace-logging-about).
- [ ] Unnecessary log events should be removed, or configured so that they are collected only when - [ ] Unnecessary log events should be removed, or configured so that they are collected only when
needed to debug issues or measure feature usage. needed to debug issues or measure feature usage.
- [ ] If the change reads user data from files or app settings: - [ ] If the change reads user data from files or app settings:

View file

@ -4,14 +4,12 @@ Windows Calculator is under active development by Microsoft.
## Focus ## Focus
In 2019, the Windows Calculator team is focused on: In 2020, the Windows Calculator team is focused on:
* Refining our open source development process on GitHub * Iterating upon the existing app design based on the latest guidelines for [Fluent Design](https://developer.microsoft.com/en-us/windows/apps/design), [Windows 10X dual-screen devices](https://docs.microsoft.com/en-us/dual-screen/windows/), and [WinUI 3.0](https://github.com/microsoft/microsoft-ui-xaml).
* Iterating upon the existing app design based on the latest [Fluent Design guidelines](https://developer.microsoft.com/en-us/windows/apps/design) * Unblocking community contributions by identifying and addressing bottlenecks affecting developers, including migrating portions of the codebase to C# ([#893](https://github.com/microsoft/calculator/issues/893)) and adding a settings page ([#596](https://github.com/microsoft/calculator/issues/596)).
* Improving testing and diagnostics within the project * Addressing top user pain points, including clearing up confusion around how Standard Calculator behaves ([#138](https://github.com/microsoft/calculator/issues/138)) and fixing hidden characters in copied results ([#504](https://github.com/microsoft/calculator/issues/504)).
* Investigating new features with a focus on addressing top user feedback, including: * Investigating unit converter improvements ([#379](https://github.com/microsoft/calculator/issues/379), [#589](https://github.com/microsoft/calculator/issues/589) and [#594](https://github.com/microsoft/calculator/issues/594))
* Adding the ability for users to pin Calculator on top of other windows * [Your feature idea here] - please review our [new feature development process](https://github.com/Microsoft/calculator/blob/master/docs/NewFeatureProcess.md) to get started!
* Providing additional customization options
* [Your feature idea here] - please review our [new feature development process](https://github.com/Microsoft/calculator/blob/master/docs/NewFeatureProcess.md) to get started!
We welcome contributions of all kinds from the community, but especially those that support the efforts above. Please see our [contributing guidelines](https://github.com/Microsoft/calculator/blob/master/CONTRIBUTING.md) for more information on how to get involved. We welcome contributions of all kinds from the community, but especially those that support the efforts above. Please see our [contributing guidelines](https://github.com/Microsoft/calculator/blob/master/CONTRIBUTING.md) for more information on how to get involved.

View file

@ -1,131 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{24767C43-CD5A-4DC9-8D6B-429F255524E5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Calculator.TestPackage</RootNamespace>
<AssemblyName>Calculator.TestPackage</AssemblyName>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<NuGetTargetMoniker>.NETCore,Version=v5.0</NuGetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<FileAlignment>512</FileAlignment>
<!-- The app doesn't contain any tests so we don't generate a testmd -->
<NoTestMD>true</NoTestMD>
<NoPackage Condition="'$(IsTFSBuild)' != 'True'">True</NoPackage>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\x86</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\x86</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\x64</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\x64</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\arm</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\arm</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\ARM64\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\ARM64\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<None Include="Calculator.TestPackage.wm.xml" />
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Calculator\Calculator.vcxproj">
<Project>{9447424a-0e05-4911-beb8-e0354405f39a}</Project>
<Name>Calculator</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0' ">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<!-- Redefine build target as we don't want to build anything. -->
<Target Name="Build" />
<Target Name="Clean" />
<Target Name="Rebuild" />
<!-- Append the appx properties to the custom macros as we use this in the testmd.definition file. -->
<Target Name="AppendUniversalTestCustomMacros" BeforeTargets="BuildUniversalTest">
<ItemGroup>
<AppxBundleOutput Include="$(OutDir)..\Calculator\AppPackages\**\*.appxbundle" />
<AppxPackagePublicKeyFile Include="$(OutDir)..\Calculator\AppPackages\**\*.cer" />
</ItemGroup>
<PropertyGroup>
<AppxPackageTestDir>@(AppxBundleOutput->'%(RootDir)%(Directory)')</AppxPackageTestDir>
<UniversalTestCustomMacros Condition="'$(Configuration)'=='Debug'">$(UniversalTestCustomMacros)AppxPackageVCLibsDependency=$(AppxPackageTestDir)Dependencies\$(PlatformTarget)\Microsoft.VCLibs.$(PlatformTarget).Debug.14.00.appx;</UniversalTestCustomMacros>
<UniversalTestCustomMacros Condition="'$(Configuration)'=='Release'">$(UniversalTestCustomMacros)AppxPackageVCLibsDependency=$(AppxPackageTestDir)Dependencies\$(PlatformTarget)\Microsoft.VCLibs.$(PlatformTarget).14.00.appx;</UniversalTestCustomMacros>
<UniversalTestCustomMacros>$(UniversalTestCustomMacros)AppxPackageWinUIDependency=$(AppxPackageTestDir)Dependencies\$(PlatformTarget)\Microsoft.UI.Xaml.2.0.appx;</UniversalTestCustomMacros>
<UniversalTestCustomMacros>$(UniversalTestCustomMacros)AppxPackagePublicKeyFile=@(AppxPackagePublicKeyFile->'%(FullPath)');AppxBundleOutput=@(AppxBundleOutput->'%(FullPath)');</UniversalTestCustomMacros>
</PropertyGroup>
</Target>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Copyright (c) Microsoft Corporation. All rights reserved.-->
<identity
xmlns="urn:Microsoft.CompPlat/ManifestSchema.v1.00"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="App"
namespace="Calculator"
owner="Microsoft">
<files>
<file
source="$(AppxBundleOutput)"
destinationDir="$(runtime.testbin)"
name="Calculator.appxbundle" />
<file
source="$(AppxPackagePublicKeyFile)"
destinationDir="$(runtime.testbin)"
name="Calculator.cer" />
<file
source="$(AppxPackageVCLibsDependency)"
destinationDir="$(runtime.testbin)"
name="Microsoft.VCLibs.appx" />
<file
source="$(AppxPackageWinUIDependency)"
destinationDir="$(runtime.testbin)"
name="Microsoft.UI.Xaml.appx" />
</files>
</identity>

View file

@ -1,13 +0,0 @@
{
"dependencies": {
"Microsoft.TestInfrastructure.UniversalTest": "1.0.20181107.1"
},
"frameworks": {
"netcore50": {}
},
"runtimes": {
"win10-arm": {},
"win10-x64": {},
"win10-x86": {}
}
}

View file

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A43517B5-8BE3-4312-913F-004978C34444}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Calculator.UIAutomationLibrary</RootNamespace>
<AssemblyName>Calculator.UIAutomationLibrary</AssemblyName>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<NuGetTargetMoniker>.NETCore,Version=v5.0</NuGetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<FileAlignment>512</FileAlignment>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="CalculatorAppLauncher.cs" />
<Compile Include="Components\App\CalculatorAppLfm.cs" />
<Compile Include="Components\App\CalculatorAppPom.cs" />
<Compile Include="Components\ContentDialogLfm.cs" />
<Compile Include="Components\Pages\CalculatorBasePom.cs" />
<Compile Include="Components\Pages\AboutFlyoutLfm.cs" />
<Compile Include="Components\Pages\AboutFlyoutPom.cs" />
<Compile Include="Components\Pages\DateCalculatorLfm.cs" />
<Compile Include="Components\Pages\DateCalculatorPom.cs" />
<Compile Include="Components\Pages\UnitConverterLfm.cs" />
<Compile Include="Components\Pages\UnitConverterPom.cs" />
<Compile Include="Components\Shared\HistoryLfm.cs" />
<Compile Include="Components\Shared\HistoryPom.cs" />
<Compile Include="Components\Shared\ICanFocusWithClicks.cs" />
<Compile Include="Components\Shared\MemoryLfm.cs" />
<Compile Include="Components\Shared\MemoryPom.cs" />
<Compile Include="Components\Pages\NavBarLfm.cs" />
<Compile Include="Components\Pages\NavBarPom.cs" />
<Compile Include="Components\Shared\NumberPadPom.cs" />
<Compile Include="Components\Pages\ProgrammerCalculatorLfm.cs" />
<Compile Include="Components\Pages\ProgrammerCalculatorPom.cs" />
<Compile Include="Components\Pages\ScientificCalculatorLfm.cs" />
<Compile Include="Components\Pages\ScientificCalculatorPom.cs" />
<Compile Include="Components\Pages\StandardCalculatorLfm.cs" />
<Compile Include="Components\Pages\StandardCalculatorPom.cs" />
<Compile Include="Components\Pages\MainPageLfm.cs" />
<Compile Include="Components\Pages\MainPagePom.cs" />
<Compile Include="Utilities\Impersonator.cs" />
<Compile Include="Utilities\PerfTestConstants.cs" />
<Compile Include="Tests\BasicCalculationTest.cs" />
<Compile Include="Tests\ScientificCalculationTest.cs" />
<Compile Include="Utilities\EtwHelper.cs" />
<Compile Include="Utilities\InstallHelper.cs" />
<Compile Include="Components\ContentDialogPom.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utilities\Constants.cs" />
<Compile Include="Utilities\NativeMethods.cs" />
<Compile Include="Utilities\ServiceHelper.cs" />
<Compile Include="Utilities\UIObjectExtensions.cs" />
<Compile Include="Utilities\Utilities.cs" />
<Compile Include="Utilities\WindowHelper.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<ItemGroup />
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0' ">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!--additional imports-->
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,63 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Etw.Managed;
using Microsoft.OneCoreUap.Test.AppModel;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Calculator.UIAutomationLibrary.Components;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary
{
/// <summary>
/// Class that can open and close the Calculator app.
/// </summary>
public static class CalculatorAppLauncher
{
public const string CoreWindowClassName = "Windows.UI.Core.CoreWindow";
// This doesn't actually work right now because popup will disappear
// Bug 13713223: ContentDialog/Popup does not show up in the UIA tree when Windows.Current.Content has an AutomationName set.
// public static readonly UICondition TopLevelWindowUICondition = UICondition.CreateFromId(Constants.TopLevelWindowAutomationId);
public static readonly UICondition CoreWindowUICondition = UICondition.CreateFromClassName(CoreWindowClassName)
.AndWith(UICondition.CreateFromName(Constants.AppWindowName));
/// <summary>
/// Launch the app
/// </summary>
public static CalculatorAppLfm Launch()
{
Log.Comment("Launching Calculator and waiting for first page load...");
// Need to set this for the MITALite Tap~ methods to work on high DPI screens.
UAPApp.SetTestDPIAwareness();
// We want to be able to see any element in the tree
Context.RawContext.Activate();
// Set default wait timeout.
MS.Internal.Mita.Foundation.Waiters.Waiter.DefaultTimeout = TimeSpan.FromSeconds(30);
// Enable Mita internal logging.
MS.Internal.Mita.Foundation.Utilities.Log.OutImplementation = (s, a) => { Log.Comment($"- [MitaLite] { string.Format(s, a) }"); };
using (EtwWaiter appLaunchWaiter = new EtwWaiter(Constants.CalculatorETWProviderGUID, Constants.AppLaunchEndETWEventName))
{
var viewDescriptor = NavigationHelper.LaunchApplication(Constants.PackageAppUserModelId);
appLaunchWaiter.Wait(TimeSpan.FromSeconds(30));
Window calculatorWindow = new Window(UIObject.Root.Descendants.Find(CoreWindowUICondition));
Debug.Assert(calculatorWindow.ClassName == CoreWindowClassName);
// Move our window to the foreground.
WindowHelper.SetAsForeground(calculatorWindow.GetTopLevelWindow());
return new CalculatorAppLfm(new CalculatorAppPom(calculatorWindow), viewDescriptor);
}
}
}
}

View file

@ -1,43 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.OneCoreUap.Test.AppModel;
using MS.Internal.Mita.Foundation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator.UIAutomationLibrary.Components
{
public class CalculatorAppLfm
{
private readonly IViewDescriptor viewDescriptor;
public CalculatorAppLfm(CalculatorAppPom objectModel, IViewDescriptor viewDescriptor)
{
this.ObjectModel = objectModel;
this.viewDescriptor = viewDescriptor;
}
public CalculatorAppPom ObjectModel { get; }
public MainPageLfm MainPageLfm
{
get
{
return new MainPageLfm(this.ObjectModel.MainPagePom);
}
}
public void Close()
{
// ObjectModel is essentially the window ui object.
if (this.viewDescriptor != null)
{
NavigationHelper.CloseApplication(this.viewDescriptor.AUMID);
}
}
}
}

View file

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator.UIAutomationLibrary.Components
{
public class CalculatorAppPom : UIObject
{
/// <summary>
/// Creates a new instance of the <see cref="CalculatorAppPom"/> class.
/// </summary>
/// <param name="uiObject">UIObject for the calculator app window.</param>
public CalculatorAppPom(UIObject uiObject)
: base(uiObject)
{
}
public MainPagePom MainPagePom
{
get
{
return new MainPagePom(this);
}
}
}
}

View file

@ -1,35 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator.UIAutomationLibrary.Components
{
public class ContentDialogLfm
{
public ContentDialogLfm(ContentDialogPom objectModel)
{
this.ObjectModel = objectModel;
}
public ContentDialogPom ObjectModel { get; }
public void InvokePrimary()
{
this.ObjectModel.PrimaryButton.Invoke();
}
public void InvokeSecondary()
{
this.ObjectModel.SecondaryButton.Invoke();
}
public void InvokeClose()
{
this.ObjectModel.CloseButton.Invoke();
}
}
}

View file

@ -1,62 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
public class ContentDialogPom : UIObject
{
private static readonly UICondition textScrollViewerCondition = UICondition.CreateFromId("ContentScrollViewer");
private static readonly UICondition titleTextBlockCondition = UICondition.CreateFromClassName("TextBlock");
private static readonly UICondition primaryButtonCondition =
UICondition.CreateFromClassName("Button")
.AndWith(UICondition.CreateFromId("PrimaryButton"));
private static readonly UICondition secondaryButtonCondition =
UICondition.CreateFromClassName("Button")
.AndWith(UICondition.CreateFromId("SecondaryButton"));
private static readonly UICondition closeButtonCondition =
UICondition.CreateFromClassName("Button")
.AndWith(UICondition.CreateFromId("CloseButton"));
public ContentDialogPom(UIObject uiObject) : base(uiObject)
{
}
public Button PrimaryButton
{
get
{
return new Button(this.Children.Find(primaryButtonCondition));
}
}
public Button SecondaryButton
{
get
{
return new Button(this.Children.Find(secondaryButtonCondition));
}
}
public Button CloseButton
{
get
{
return new Button(this.Children.Find(closeButtonCondition));
}
}
public string Title
{
get
{
var scrollViewer = this.Children.Find(textScrollViewerCondition);
var textBlock = scrollViewer.Children.Find(titleTextBlockCondition);
return textBlock.Name;
}
}
}
}

View file

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Calculator.UIAutomationLibrary.Components
{
public class AboutFlyoutLfm : ICanFocusWithClicks
{
private const string FlyoutId = "FlyoutNav";
/// <summary>
/// Initializes a new instance of the <see cref="AboutFlyoutLfm" /> class.
/// </summary>
/// <param name="objectModel">The AboutFlyoutPom that represents the About flyout panel.</param>
public AboutFlyoutLfm(AboutFlyoutPom objectModel)
{
this.ObjectModel = objectModel;
}
public AboutFlyoutPom ObjectModel { get; }
public void FocusWithClicks()
{
this.ObjectModel.Title.DoubleClick();
}
public void Close()
{
this.ObjectModel.SendKeys("{ESC}");
}
}
}

View file

@ -1,29 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
public class AboutFlyoutPom : UIObject
{
private const string TitleId = "Header";
/// <summary>
/// Initializes a new instance of the <see cref="AboutFlyoutPom" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the navigation menu.</param>
public AboutFlyoutPom(UIObject uiObject) : base(uiObject)
{
}
public UIObject Title
{
get
{
return new UIObject(this.Descendants.Find(TitleId));
}
}
}
}

View file

@ -1,57 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Waiters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the Display section of the calculator modes.
/// </summary>
public class CalculatorBasePom : UIObject
{
private const string ExpressionContainerId = "CalculatorExpression";
private const string NormalOutputId = "normalOutput";
/// <summary>
/// Initializes a new instance of the <see cref="StandardCalculatorPom" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the standard calculator.</param>
public CalculatorBasePom(UIObject uiObject) : base(uiObject)
{
}
public TextBlock Expression
{
get
{
return new TextBlock(this.Descendants.Find(ExpressionContainerId));
}
}
public UIEventWaiter GetExpressionChangedWaiter()
{
return new PropertyChangedEventWaiter(this.Expression, UIProperty.Get("Name"));
}
public TextBlock Display
{
get
{
return new TextBlock(this.Descendants.Find(NormalOutputId));
}
}
public UIEventWaiter GetDisplayChangedWaiter()
{
return new PropertyChangedEventWaiter(this.Display, UIProperty.Get("Name"));
}
}
}

View file

@ -1,36 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Calculator.UIAutomationLibrary.Components
{
public class DateCalculatorLfm
{
public DateCalculatorLfm(DateCalculatorPom dateCalculatorPom)
{
this.ObjectModel = dateCalculatorPom;
}
public DateCalculatorPom ObjectModel { get; }
public void EnsureDateDifferenceMode()
{
this.OpenModeSelector();
this.ObjectModel.ModeSelector.AllItems[0].Select();
}
public void EnsureAddSubtractMode()
{
this.OpenModeSelector();
this.ObjectModel.ModeSelector.AllItems[1].Select();
}
private void OpenModeSelector()
{
using (var waiter = this.ObjectModel.ModeSelector.GetExpandedWaiter())
{
this.ObjectModel.ModeSelector.Expand();
waiter.TryWait();
}
}
}
}

View file

@ -1,25 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
public class DateCalculatorPom : UIObject
{
private const string ModeSelectorId = "DateCalculationOption";
public DateCalculatorPom(UIObject uiObject) : base(uiObject)
{
}
public ComboBox ModeSelector
{
get
{
return new ComboBox(this.Descendants.Find(ModeSelectorId));
}
}
}
}

View file

@ -1,255 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Etw.Managed;
using MS.Internal.Mita.Foundation.Waiters;
namespace Calculator.UIAutomationLibrary.Components
{
public class MainPageLfm : ICanFocusWithClicks
{
public MainPageLfm(MainPagePom objectModel)
{
this.ObjectModel = objectModel;
}
public MainPagePom ObjectModel { get; }
public NavBarLfm OpenNavBar()
{
using (EtwWaiter waiter = this.ObjectModel.GetNavBarOpenedWaiter())
{
this.ObjectModel.NavButton.Invoke();
waiter.Wait();
}
return new NavBarLfm(this.ObjectModel.NavBarPom);
}
public void CloseNavBar()
{
this.ObjectModel.NavBarPom.CloseButton.Invoke();
}
public void FocusWithClicks()
{
this.ObjectModel.Header.DoubleClick();
}
public StandardCalculatorLfm NavigateToStandardCalculator()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectStandard();
waiter.TryWait();
}
return new StandardCalculatorLfm(this.ObjectModel.StandardCalculatorPom);
}
public ScientificCalculatorLfm NavigateToScientificCalculator()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectScientific();
waiter.TryWait();
}
return new ScientificCalculatorLfm(this.ObjectModel.ScientificCalculatorPom);
}
public ProgrammerCalculatorLfm NavigateToProgrammerCalculator()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectProgrammer();
waiter.TryWait();
}
return new ProgrammerCalculatorLfm(this.ObjectModel.ProgrammerCalculatorPom);
}
public DateCalculatorLfm NavigateToDateCalculator()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectDate();
waiter.TryWait();
}
return new DateCalculatorLfm(this.ObjectModel.DateCalculatorPom);
}
public UnitConverterLfm NavigateToCurrencyConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectCurrency();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToVolumeConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectVolume();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToLengthConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectLength();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToWeightConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectWeight();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToTemperatureConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectTemperature();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToEnergyConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectEnergy();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToAreaConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectArea();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToSpeedConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectSpeed();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToTimeConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectTime();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToPowerConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectPower();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToDataConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectData();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToPressureConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectPressure();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public UnitConverterLfm NavigateToAngleConverter()
{
var navBar = this.OpenNavBar();
using (var waiter = this.ObjectModel.GetModeChangedWaiter())
{
navBar.SelectAngle();
waiter.TryWait();
}
return new UnitConverterLfm(this.ObjectModel.UnitConverterPom);
}
public AboutFlyoutLfm OpenAboutFlyout()
{
var navBar = this.OpenNavBar();
using (EtwWaiter waiter = new EtwWaiter(Constants.CalculatorETWProviderGUID, Constants.AboutFlyoutOpenedETWEventName))
{
navBar.SelectAbout();
waiter.Wait();
}
return new AboutFlyoutLfm(this.ObjectModel.AboutFlyoutPom);
}
}
}

View file

@ -1,51 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Etw.Managed;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Waiters;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Physical Object Model for the app window.
/// POM is the implementation model of the app.
/// See https://en.wikipedia.org/wiki/Model-based_testing for model-based testing.
/// </summary>
public class MainPagePom : UIObject
{
private const string NavButtonId = "TogglePaneButton";
private const string SplitViewPaneRootId = "PaneRoot";
private const string NavBarFlyoutId = "FlyoutNav";
private const string HeaderId = "Header";
private const string AboutPageFlyoutId = "AboutPageFlyout";
public MainPagePom(UIObject uiObject)
: base(uiObject)
{
}
public Button NavButton => new Button(this.Descendants.Find(UICondition.CreateFromId(NavButtonId)));
public UIObject Header => new UIObject(this.Descendants.Find(HeaderId));
public NavBarPom NavBarPom => new NavBarPom(this.Children.Find(SplitViewPaneRootId));
public EtwWaiter GetNavBarOpenedWaiter() => new EtwWaiter(Constants.CalculatorETWProviderGUID, Constants.NavBarOpenedETWEventName);
public StandardCalculatorPom StandardCalculatorPom => new StandardCalculatorPom(this);
public ScientificCalculatorPom ScientificCalculatorPom => new ScientificCalculatorPom(this);
public ProgrammerCalculatorPom ProgrammerCalculatorPom => new ProgrammerCalculatorPom(this);
public DateCalculatorPom DateCalculatorPom => new DateCalculatorPom(this);
public UnitConverterPom UnitConverterPom => new UnitConverterPom(this);
public AboutFlyoutPom AboutFlyoutPom => new AboutFlyoutPom(this.Descendants.Find(AboutPageFlyoutId));
public EtwWaiter GetModeChangedWaiter() => new EtwWaiter(Constants.CalculatorETWProviderGUID, Constants.AppModeChangeEndETWEventName);
}
}

View file

@ -1,144 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Windows.Automation;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Patterns;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the NavBar of the Calculator app.
/// </summary>
public class NavBarLfm : ICanFocusWithClicks
{
/// <summary>
/// Initializes a new instance of the <see cref="NavBarLfm" /> class.
/// </summary>
/// <param name="objectModel">The NavBarPom that represents the NavBar.</param>
public NavBarLfm(NavBarPom objectModel)
{
this.ObjectModel = objectModel;
}
public NavBarPom ObjectModel { get; }
public void SelectStandard()
{
SelectItem(this.ObjectModel.StandardMenuItem);
}
public void SelectScientific()
{
SelectItem(this.ObjectModel.ScientificMenuItem);
}
public void SelectProgrammer()
{
SelectItem(this.ObjectModel.ProgrammerMenuItem);
}
public void SelectDate()
{
SelectItem(this.ObjectModel.DateMenuItem);
}
public void SelectCurrency()
{
SelectItem(this.ObjectModel.CurrencyMenuItem);
}
public void SelectVolume()
{
SelectItem(this.ObjectModel.VolumeMenuItem);
}
public void SelectLength()
{
SelectItem(this.ObjectModel.LengthMenuItem);
}
public void SelectWeight()
{
SelectItem(this.ObjectModel.WeightMenuItem);
}
public void SelectTemperature()
{
SelectItem(this.ObjectModel.TemperatureMenuItem);
}
public void SelectEnergy()
{
SelectItem(this.ObjectModel.EnergyMenuItem);
}
public void SelectArea()
{
SelectItem(this.ObjectModel.AreaMenuItem);
}
public void SelectSpeed()
{
SelectItem(this.ObjectModel.SpeedMenuItem);
}
public void SelectTime()
{
SelectItem(this.ObjectModel.TimeMenuItem);
}
public void SelectPower()
{
SelectItem(this.ObjectModel.PowerMenuItem);
}
public void SelectData()
{
SelectItem(this.ObjectModel.DataMenuItem);
}
public void SelectPressure()
{
SelectItem(this.ObjectModel.PressureMenuItem);
}
public void SelectAngle()
{
SelectItem(this.ObjectModel.AngleMenuItem);
}
public void SelectAbout()
{
this.ObjectModel.AboutButton.Invoke();
}
public void Close()
{
this.ObjectModel.CloseButton.Invoke();
}
public void FocusWithClicks()
{
// To focus (for AccSpot) without changing anything, click to the right of the close button.
Button button = this.ObjectModel.CloseButton;
int xPos = button.BoundingRectangle.Width + Constants.ClickMargin;
int yPos = button.BoundingRectangle.Height / 2;
button.DoubleClick(PointerButtons.Primary, xPos, yPos);
}
private void SelectItem(ListViewItem item)
{
if (item.IsSelected)
{
this.Close();
}
else
{
item.Select();
}
}
}
}

View file

@ -1,96 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Linq;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the navigation menu.
/// </summary>
public class NavBarPom : UIObject
{
private const string StandardId = "Standard";
private const string ScientificId = "Scientific";
private const string ProgrammerId = "Programmer";
private const string DateId = "Date";
private const string CurrencyId = "Currency";
private const string VolumeId = "Volume";
private const string LengthId = "Length";
private const string WeightId = "Weight";
private const string TemperatureId = "Temperature";
private const string EnergyId = "Energy";
private const string AreaId = "Area";
private const string SpeedId = "Speed";
private const string TimeId = "Time";
private const string PowerId = "Power";
private const string DataId = "Data";
private const string PressureId = "Pressure";
private const string AngleId = "Angle";
private const string AboutId = "AboutButton";
private const string CloseId = "TogglePaneButton";
private const string FlyoutListViewId = "MenuItemsHost";
private const string ConverterSectionId = "Converter";
private const string ConverterTextKey = "ConverterModeText";
/// <summary>
/// Initializes a new instance of the <see cref="NavBarPom" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the navigation menu.</param>
public NavBarPom(UIObject uiObject) : base(uiObject)
{
}
public ListViewItem StandardMenuItem => ScrollAndGetItem(StandardId);
public ListViewItem ScientificMenuItem => ScrollAndGetItem(ScientificId);
public ListViewItem ProgrammerMenuItem => ScrollAndGetItem(ProgrammerId);
public ListViewItem DateMenuItem => ScrollAndGetItem(DateId);
public ListViewItem CurrencyMenuItem => ScrollAndGetItem(CurrencyId);
public ListViewItem VolumeMenuItem => ScrollAndGetItem(VolumeId);
public ListViewItem LengthMenuItem => ScrollAndGetItem(LengthId);
public ListViewItem WeightMenuItem => ScrollAndGetItem(WeightId);
public ListViewItem TemperatureMenuItem => ScrollAndGetItem(TemperatureId);
public ListViewItem EnergyMenuItem => ScrollAndGetItem(EnergyId);
public ListViewItem AreaMenuItem => ScrollAndGetItem(AreaId);
public ListViewItem SpeedMenuItem => ScrollAndGetItem(SpeedId);
public ListViewItem TimeMenuItem => ScrollAndGetItem(TimeId);
public ListViewItem PowerMenuItem => ScrollAndGetItem(PowerId);
public ListViewItem DataMenuItem => ScrollAndGetItem(DataId);
public ListViewItem PressureMenuItem => ScrollAndGetItem(PressureId);
public ListViewItem AngleMenuItem => ScrollAndGetItem(AngleId);
public Button AboutButton => new Button(this.Descendants.Find(AboutId));
public Button CloseButton => new Button(this.Parent.Children.Find(CloseId));
public ListView ModeListView => new ListView(this.Descendants.Find(FlyoutListViewId));
private ListViewItem ScrollAndGetItem(string id)
{
ListViewItem item;
var res = this.ModeListView.AllItems.TryFind(id, out item);
item.ScrollIntoView();
return item;
}
}
}

View file

@ -1,56 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation.Waiters;
namespace Calculator.UIAutomationLibrary.Components
{
public class ProgrammerCalculatorLfm
{
public ProgrammerCalculatorLfm(ProgrammerCalculatorPom programmerCalculatorPom)
{
this.ObjectModel = programmerCalculatorPom;
}
public ProgrammerCalculatorPom ObjectModel { get; }
public void EnsureFullKeypad()
{
if (!this.ObjectModel.FullKeypadButton.IsSelected)
{
this.ObjectModel.FullKeypadButton.Select();
}
}
public void EnsureBitTogglingKeypad()
{
if (!this.ObjectModel.BitFlipKeypadButton.IsSelected)
{
this.ObjectModel.BitFlipKeypadButton.Select();
}
}
public void ChangeBitLength()
{
this.ObjectModel.GetCurrentBitLengthButton().Invoke();
}
public MemoryLfm OpenMemory()
{
MemoryLfm lfm = new MemoryLfm(this.ObjectModel.MemoryControls);
lfm.OpenBody();
return lfm;
}
public void FiveMemorySet()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
this.ObjectModel.NumberPad.FiveButton.Invoke();
waiter.TryWait();
}
this.ObjectModel.MemoryControls.SetButton.Invoke();
}
}
}

View file

@ -1,56 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Waiters;
namespace Calculator.UIAutomationLibrary.Components
{
public class ProgrammerCalculatorPom : UIObject
{
private const string FullKeypadButtonId = "fullKeypad";
private const string BitFlipKeypadButtonId = "bitFlip";
private const string CalculatorResultsId = "CalculatorResults";
private const string NumberPadId = "NumberPad";
private readonly string[] BitLengthButtonIds =
{
"qwordButton",
"dwordButton",
"wordButton",
"byteButton"
};
public ProgrammerCalculatorPom(UIObject uiObject) : base(uiObject)
{
}
public NumberPadPom NumberPad => new NumberPadPom(this.Descendants.Find(NumberPadId));
public MemoryPom MemoryControls => new MemoryPom(this);
public RadioButton FullKeypadButton => new RadioButton(this.Descendants.Find(FullKeypadButtonId));
public RadioButton BitFlipKeypadButton => new RadioButton(this.Descendants.Find(BitFlipKeypadButtonId));
public TextBlock Display => new TextBlock(this.Descendants.Find(CalculatorResultsId));
public UIEventWaiter GetDisplayChangedWaiter() => this.Display.GetNameChangedWaiter();
public Button GetCurrentBitLengthButton()
{
// There are four bit length buttons, with only one visible at a time.
UIObject button = null;
foreach (var buttonId in this.BitLengthButtonIds)
{
if (this.Descendants.TryFind(buttonId, out button))
{
break;
}
}
return new Button(button);
}
}
}

View file

@ -1,138 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation.Waiters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the Standard calculator view.
/// </summary>
public class ScientificCalculatorLfm
{
/// <summary>
/// Initializes a new instance of the <see cref="ScientificCalculatorLfm" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the scientific Calculator.</param>
public ScientificCalculatorLfm(ScientificCalculatorPom objectModel)
{
this.ObjectModel = objectModel;
}
public ScientificCalculatorPom ObjectModel { get; }
public void Press1()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking 1");
this.ObjectModel.OneButton.Invoke();
waiter.TryWait();
}
}
public void Press2()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking 2");
this.ObjectModel.NumberPad.TwoButton.Invoke();
waiter.TryWait();
}
}
public void Press3()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking 3");
this.ObjectModel.ThreeButton.Invoke();
waiter.TryWait();
}
}
public void Press4()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking 4");
this.ObjectModel.FourButton.Invoke();
waiter.TryWait();
}
}
public void PressSqrt()
{
// When invoking sqrt, both the expression changes.
using (UIEventWaiter waiter = this.ObjectModel.GetExpressionChangedWaiter())
{
Log.Comment("Invoking sqrt");
this.ObjectModel.SqrtButton.Invoke();
waiter.TryWait();
}
}
public void PressMinus()
{
using (UIEventWaiter waiter = this.ObjectModel.GetExpressionChangedWaiter())
{
Log.Comment("Invoking minus");
this.ObjectModel.MinusButton.Invoke();
waiter.TryWait();
}
}
public void PressPlus()
{
using (UIEventWaiter waiter = this.ObjectModel.GetExpressionChangedWaiter())
{
Log.Comment("Invoking plus");
this.ObjectModel.PlusButton.Invoke();
waiter.TryWait();
}
}
public void PressEquals()
{
// When invoking equals, both the display and the expression change.
using (UIEventWaiter expressionWaiter = this.ObjectModel.GetExpressionChangedWaiter())
using (UIEventWaiter displayWaiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking equals");
this.ObjectModel.EqualButton.Invoke();
expressionWaiter.TryWait();
displayWaiter.TryWait();
}
}
public void OnePlusTwoEnter()
{
Press1();
PressPlus();
Press2();
PressEquals();
}
public void MemorySet() => this.ObjectModel.MemoryControls.SetButton.Invoke();
public MemoryLfm OpenMemory()
{
MemoryLfm lfm = new MemoryLfm(this.ObjectModel.MemoryControls);
lfm.OpenBody();
return lfm;
}
public HistoryLfm OpenHistory()
{
HistoryLfm lfm = new HistoryLfm(this.ObjectModel.HistoryControls);
lfm.OpenBody();
return lfm;
}
}
}

View file

@ -1,63 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the Scientific Calculator
/// </summary>
public class ScientificCalculatorPom : CalculatorBasePom
{
private const string NumberPadId = "NumberPad";
private const string StandardOperatorsId = "StandardOperators";
private const string DisplayControlsId = "DisplayControls";
private const string ScientificFunctionsId = "ScientificFunctions";
private const string OneButtonId = "num1Button";
private const string ThreeButtonId = "num3Button";
private const string FourButtonId = "num4Button";
private const string SqrtButtonId = "squareRootButton";
private const string MinusButtonId = "minusButton";
private const string PlusButtonId = "plusButton";
private const string EqualButtonId = "equalButton";
private const string ClearButtonId = "clearButton";
/// <summary>
/// Initializes a new instance of the <see cref="ScientificCalculatorPom" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the scientific calculator.</param>
public ScientificCalculatorPom(UIObject uiObject) : base(uiObject)
{
}
public UIObject StandardOperatorsGroup => this.Descendants.Find(StandardOperatorsId);
public UIObject DisplayControlsGroup => this.Descendants.Find(DisplayControlsId);
public UIObject ScientificFunctionsGroup => this.Descendants.Find(ScientificFunctionsId);
public Button OneButton => this.NumberPad.OneButton;
public Button ThreeButton => this.NumberPad.ThreeButton;
public Button FourButton => this.NumberPad.FourButton;
public Button SqrtButton => new Button(this.ScientificFunctionsGroup.Children.Find(SqrtButtonId));
public Button MinusButton => new Button(this.StandardOperatorsGroup.Children.Find(MinusButtonId));
public Button PlusButton => new Button(this.StandardOperatorsGroup.Children.Find(PlusButtonId));
public Button EqualButton => new Button(this.StandardOperatorsGroup.Children.Find(EqualButtonId));
public Button ClearButton => new Button(this.DisplayControlsGroup.Children.Find(ClearButtonId));
public NumberPadPom NumberPad => new NumberPadPom(this.Descendants.Find(NumberPadId));
public HistoryPom HistoryControls => new HistoryPom(this);
public MemoryPom MemoryControls => new MemoryPom(this);
}
}

View file

@ -1,94 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation.Waiters;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the Standard calculator view.
/// </summary>
public class StandardCalculatorLfm
{
/// <summary>
/// Initializes a new instance of the <see cref="StandardCalculatorLfm" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the Standard Calculator.</param>
public StandardCalculatorLfm(StandardCalculatorPom objectModel)
{
this.ObjectModel = objectModel;
}
public StandardCalculatorPom ObjectModel { get; }
public void OnePlusTwoEnter()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking 1");
this.ObjectModel.NumPad.OneButton.Invoke();
waiter.TryWait();
}
using (UIEventWaiter waiter = this.ObjectModel.GetExpressionChangedWaiter())
{
Log.Comment("Pressing +");
this.ObjectModel.SendKeys("{ADD}");
// PropertyChangeWaiter is unreliable for the first name changed notification
// Bug 17624996: PropertyChanged event not fired when Name is updated for the first time for a control with custom automation peer.
waiter.TryWait();
}
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Pressing 2");
this.ObjectModel.SendKeys("2");
waiter.TryWait();
}
// When pressing enter, both the display and the expression change.
using (UIEventWaiter expressionWaiter = this.ObjectModel.GetExpressionChangedWaiter())
using (UIEventWaiter displayWaiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Invoking equals");
this.ObjectModel.EqualButton.Invoke();
expressionWaiter.TryWait();
displayWaiter.TryWait();
}
}
public void Clear()
{
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
Log.Comment("Pressing escape");
this.ObjectModel.ClearButton.Invoke();
waiter.TryWait();
}
}
public void ClearFiveMemorySet()
{
this.Clear();
using (UIEventWaiter waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
this.ObjectModel.NumPad.FiveButton.Invoke();
waiter.TryWait();
}
this.ObjectModel.MemoryControls.SetButton.Invoke();
}
public MemoryLfm OpenMemory()
{
MemoryLfm lfm = new MemoryLfm(this.ObjectModel.MemoryControls);
lfm.OpenBody();
return lfm;
}
public HistoryLfm OpenHistory()
{
HistoryLfm lfm = new HistoryLfm(this.ObjectModel.HistoryControls);
lfm.OpenBody();
return lfm;
}
}
}

View file

@ -1,45 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Waiters;
namespace Calculator.UIAutomationLibrary.Components
{
/// <summary>
/// Represents the Standard Calculator
/// </summary>
public class StandardCalculatorPom : CalculatorBasePom
{
private const string CalculatorResultsId = "CalculatorResults";
private const string ExpressionContainerId = "CalculatorExpression";
private const string NumberPadId = "NumberPad";
private const string StandardOperatorsId = "StandardOperators";
private const string DisplayControlsId = "DisplayControls";
private const string EqualButtonId = "equalButton";
private const string ClearButtonId = "clearButton";
/// <summary>
/// Initializes a new instance of the <see cref="StandardCalculatorPom" /> class.
/// </summary>
/// <param name="uiObject">The UIObject that is the root of the standard calculator.</param>
public StandardCalculatorPom(UIObject uiObject) : base(uiObject)
{
}
public NumberPadPom NumPad => new NumberPadPom(this.Descendants.Find(NumberPadId));
public MemoryPom MemoryControls => new MemoryPom(this);
public HistoryPom HistoryControls => new HistoryPom(this);
public UIObject StandardOperatorsGroup => this.Descendants.Find(StandardOperatorsId);
public UIObject DisplayControlsGroup => this.Descendants.Find(DisplayControlsId);
public Button EqualButton => new Button(this.StandardOperatorsGroup.Children.Find(EqualButtonId));
public Button ClearButton => new Button(this.DisplayControlsGroup.Children.Find(ClearButtonId));
}
}

View file

@ -1,24 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Calculator.UIAutomationLibrary.Components
{
public class UnitConverterLfm
{
public UnitConverterLfm(UnitConverterPom unitConverterPom)
{
this.ObjectModel = unitConverterPom;
}
public UnitConverterPom ObjectModel { get; }
public void Eight()
{
using (var waiter = this.ObjectModel.GetDisplayChangedWaiter())
{
this.ObjectModel.NumberPad.EightButton.Invoke();
waiter.TryWait();
}
}
}
}

View file

@ -1,27 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Waiters;
namespace Calculator.UIAutomationLibrary.Components
{
public class UnitConverterPom : UIObject
{
private const string DisplayId = "Value1";
private const string NumberPadId = "numberPad";
public UnitConverterPom(UIObject uiObject) : base(uiObject)
{
}
public NumberPadPom NumberPad => new NumberPadPom(this.Descendants.Find(NumberPadId));
public TextBlock Display => new TextBlock(this.Descendants.Find(DisplayId));
public PropertyChangedEventWaiter GetDisplayChangedWaiter() => this.Display.GetNameChangedWaiter();
public ElementAddedWaiter GetDisplayElementAddedWaiter() => new ElementAddedWaiter(this, Scope.Descendants, DisplayId);
}
}

View file

@ -1,48 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Etw.Managed;
using MS.Internal.Mita.Foundation;
namespace Calculator.UIAutomationLibrary.Components
{
public class HistoryLfm : ICanFocusWithClicks
{
public HistoryLfm(HistoryPom historyPom)
{
this.ObjectModel = historyPom;
}
public HistoryPom ObjectModel { get; }
public void FocusWithClicks()
{
// On the Programming calc, the default click location can land on the first memory item, dismissing the flyout.
// Instead, click just below, in the gutter to the left of the trash can.
var body = this.ObjectModel.Body;
int height = body.BoundingRectangle.Height;
body.DoubleClick(PointerButtons.Primary, Constants.ClickMargin, height + Constants.ClickMargin);
}
public void OpenBody()
{
using (EtwWaiter waiter = new EtwWaiter(Constants.CalculatorETWProviderGUID, Constants.HistoryBodyOpenedETWEventName))
{
// Only one exists at a given time.
if (this.ObjectModel.IsHistoryButtonVisible)
{
if (!this.ObjectModel.IsBodyOpen)
{
this.ObjectModel.HistoryButton.Invoke();
waiter.Wait();
}
}
else if (!this.ObjectModel.HistoryPivot.IsSelected)
{
this.ObjectModel.HistoryPivot.Click();
waiter.Wait();
}
}
}
}
}

View file

@ -1,29 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
public class HistoryPom : UIObject
{
private const string HistoryButtonId = "HistoryButton";
private const string HistoryPivotId = "HistoryLabel";
private const string BodyId = "HistoryListView";
public HistoryPom(UIObject uiObject) : base(uiObject)
{
}
public Button HistoryButton => new Button(this.Descendants.Find(HistoryButtonId));
public bool IsHistoryButtonVisible => this.DoesDescendantExist(HistoryButtonId);
public TabItem HistoryPivot => new TabItem(this.Descendants.Find(HistoryPivotId));
public UIObject Body => this.Descendants.Find(BodyId);
public bool IsBodyOpen => this.DoesDescendantExist(BodyId);
}
}

View file

@ -1,15 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Calculator.UIAutomationLibrary.Components
{
public interface ICanFocusWithClicks
{
/// <summary>
/// Sets focus on an object by clicking on it, without causing further action.
/// Supports AccSpot scans by raising click events.
/// </summary>
void FocusWithClicks();
}
}

View file

@ -1,51 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using Etw.Managed;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Waiters;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary.Components
{
public class MemoryLfm : ICanFocusWithClicks
{
public MemoryLfm(MemoryPom memoryPom)
{
this.ObjectModel = memoryPom;
}
public MemoryPom ObjectModel { get; }
public void FocusWithClicks()
{
// On the Programming calc, the default click location can land on the first memory item, dismissing the flyout.
// Instead, click just below, in the gutter to the left of the trash can.
var body = this.ObjectModel.Body;
int height = body.BoundingRectangle.Height;
body.DoubleClick(PointerButtons.Primary, Constants.ClickMargin, height + Constants.ClickMargin);
}
public void OpenBody()
{
using (EtwWaiter waiter = new EtwWaiter(Constants.CalculatorETWProviderGUID, Constants.MemoryBodyOpenedETWEventName))
{
// Only one exists at a given time
if (this.ObjectModel.IsMemoryButtonVisible)
{
if (!this.ObjectModel.IsBodyOpen)
{
this.ObjectModel.MemoryButton.Invoke();
waiter.Wait();
}
}
else if (!this.ObjectModel.MemoryPivot.IsSelected)
{
this.ObjectModel.MemoryPivot.Click();
waiter.Wait();
}
}
}
}
}

View file

@ -1,44 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
public class MemoryPom : UIObject
{
private const string ClearMemoryButtonId = "ClearMemoryButton";
private const string RecallButtonId = "MemRecall";
private const string PlusButtonId = "MemPlus";
private const string MinusButtonId = "MemMinus";
private const string SetButtonId = "memButton";
private const string MemoryButtonId = "MemoryButton";
private const string MemoryPivotId = "MemoryLabel";
private const string BodyId = "MemoryListView";
public MemoryPom(UIObject uiObject) : base(uiObject)
{
}
public Button ClearButton => new Button(this.Descendants.Find(ClearMemoryButtonId));
public Button RecallButton => new Button(this.Descendants.Find(RecallButtonId));
public Button PlusButton => new Button(this.Descendants.Find(PlusButtonId));
public Button MinusButton => new Button(this.Descendants.Find(MinusButtonId));
public Button SetButton => new Button(this.Descendants.Find(SetButtonId));
public Button MemoryButton => new Button(this.Descendants.Find(MemoryButtonId));
public bool IsMemoryButtonVisible => this.DoesDescendantExist(MemoryButtonId);
public TabItem MemoryPivot => new TabItem(this.Descendants.Find(MemoryPivotId));
public UIObject Body => this.Descendants.Find(BodyId);
public bool IsBodyOpen => this.DoesDescendantExist(BodyId);
}
}

View file

@ -1,49 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
namespace Calculator.UIAutomationLibrary.Components
{
public class NumberPadPom : UIObject
{
private const string OneButtonId = "num1Button";
private const string TwoButtonId = "num2Button";
private const string ThreeButtonId = "num3Button";
private const string FourButtonId = "num4Button";
private const string FiveButtonId = "num5Button";
private const string SixButtonId = "num6Button";
private const string SevenButtonId = "num7Button";
private const string EightButtonId = "num8Button";
private const string NineButtonId = "num9Button";
private const string ZeroButtonId = "num0Button";
private const string DecimalButtonId = "decimalSeparatorButton";
public NumberPadPom(UIObject uiObject) : base(uiObject)
{
}
public Button ZeroButton => new Button(this.Children.Find(ZeroButtonId));
public Button OneButton => new Button(this.Children.Find(OneButtonId));
public Button TwoButton => new Button(this.Children.Find(TwoButtonId));
public Button ThreeButton => new Button(this.Children.Find(ThreeButtonId));
public Button FourButton => new Button(this.Children.Find(FourButtonId));
public Button FiveButton => new Button(this.Children.Find(FiveButtonId));
public Button SixButton => new Button(this.Children.Find(SixButtonId));
public Button SevenButton => new Button(this.Children.Find(SevenButtonId));
public Button EightButton => new Button(this.Children.Find(EightButtonId));
public Button NineButton => new Button(this.Children.Find(NineButtonId));
public Button DecimalButton => new Button(this.Children.Find(DecimalButtonId));
}
}

View file

@ -1,20 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Calculator.UIAutomationLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("D6913DAD-1C3B-4229-915F-8301A57970FC")]

View file

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Etw.Managed;
using Calculator.UIAutomationLibrary.Components;
using WEX.TestExecution;
namespace Calculator.UIAutomationLibrary.Tests
{
public static class BasicCalculationTest
{
/// <summary>
/// This test uses LFMs to add and then delete an alarm.
/// </summary>
/// <param name="calculatorAppLfm">The LFM for the alarms app window.</param>
public static void CalculateOnePlusTwo(this CalculatorAppLfm calculatorAppLfm)
{
var mainPage = calculatorAppLfm.MainPageLfm;
var standardCalculator = mainPage.NavigateToStandardCalculator();
standardCalculator.OnePlusTwoEnter();
Verify.AreEqual("\u202D3\u202C", standardCalculator.ObjectModel.Display.Name, "Ensure display value is 3");
standardCalculator.Clear();
Verify.AreEqual("\u202D0\u202C", standardCalculator.ObjectModel.Display.Name, "Ensure display value is 0");
}
}
}

View file

@ -1,38 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Calculator.UIAutomationLibrary.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WEX.TestExecution;
namespace Calculator.UIAutomationLibrary.Tests
{
public static class ScientificCalculationTest
{
/// <summary>
/// This test uses LFMs to calculate the sqrt(4) - 2.
/// </summary>
/// <param name="calculatorAppLfm">The LFM for the calculator app window.</param>
public static void CalculateSqrt4Minus2(this CalculatorAppLfm calculatorAppLfm)
{
var mainPage = calculatorAppLfm.MainPageLfm;
var scientificCalculator = mainPage.NavigateToScientificCalculator();
scientificCalculator.Press4();
scientificCalculator.PressSqrt();
scientificCalculator.PressMinus();
scientificCalculator.Press3();
scientificCalculator.PressPlus();
scientificCalculator.Press1();
scientificCalculator.PressEquals();
Verify.AreEqual("\u202D0\u202C", scientificCalculator.ObjectModel.Display.Name);
}
}
}

View file

@ -1,100 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
namespace Calculator.UIAutomationLibrary
{
public class Constants
{
/// <summary>
/// The path to the certificate file.
/// </summary>
public const string CertificateFileName = @"Calculator.cer";
/// <summary>
/// The path to the appxbundle file.
/// </summary>
public const string PackageFileName = @"Calculator.appxbundle";
/// <summary>
/// The path to the appxbundle file.
/// </summary>
public const string VCLibsPackageFileName = @"Microsoft.VCLibs.appx";
/// <summary>
/// The path to the appxbundle file.
/// </summary>
public const string WinUIPackageFileName = @"Microsoft.UI.Xaml.appx";
/// <summary>
/// Name of the CoreWindow.
/// </summary>
public const string AppWindowName = "Calculator";
/// <summary>
/// Name of the process executable.
/// </summary>
public const string ProcessName = "Calculator.exe";
/// <summary>
/// The package name.
/// </summary>
public const string PackageName = "Microsoft.WindowsCalculator";
/// <summary>
/// The package family name for the app to test.
/// </summary>
public const string PackageFamilyName = PackageName + "_8wekyb3d8bbwe";
/// <summary>
/// The package App User Model Id.
/// </summary>
public const string PackageAppUserModelId = PackageFamilyName + "!App";
/// <summary>
/// AutomationId for the top level UI element.
/// </summary>
public const string TopLevelWindowAutomationId = "CalculatorWindow";
/// <summary>
/// Event fired when the first page is loaded.
/// </summary>
public const string AppLaunchEndETWEventName = "AppLaunchEnd";
/// <summary>
/// App Provider GUID for ETW Events
/// </summary>
public static readonly Guid CalculatorETWProviderGUID = new Guid("0905CA09-610E-401E-B650-2F212980B9E0");
/// <summary>
/// Event fired when a calculator mode change is complete.
/// </summary>
public const string AppModeChangeEndETWEventName = "ModeChangeEnd";
/// <summary>
/// Event fired when the History panel is opened by flyout or by changing pivot tabs.
/// </summary>
public const string HistoryBodyOpenedETWEventName = "HistoryBodyOpened";
/// <summary>
/// Event fired when the Memory panel is opened by flyout or by changing pivot tabs.
/// </summary>
public const string MemoryBodyOpenedETWEventName = "MemoryBodyOpened";
/// <summary>
/// Event fired when the About flyout control is loaded.
/// </summary>
public const string AboutFlyoutOpenedETWEventName = "AboutFlyoutOpened";
/// <summary>
/// Event fired when the Nav Bar control is opened.
/// </summary>
public const string NavBarOpenedETWEventName = "NavBarOpened";
/// <summary>
/// Margin used to click in the gutter beneath the History and Memory lists
/// </summary>
public const int ClickMargin = 10;
}
}

View file

@ -1,101 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.OneCoreUap.Test.AppModel;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary
{
public class EtwHelper
{
private static bool etwServiceWasInstalled = false;
/// <summary>
/// Installs and starts the Etw.Service so that Tests may utilize Etw Waiters.
/// Wex.Services.exe is part of TAEF.
/// </summary>
public static void InstallAndStartETWService()
{
etwServiceWasInstalled = ServiceHelper.IsInstalled("Etw.Service");
if (!etwServiceWasInstalled)
{
string wexServices = Path.Combine(TAEFHelper.GetTestDeploymentDirectory(), "Wex.Services.exe");
if (!File.Exists(wexServices))
{
throw new FileNotFoundException(wexServices);
}
Log.Comment("Attempting to install Etw.Service...");
var startInfo = new ProcessStartInfo();
startInfo.FileName = wexServices;
startInfo.Arguments = "/install:Etw.Service";
var process = new Process();
process.StartInfo = startInfo;
if (process.Start())
{
process.WaitForExit();
Log.Comment("Completed installation of Etw.Service");
}
else
{
throw new Exception("ETW service was not able to be installed. Process didn't start.");
}
}
Log.Comment("Attempting to start Etw.Service...");
ServiceHelper.Start("Etw.Service");
Log.Comment("Etw.Service started");
}
/// <summary>
/// Stops the Etw.Service.
/// </summary>
public static void StopAndRemoveETWService()
{
if (ServiceHelper.IsInstalled("Etw.Service"))
{
Log.Comment("Attempting to stop Etw.Service...");
ServiceHelper.Stop("Etw.Service");
Log.Comment("Etw.Service stopped");
// if we installed the Etw.Service as part of this test we should also remove it.
// This prevents cases where TDP is upgraded but the service tregistration is referencing the old
// location that no longer exists.
if (!etwServiceWasInstalled)
{
string wexServices = Path.Combine(TAEFHelper.GetTestDeploymentDirectory(), "Wex.Services.exe");
if (!File.Exists(wexServices))
{
throw new FileNotFoundException(wexServices);
}
Log.Comment("Attempting to remove Etw.Service...");
var startInfo = new ProcessStartInfo();
startInfo.FileName = wexServices;
startInfo.Arguments = "/remove:Etw.Service";
var process = new Process();
process.StartInfo = startInfo;
if (process.Start())
{
process.WaitForExit();
Log.Comment("Completed removal of Etw.Service");
}
else
{
throw new Exception("ETW service could not be removed. Process didn't start.");
}
}
}
}
}
}

View file

@ -1,100 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Calculator.UIAutomationLibrary
{
public static class Impersonater
{
public static void RunAs(RunAsUser user, Action action)
{
IntPtr errorInfo;
SafeAccessTokenHandle restrictedToken;
GetRunAsUserToken getRunAsUserToken = ResolveGetRunAsUserTokenMethod();
Marshal.ThrowExceptionForHR(getRunAsUserToken(user, out restrictedToken, out errorInfo), errorInfo);
WindowsIdentity.RunImpersonated(restrictedToken, action);
}
public static void RunAs<T>(RunAsUser user, Func<T> function)
{
IntPtr errorInfo;
SafeAccessTokenHandle restrictedToken;
GetRunAsUserToken getRunAsUserToken = ResolveGetRunAsUserTokenMethod();
Marshal.ThrowExceptionForHR(getRunAsUserToken(user, out restrictedToken, out errorInfo), errorInfo);
WindowsIdentity.RunImpersonated(restrictedToken, function);
}
// From: https://microsoft.visualstudio.com/EngSys/_git/validation.taef?path=%2Fsrc%2FTAEF%2FCommon%2FPublished%2FRunAsFromSystem.h&version=GBdevelop
public enum RunAsUser
{
ElevatedUser,
User,
RestrictedUser,
LowIL,
InteractiveUser,
};
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int GetRunAsUserToken(RunAsUser user, out SafeAccessTokenHandle token, out IntPtr errorInfo);
// GetRunAsUserToken is defined in a namespace so we have to do some tricks to use P/Invoke.
// We got the actual exported method name by running dumpbin /exports TE.Common.dll
private static GetRunAsUserToken ResolveGetRunAsUserTokenMethod()
{
IntPtr teCommonDll = IntPtr.Zero;
try
{
teCommonDll = LoadLibrary(@"TE.Common.dll");
IntPtr x64GetRunAsUserToken = GetProcAddress(teCommonDll, "?GetRunAsUserToken@TestExecution@WEX@@YAJW4RunAsUser@12@PEAPEAXPEAPEAUIErrorInfo@@@Z");
if (x64GetRunAsUserToken != IntPtr.Zero)
{
return Marshal.GetDelegateForFunctionPointer<GetRunAsUserToken>(x64GetRunAsUserToken);
}
IntPtr x86GetRunAsUserToken = GetProcAddress(teCommonDll, "?GetRunAsUserToken@TestExecution@WEX@@YGJW4RunAsUser@12@PAPAXPAPAUIErrorInfo@@@Z");
if (x86GetRunAsUserToken != IntPtr.Zero)
{
return Marshal.GetDelegateForFunctionPointer<GetRunAsUserToken>(x86GetRunAsUserToken);
}
IntPtr armGetRunAsUserToken = GetProcAddress(teCommonDll, "?GetRunAsUserToken@TestExecution@WEX@@YAJW4RunAsUser@12@PAPAXPAPAUIErrorInfo@@@Z");
if (armGetRunAsUserToken != IntPtr.Zero)
{
return Marshal.GetDelegateForFunctionPointer<GetRunAsUserToken>(armGetRunAsUserToken);
}
IntPtr arm64GetRunAsUserToken = GetProcAddress(teCommonDll, "?GetRunAsUserToken@TestExecution@WEX@@YAJW4RunAsUser@12@PEAPEAXPEAPEAUIErrorInfo@@@Z");
if (arm64GetRunAsUserToken != IntPtr.Zero)
{
return Marshal.GetDelegateForFunctionPointer<GetRunAsUserToken>(arm64GetRunAsUserToken);
}
throw new Exception("Unable to find the GetRunAsUserToken function in DLL 'TE.Common.dll'");
}
finally
{
if (teCommonDll != IntPtr.Zero)
{
FreeLibrary(teCommonDll);
}
}
}
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll")]
public static extern bool FreeLibrary(IntPtr hModule);
}
}

View file

@ -1,84 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using Microsoft.OneCoreUap.Test.AppModel;
using WEX.Logging.Interop;
using Windows.Foundation;
using Windows.Management.Deployment;
namespace Calculator.UIAutomationLibrary
{
public class InstallHelper
{
public static void InstallCertFile(string certFilePath)
{
// Ensure cert exists.
if (!File.Exists(certFilePath))
{
throw new FileNotFoundException(certFilePath);
}
// For some reason, attempting to use CertificateHelper.InstallFromSignedPackage() to install
// the certificate associated with the appx package fails with the error:
// "A certificate chain could not be built to a trusted root authority."
// The reason is that the cert needs to be installed in 'StoreName.TrustedPeople',
// but DeploymentHelper.AddPackage() attempts to install it in 'StoreName.Root'.
// Therefore, the cert has been installed manually beforehand.
Log.Comment($"Starting install of certificate at {certFilePath}");
X509Certificate2 certificate = new X509Certificate2(certFilePath);
X509Store trustedPeopleStore = new X509Store(StoreName.TrustedPeople, StoreLocation.LocalMachine);
trustedPeopleStore.Open(OpenFlags.MaxAllowed);
trustedPeopleStore.Add(certificate);
Log.Comment($"Completed install of certificate");
}
/// <summary>
/// Upgrades the appx/appxbundle from the path if needed.
/// </summary>
public static void InstallPackage(string appxFilePath, params string[] dependencyAppxFilePaths)
{
// Ensure the files exist.
if (!File.Exists(appxFilePath))
{
throw new FileNotFoundException(appxFilePath);
}
foreach (var path in dependencyAppxFilePaths.Where(p => !File.Exists(p)))
{
throw new FileNotFoundException(path);
}
Log.Comment($"Starting install of app package at {appxFilePath}");
PackageManager packageManager = new PackageManager();
var deploymentOperation = packageManager.AddPackageAsync(
new Uri(appxFilePath),
dependencyAppxFilePaths.Select(d => new Uri(d)),
DeploymentOptions.ForceApplicationShutdown | DeploymentOptions.ForceTargetApplicationShutdown | DeploymentOptions.ForceUpdateFromAnyVersion);
WaitForDeploymentOperation(deploymentOperation);
Log.Comment("Completed install of app package");
}
/// <summary>
/// Waits for a deployment operation to complete
/// </summary>
private static void WaitForDeploymentOperation(IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> operation)
{
ManualResetEvent isCompletedEvent = new ManualResetEvent(false);
operation.Completed = (IAsyncOperationWithProgress<DeploymentResult, DeploymentProgress> asyncInfo, AsyncStatus asyncStatus) =>
{
isCompletedEvent.Set();
};
isCompletedEvent.WaitOne();
}
}
}

View file

@ -1,139 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Calculator.UIAutomationLibrary
{
internal static class NativeMethods
{
internal const int GW_OWNER = 4;
internal delegate bool EnumThreadWindowsCallback(IntPtr hWnd, IntPtr lParam);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern bool EnumWindows(EnumThreadWindowsCallback callback, IntPtr extraData);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern int GetWindowThreadProcessId(IntPtr handle, out int processId);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern int GetWindowTextLength(IntPtr hWnd);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
[DllImport("api-ms-win-ntuser-ie-window-l1-1-0.dll", SetLastError = true)]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("api-ms-win-service-management-l1-1-0.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool StartService(IntPtr hService, int dwNumServiceArgs, string[] lpServiceArgVectors);
[DllImport("api-ms-win-service-management-l1-1-0.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool ControlService(IntPtr hService, SERVICE_CONTROL dwControl, ref SERVICE_STATUS lpServiceStatus);
[DllImport("api-ms-win-service-management-l1-1-0.dll")]
internal static extern IntPtr OpenSCManager(string machineName, string databaseName, uint dwAccess);
[DllImport("api-ms-win-service-management-l1-1-0.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CloseServiceHandle(IntPtr hSCObject);
[DllImport("api-ms-win-service-management-l1-1-0.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr OpenService(IntPtr hSCManager, string lpServiceName, uint dwDesiredAccess);
[DllImport("api-ms-win-service-management-l1-1-0.dll", SetLastError = true)]
internal static extern bool QueryServiceStatus(IntPtr hService, ref SERVICE_STATUS dwServiceStatus);
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct SERVICE_STATUS
{
public int dwServiceType;
public int dwCurrentState;
public int dwControlsAccepted;
public int dwWin32ExitCode;
public int dwServiceSpecificExitCode;
public int dwCheckPoint;
public int dwWaitHint;
}
internal static uint STANDARD_RIGHTS_REQUIRED = 0xF0000;
internal static uint SC_MANAGER_CONNECT = 0x0001;
internal static uint SC_MANAGER_CREATE_SERVICE = 0x0002;
internal static uint SC_MANAGER_ENUMERATE_SERVICE = 0x0004;
internal static uint SC_MANAGER_LOCK = 0x0008;
internal static uint SC_MANAGER_QUERY_LOCK_STATUS = 0x0010;
internal static uint SC_MANAGER_MODIFY_BOOT_CONFIG = 0x0020;
internal static uint SC_MANAGER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED |
SC_MANAGER_CONNECT |
SC_MANAGER_CREATE_SERVICE |
SC_MANAGER_ENUMERATE_SERVICE |
SC_MANAGER_LOCK |
SC_MANAGER_QUERY_LOCK_STATUS |
SC_MANAGER_MODIFY_BOOT_CONFIG);
internal static uint SERVICE_QUERY_CONFIG = 0x0001;
internal static uint SERVICE_CHANGE_CONFIG = 0x0002;
internal static uint SERVICE_QUERY_STATUS = 0x0004;
internal static uint SERVICE_ENUMERATE_DEPENDENTS = 0x0008;
internal static uint SERVICE_START = 0x0010;
internal static uint SERVICE_STOP = 0x0020;
internal static uint SERVICE_PAUSE_CONTINUE = 0x0040;
internal static uint SERVICE_INTERROGATE = 0x0080;
internal static uint SERVICE_USER_DEFINED_CONTROL = 0x0100;
internal static uint SERVICE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED |
SERVICE_QUERY_CONFIG |
SERVICE_CHANGE_CONFIG |
SERVICE_QUERY_STATUS |
SERVICE_ENUMERATE_DEPENDENTS |
SERVICE_START |
SERVICE_STOP |
SERVICE_PAUSE_CONTINUE |
SERVICE_INTERROGATE |
SERVICE_USER_DEFINED_CONTROL);
[Flags]
internal enum SERVICE_CONTROL : uint
{
STOP = 0x00000001,
PAUSE = 0x00000002,
CONTINUE = 0x00000003,
INTERROGATE = 0x00000004,
SHUTDOWN = 0x00000005,
PARAMCHANGE = 0x00000006,
NETBINDADD = 0x00000007,
NETBINDREMOVE = 0x00000008,
NETBINDENABLE = 0x00000009,
NETBINDDISABLE = 0x0000000A,
DEVICEEVENT = 0x0000000B,
HARDWAREPROFILECHANGE = 0x0000000C,
POWEREVENT = 0x0000000D,
SESSIONCHANGE = 0x0000000E
}
internal enum SERVICE_STATE : int
{
SERVICE_STOPPED = 0x00000001,
SERVICE_START_PENDING = 0x00000002,
SERVICE_STOP_PENDING = 0x00000003,
SERVICE_RUNNING = 0x00000004,
SERVICE_CONTINUE_PENDING = 0x00000005,
SERVICE_PAUSE_PENDING = 0x00000006,
SERVICE_PAUSED = 0x00000007
}
}
}

View file

@ -1,41 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
namespace Calculator.UIAutomationLibrary
{
public class PerfConstants
{
/// <summary>
/// Path where the regions, wprprofiles and wpaprofiles will be deployed to by the spkg.
/// </summary>
public const string ConfigDirectory = @"Config\";
/// <summary>
/// Our FunGates source, where we can view test results.
/// </summary>
public const string FunGatesSource =
#if DEBUG
"TestSite";
#else
"Utility Apps Performance Tests";
#endif
/// <summary>
/// The Windows Performance Recorder profile. These strings must have the config directory prefix.
/// For use with the WPRProfileFile test attribute.
/// </summary>
public const string AppLifecycleWPRProfile = ConfigDirectory + "AppLifecycle.Profile.wprp";
/// <summary>
/// The regions of interest file that contains the events we are interested in measuring.
/// </summary>
public const string AppLifecycleRegions = ConfigDirectory + "AppLifecycle.regions.xml";
/// <summary>
/// These are uses with the DataSource test property to specify iteration info.
/// </summary>
public const string AppLifecycleIterationsSource = "Table:" + ConfigDirectory + "AppLifecycle.Iterations.xml#PerformanceConfigurations";
}
}

View file

@ -1,156 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Calculator.UIAutomationLibrary
{
public class ServiceHelper
{
public static void Start(string serviceName, int timeoutInMilliSeconds = 30000)
{
IntPtr hService = IntPtr.Zero;
IntPtr hSCManager = IntPtr.Zero;
try
{
hSCManager = NativeMethods.OpenSCManager(null, null, NativeMethods.SC_MANAGER_ALL_ACCESS);
if (IntPtr.Zero == hSCManager)
{
throw new Exception($"Start: Cannot Open OpenSCManager, {Marshal.GetLastWin32Error()}");
}
hService = NativeMethods.OpenService(hSCManager, serviceName, NativeMethods.SERVICE_ALL_ACCESS);
if (IntPtr.Zero == hService)
{
throw new Exception($"Start: Cannot Open Service, {Marshal.GetLastWin32Error()}");
}
NativeMethods.SERVICE_STATUS serviceStatus = new NativeMethods.SERVICE_STATUS();
if (!NativeMethods.QueryServiceStatus(hService, ref serviceStatus))
{
throw new Exception($"Start: Unable to query status of Service, {Marshal.GetLastWin32Error()}");
}
if (serviceStatus.dwCurrentState != (int)NativeMethods.SERVICE_STATE.SERVICE_RUNNING &&
serviceStatus.dwCurrentState != (int)NativeMethods.SERVICE_STATE.SERVICE_START_PENDING)
{
if (!NativeMethods.StartService(hService, 0, null))
{
throw new Exception($"Start: Service cannot be started, {Marshal.GetLastWin32Error()}");
}
}
WaitForStatus(hService, NativeMethods.SERVICE_STATE.SERVICE_RUNNING, TimeSpan.FromMilliseconds(timeoutInMilliSeconds));
}
finally
{
if (IntPtr.Zero != hService)
{
NativeMethods.CloseServiceHandle(hService);
}
if (IntPtr.Zero != hSCManager)
{
NativeMethods.CloseServiceHandle(hSCManager);
}
}
}
public static void Stop(string serviceName, int timeoutInMilliSeconds = 30000)
{
IntPtr hSCManager = IntPtr.Zero;
IntPtr hService = IntPtr.Zero;
try
{
hSCManager = NativeMethods.OpenSCManager(null, null, NativeMethods.SC_MANAGER_ALL_ACCESS);
if (IntPtr.Zero == hSCManager)
{
throw new Exception($"Stop: Cannot Open OpenSCManager, {Marshal.GetLastWin32Error()}");
}
hService = NativeMethods.OpenService(hSCManager, serviceName, NativeMethods.SERVICE_ALL_ACCESS);
if (IntPtr.Zero == hService)
{
throw new Exception($"Stop: Cannot Open Service, {Marshal.GetLastWin32Error()}");
}
NativeMethods.SERVICE_STATUS serviceStatus = new NativeMethods.SERVICE_STATUS();
if (!NativeMethods.QueryServiceStatus(hService, ref serviceStatus))
{
throw new Exception($"Stop: Unable to query status of Service, {Marshal.GetLastWin32Error()}");
}
if (serviceStatus.dwCurrentState != (int)NativeMethods.SERVICE_STATE.SERVICE_STOPPED &&
serviceStatus.dwCurrentState != (int)NativeMethods.SERVICE_STATE.SERVICE_STOP_PENDING)
{
if (!NativeMethods.ControlService(hService, NativeMethods.SERVICE_CONTROL.STOP, ref serviceStatus))
{
throw new Exception($"Stop: Service cannot be stopped, {Marshal.GetLastWin32Error()}");
}
}
WaitForStatus(hService, NativeMethods.SERVICE_STATE.SERVICE_STOPPED, TimeSpan.FromMilliseconds(timeoutInMilliSeconds));
}
finally
{
if (IntPtr.Zero != hService)
{
NativeMethods.CloseServiceHandle(hService);
}
if (IntPtr.Zero != hSCManager)
{
NativeMethods.CloseServiceHandle(hSCManager);
}
}
}
public static bool IsInstalled(string svcName)
{
IntPtr sc_handle = NativeMethods.OpenSCManager(null, null, NativeMethods.SC_MANAGER_ALL_ACCESS);
if (sc_handle == IntPtr.Zero)
{
throw new Exception($"IsInstalled: Cannot open service manager, {Marshal.GetLastWin32Error()}");
}
bool bResult = false;
IntPtr sv_handle = NativeMethods.OpenService(sc_handle, svcName, NativeMethods.SERVICE_QUERY_CONFIG);
if (sv_handle.ToInt64() != 0)
{
bResult = true;
NativeMethods.CloseServiceHandle(sv_handle);
}
NativeMethods.CloseServiceHandle(sc_handle);
return bResult;
}
private static void WaitForStatus(IntPtr hService, NativeMethods.SERVICE_STATE desiredStatus, TimeSpan timeout)
{
Stopwatch swLoop = new Stopwatch();
swLoop.Start();
NativeMethods.SERVICE_STATUS serviceStatus = new NativeMethods.SERVICE_STATUS();
do
{
Thread.Sleep(500);
if (!NativeMethods.QueryServiceStatus(hService, ref serviceStatus))
{
throw new Exception($"WaitForStatus: Unable to query status of service, {Marshal.GetLastWin32Error()}");
}
}
while (serviceStatus.dwCurrentState != (int)desiredStatus && (swLoop.ElapsedMilliseconds <= timeout.TotalMilliseconds));
if (serviceStatus.dwCurrentState != (int)desiredStatus)
{
throw new Exception($"WaitForStatus: Service failed to reach desired state: {desiredStatus}, current state: {serviceStatus.dwCurrentState}");
}
}
}
}

View file

@ -1,66 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Linq;
using System.Windows.Automation;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using MS.Internal.Mita.Foundation.Waiters;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary
{
public static class UIObjectExtensions
{
private const string NamePropertyName = "Name";
private static UICondition CoreWindowCondition = UICondition.CreateFromClassName("Windows.UI.Core.CoreWindow");
public static Window GetParentCoreWindow(this UIObject uiObject)
{
if (uiObject.Matches(CoreWindowCondition))
{
return new Window(uiObject);
}
return new Window(uiObject.Ancestors.Find(CoreWindowCondition));
}
public static Window GetTopLevelWindow(this Window window)
{
var node = window;
while (node != null && node.Parent != null && node.Parent.ControlType == ControlType.Window)
{
node = new Window(node.Parent);
}
return node;
}
public static void VerifyParentTreeStructure(this UIObject uiObject)
{
var node = uiObject;
while (node != null && node.Parent != null)
{
if (!node.Parent.Children.Contains(node))
{
Log.Comment($"- [VerifyingTree] {node} specifies {node.Parent} as parent but is not part of its children.");
}
if (!node.Parent.Descendants.Contains(node))
{
Log.Comment($"- [VerifyingTree] {node} specifies {node.Parent} as parent but is not part of its descendants.");
}
node = node.Parent;
}
}
public static bool DoesDescendantExist(this UIObject uiObject, string automationId)
{
UIObject temp;
return uiObject.Descendants.TryFind(automationId, out temp);
}
public static PropertyChangedEventWaiter GetNameChangedWaiter(this TextBlock textBlock)
{
return new PropertyChangedEventWaiter(textBlock, UIProperty.Get(NamePropertyName));
}
}
}

View file

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Diagnostics;
using System.IO;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary
{
public class Utilities
{
public static void KillExistingCalculatorProcesses()
{
Log.Comment("Killing any existing Calculator processes");
foreach (var process in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Constants.ProcessName)))
{
try
{
process.Kill();
Log.Comment($"Killed {process.ProcessName}, Id: {process.Id}");
}
catch (Exception) when (process.HasExited)
{
Log.Comment($"{process.ProcessName}, Id: {process.Id} already exited.");
}
}
}
}
}

View file

@ -1,18 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using MS.Internal.Mita.Foundation.Controls;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary
{
public class WindowHelper
{
public static void SetAsForeground(Window window)
{
Log.Comment($"Set window {window.NativeWindowHandle} as the foreground window.");
NativeMethods.SetForegroundWindow(window.NativeWindowHandle);
}
}
}

View file

@ -1,12 +0,0 @@
{
"dependencies": {
"AppModel.TestHelper": "2018.3.22",
"EtwProcessor.Managed": "10.34.181220007",
"MITALite": "1.0.180128001",
"Taef.Managed": "10.34.181220007",
"Test.Net.Redist": "2.0.1"
},
"frameworks": {
"netcore50": {}
}
}

View file

@ -1,145 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{0224A709-0C48-4C4F-BA17-843A49842C15}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Calculator.UITests</RootNamespace>
<AssemblyName>Calculator.UITests</AssemblyName>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<NuGetTargetMoniker>.NETCore,Version=v5.0</NuGetTargetMoniker>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<FileAlignment>512</FileAlignment>
<CopyNuGetImplementations>true</CopyNuGetImplementations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\x86</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\x86</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\x64</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\x64</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\arm</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\arm</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\ARM64\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\ARM64\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>ARM64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile Include="Initialization.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests\AppLifecycleTests.cs" />
<Compile Include="Tests\CalculatorTests.cs" />
<Compile Include="Tests\LaunchTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Config\AppLifecycle.Profile.wprp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Config\AppLifecycle.Regions.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AppLifecycle.Regions.xml</LastGenOutput>
<SubType>Designer</SubType>
</Content>
<Content Include="Config\AppLifecycle.Regions.xml">
<DependentUpon>AppLifecycle.Regions.tt</DependentUpon>
<AutoGen>True</AutoGen>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<DesignTime>True</DesignTime>
</Content>
<None Include="project.json" />
<None Include="testmd.definition" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Calculator.UIAutomationLibrary\Calculator.UIAutomationLibrary.csproj">
<Project>{a43517b5-8be3-4312-913f-004978c34444}</Project>
<Name>Calculator.UIAutomationLibrary</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Config\AppLifecycle.Iterations.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0' ">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,40 +0,0 @@
<?xml version="1.0"?>
<!--
This file defines a table of performance configuration for use with
TAEF Table Based Data-driven Testing.
This table specifies we will run the test three times (each iteration has a
unique name to identify the scenario) with different parameters each time.
We use the same region file for WinPerf but we specify different WPR profiles
to capture ETW events from different providers, focusing on responsiveness for
launch runs and on memory for one diagnostic memory run.
The warm run is the one we are primarily interested in for startup performance.
-->
<Data>
<Table Id="PerformanceConfigurations">
<Row Name="Cold"
WinPerf.FriendlyAutomationName="AppLifecycle_Responsiveness_Cold"
WinPerf.Iterations="1"
WinPerf.WPRProfile="Config\AppLifecycle.Profile.wprp"
WinPerf.WPRProfileId="AppLifecycle.Responsiveness.Diagnostic.Verbose.File"
WinPerf.Regions="Config\AppLifecycle.Regions.xml">
</Row>
<Row Name="Warm"
WinPerf.FriendlyAutomationName="AppLifecycle_Responsiveness_Warm"
WinPerf.Iterations="10"
WinPerf.WPRProfile="Config\AppLifecycle.Profile.wprp"
WinPerf.WPRProfileId="AppLifecycle.Responsiveness.Diagnostic.Verbose.Memory"
WinPerf.Regions="Config\AppLifecycle.Regions.xml">
</Row>
<Row Name="Memory"
WinPerf.FriendlyAutomationName="AppLifecycle_Memory"
WinPerf.Iterations="1"
WinPerf.WPRProfile="Config\AppLifecycle.Profile.wprp"
WinPerf.WPRProfileId="AppLifecycle.Memory.Diagnostic.Verbose.File"
WinPerf.Regions="Config\AppLifecycle.Regions.xml">
</Row>
</Table>
</Data>

View file

@ -1,526 +0,0 @@
<!--
This WPRP (WPR profile) contains the App Life Cycle settings for Mobile and Client Performance Gates (MPG and CPG).
Since the appcycle automations are currently still separate, any changes here should be made in two places to keep these wprp's in sync.
CPG: base\PerfTest\MemRe\AppLifecycle\Common\AppLifeCycle.wprp
MPG: wm\src\tools\Product\DH\Test\PerfWorkloads\AppLifeCycle\AppLifeCycle.wprp
Prefixes in the WPRP:
SC_ - System Collector controlling kernel event tracing
EC_ - Event Collector controlling user mode event tracing
SP_ - System Provider
EP_ - Event Provider
There are two separate traces - Responsiveness and Memory.
Within that, we have Light tracing which is for official gating metrics/traces, and we have Verbose tracing, which is for Diagnostic metrics\traces.
-->
<WindowsPerformanceRecorder Version="1.0" Comments="Test" Company="Microsoft Corporation" Copyright="Microsoft Corporation">
<Profiles>
<!-- BufferSizes are in KB in WPRP -->
<!-- System Collectors -->
<SystemCollector Id="SC_Responsiveness.LowCost.Light" Name="NT Kernel Resposiveness Logger LowCost Light">
<BufferSize Value="1024" />
<Buffers Value="3" PercentageOfTotalMemory="true" MaximumBufferSpace="30" />
</SystemCollector>
<SystemCollector Id="SC_Responsiveness.LowCost" Name="NT Kernel Resposiveness Logger LowCost">
<BufferSize Value="1024" />
<Buffers Value="35" />
</SystemCollector>
<SystemCollector Id="SC_Responsiveness.HighCost.Verbose" Name="NT Kernel Resposiveness Logger HighCost Verbose">
<BufferSize Value="1024" />
<Buffers Value="7" PercentageOfTotalMemory="true" MaximumBufferSpace="140" />
</SystemCollector>
<SystemCollector Id="SC_Memory.LowCost.Light" Name="NT Kernel Memory Logger LowCost Light">
<BufferSize Value="1024" />
<Buffers Value="35" />
</SystemCollector>
<SystemCollector Id="SC_Memory.HighCost.Verbose" Name="NT Kernel Memory Logger LowCost Light">
<BufferSize Value="1024" />
<Buffers Value="75" />
</SystemCollector>
<!-- Event Collectors -->
<EventCollector Id="EC_Responsiveness.LowCost.Light" Name="User Session Logger LowCost Light">
<BufferSize Value="1024" />
<Buffers Value="2" PercentageOfTotalMemory="true" MaximumBufferSpace="20"/>
</EventCollector>
<EventCollector Id="EC_Responsiveness.LowCost.Light.UTC" Name="User Session Logger LowCost Light UTC">
<BufferSize Value="1024"/>
<Buffers Value="5"/>
</EventCollector>
<EventCollector Id="EC_Responsiveness.LowCost" Name="User Session Logger LowCost">
<BufferSize Value="1024" />
<Buffers Value="15" />
</EventCollector>
<EventCollector Id="EC_Responsiveness.HighCost.Verbose" Name="User Session Logger HighCost Verbose">
<BufferSize Value="1024" />
<Buffers Value="3" PercentageOfTotalMemory="true" MaximumBufferSpace="60" />
</EventCollector>
<EventCollector Id="EC_Memory.LowCost.Light" Name="User Session Logger LowCost Light">
<BufferSize Value="1024" />
<Buffers Value="30" />
</EventCollector>
<!-- System Providers for collecting kernel events. -->
<SystemProvider Id="SP_Responsiveness.Light">
<Keywords Operation="Add">
<Keyword Value="CompactCSwitch"/>
<Keyword Value="CSwitch"/>
<Keyword Value="DiskIO"/>
<Keyword Value="ProcessThread"/>
<Keyword Value="Loader"/>
</Keywords>
</SystemProvider>
<SystemProvider Id="SP_Responsiveness" Base="SP_Responsiveness.Light">
<Keywords Operation="Add">
<Keyword Value="HardFaults"/>
<Keyword Value="MemoryInfo"/>
<Keyword Value="ReadyThread"/>
<Keyword Value="SampledProfile"/>
<Keyword Value="Session"/>
<Keyword Value="VAMap"/>
<Keyword Value="DPC"/>
<Keyword Value="Power"/>
</Keywords>
<Stacks Operation="Add">
<Stack Value="CSwitch"/>
<Stack Value="ReadyThread"/>
<Stack Value="SampledProfile"/>
</Stacks>
</SystemProvider>
<SystemProvider Id="SP_Memory.Light" Base="SP_Responsiveness.Light" >
<Keywords Operation="Add">
<Keyword Value="Memory"/>
<Keyword Value="MemoryInfo"/>
<Keyword Value="HardFaults"/>
<Keyword Value="ReferenceSet"/>
<Keyword Value="VirtualAllocation"/>
</Keywords>
</SystemProvider>
<SystemProvider Id="SP_Memory" Base="SP_Responsiveness" >
<Keywords Operation="Add">
<Keyword Value="FootPrint"/>
<Keyword Value="Memory"/>
<Keyword Value="MemoryInfoWS"/>
<Keyword Value="ReferenceSet"/>
<Keyword Value="VirtualAllocation"/>
</Keywords>
<Stacks Operation="Add">
<Stack Value="HeapCreate" />
<Stack Value="ImageLoad" />
<Stack Value="PageAccess" />
<Stack Value="PageAccessEx" />
<Stack Value="PagefileMappedSectionCreate" />
<Stack Value="PagefileMappedSectionDelete" />
<Stack Value="PageRangeAccess" />
<Stack Value="PageRangeRelease" />
<Stack Value="PageRelease" />
<Stack Value="PageRemovedfromWorkingSet" />
<Stack Value="VirtualAllocation" />
<Stack Value="VirtualFree" />
</Stacks>
</SystemProvider>
<!-- Start - AppLaunch.wprp -->
<EventProvider Id="EP_UTC" Name="UTC" NonPagedMemory="true" Level="4" />
<EventProvider Id="EP_Microsoft-WindowsPhone-AppPlatProvider" Name="3C42000F-CC27-48C3-A005-48F6E38B131F" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_XNA" Name="CD698436-A3E3-4607-BB60-0BAC4D765B59" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_TaskHost" Name="5CBDF2A5-7290-4ACC-B8A7-9BA285BEBC39" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsPhone-Silverlight" Name="AA087E0E-0B35-4e28-8F3A-440C3F51EEF1" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Device-Health-Etw" Name="F7A8FD9F-8FFD-482f-86C0-4C19240F334C" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsMobile-Compositor" Name="85FFFBA1-CF12-402c-B9B3-29A3217BB007" Level="5">
<Keywords>
<Keyword Value="0xfffffff" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsMobile-Splash" Name="872c8950-0def-4d5b-83f6-57dd027f88ce" Level="4">
<Keywords>
<Keyword Value="0xfffffff" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsMobile-UIXMobile" Name="0C0FFEE0-F4B1-4F4D-B591-FB3175B13413">
<Keywords>
<Keyword Value="0xE" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsMobile-StartMenu" Name="BECF83FD-D220-4b19-B7C1-C9127307F6B1" Level="5">
<Keywords>
<Keyword Value="0xfffffff" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-EventTracing" Name="b675ec37-bdb6-4648-bc92-f3fdc74d3ca2" Level="5">
<Keywords>
<Keyword Value="0x50" />
</Keywords>
<CaptureStateOnSave>
<Keyword Value="0x50" />
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsPhone-MobileUI" Name="F243DC34-205E-4d34-94CA-36E8C0859787" Level="5">
<Keywords>
<Keyword Value="0xfffffff" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-Process" Name="2839ff94-8f12-4e1b-82e3-af7af77a450f" NonPagedMemory="true" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-TestExecution" Name="Microsoft-Windows-TestExecution" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft.Windows.WinPerf" Name="BE6F04EA-3488-4543-8082-24843EAEC303" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Shell-Launcher" Name="*Microsoft-Windows-Shell-Launcher" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Immersive-Shell" Name="315A8872-923E-4EA2-9889-33CD4754BF64" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-XAML-Light" Name="531A35AB-63CE-4BCF-AA98-F88C7A89E455" Level="4" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-XAML-Verbose" Name="531A35AB-63CE-4BCF-AA98-F88C7A89E455" Level="5" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-ProcessLifetimeManager" Name="*Microsoft.Windows.ProcessLifetimeManager" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Desktop-ApplicationFrame" Name="678e492b-5de1-50c5-7219-ae4aa7d6a141" Level="5" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Microsoft-Phone-AppLifecycle" Name="f623a8ef-84da-4640-8917-fd5b0f847f28" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsPhone-CoreUIComponents" Name="a0b7550f-4e9a-4f03-ad41-b8042d06a2f7" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-AppModel-Exec" Name="EB65A492-86C0-406A-BACE-9912D595BD69" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft.Windows.ActivationManager" Name="cf7f94b3-08dc-5257-422f-497d7dc86ab3">
<Keywords>
<Keyword Value="0x0" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-WindowsMobile-ExecManLogPublisher" Name="82c8ad90-5f3c-11be-bd9a-85bb5f50dfa4" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Shell-CortanaSearch" Name="E34441D9-5BCF-4958-B787-3BF824F362D7" >
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Dwm-Core" Name="9e9bba3c-2e38-40cb-99f4-9e8281425164" Level="4" >
<Keywords>
<Keyword Value="0x2000C"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-ImageLoad" Name="2cb15d1d-5fc1-11d2-abe1-00a0c911f518" >
<Keywords>
<Keyword Value="0x10"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-AppLifeCycle-UI" Name="ee97cdc4-b095-5c70-6e37-a541eb74c2b5" Level="5">
<Keywords>
<Keyword Value="0x400000000000"/>
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-AppLifeCycle" Name="ef00584a-2655-462c-bc24-e7de630e7fbf">
<Keywords>
<Keyword Value="0x0000000000000"/>
</Keywords>
<CaptureStateOnSave>
<Keyword Value="0x0000000000000"/>
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-Power" Name="331C3B3A-2005-44C2-AC5E-77220C37D6B4" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0xA4"/>
</Keywords>
<CaptureStateOnSave Timeout="0">
<Keyword Value="0xA4"/>
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-Processor-Power" Name="0f67e49f-fe51-4e9f-b490-6f2948cc6027" NonPagedMemory="true" EventKey="true" Level="4">
<Keywords>
<Keyword Value="0xC2"/>
</Keywords>
<CaptureStateOnSave Timeout="0">
<Keyword Value="0xC2"/>
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-Pep" Name="5412704E-B2E1-4624-8FFD-55777B8F7373" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
<CaptureStateOnSave Timeout="0">
<Keyword Value="0x0"/>
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-Acpi" Name="C514638F-7723-485B-BCFC-96565D735D4A" Level="5" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
<CaptureStateOnSave>
<Keyword Value="0x0"/>
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-UserModePowerService" Name="CE8DEE0B-D539-4000-B0F8-77BED049C590" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x0"/>
</Keywords>
<CaptureStateOnSave Timeout="0">
<Keyword Value="0x0"/>
</CaptureStateOnSave>
</EventProvider>
<EventProvider Id="EP_Microsoft.ClipC" Level="0" Name="ed0c10a5-5396-4a96-9ee3-6f4aa0d1120d" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x200000000000" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft.ClipSp" Level="0" Name="b4b126de-32fe-4591-9ac5-b0778d79a0e7" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x200000000000" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft.ClipSvc" Level="0" Name="b94d76c5-9d56-454a-8d1b-6ca30898160e" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x200000000000" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft.Windows.LicenseManager.Telemetry" Level="0" Name="af9f58ec-0c04-4be9-9eb5-55ff6dbe72d7" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x200000000000" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Win32k" Level="0" Name="8c416c79-d49b-4f01-a467-e56d3aa8234c" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x26A000" />
</Keywords>
</EventProvider>
<EventProvider Id="EP_Microsoft-Windows-Kernel-Prefetch" Level="0" Name="Microsoft-Windows-Kernel-Prefetch" NonPagedMemory="true" EventKey="true">
<Keywords>
<Keyword Value="0x0" />
</Keywords>
</EventProvider>
<!-- End - AppLaunch.wprp -->
<Profile Id="AppLifecycle.Responsiveness.Light.File" LoggingMode="File" Name="AppLifecycle.Responsiveness" DetailLevel="Light" Description="App lifecycle responsiveness light to file">
<Collectors>
<SystemCollectorId Value="SC_Responsiveness.LowCost.Light">
<SystemProviderId Value="SP_Responsiveness.Light" />
</SystemCollectorId>
<EventCollectorId Value="EC_Responsiveness.LowCost.Light">
<EventProviders>
<EventProviderId Value="EP_Microsoft-Windows-TestExecution" />
<EventProviderId Value="EP_Microsoft.Windows.WinPerf" />
<EventProviderId Value="EP_Microsoft-Windows-Immersive-Shell"/>
<EventProviderId Value="EP_Microsoft-Windows-AppLifeCycle" />
<EventProviderId Value="EP_Microsoft-Windows-Shell-Launcher" />
<EventProviderId Value="EP_Microsoft-Windows-XAML-Light" />
<EventProviderId Value="EP_Microsoft-Windows-AppLifeCycle-UI" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Process" />
<EventProviderId Value="EP_Microsoft-Windows-Shell-CortanaSearch"/>
<EventProviderId Value="EP_Microsoft-Windows-AppModel-Exec"/>
<EventProviderId Value="EP_Microsoft.Windows.ActivationManager" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-EventTracing" />
<EventProviderId Value="EP_Microsoft-Windows-Desktop-ApplicationFrame" />
<EventProviderId Value="EP_XNA" />
<EventProviderId Value="EP_TaskHost" />
<EventProviderId Value="EP_Device-Health-Etw" />
<EventProviderId Value="EP_Microsoft-Microsoft-Phone-AppLifecycle"/>
<EventProviderId Value="EP_Microsoft-WindowsPhone-CoreUIComponents"/>
<EventProviderId Value="EP_Microsoft-WindowsPhone-AppPlatProvider" />
<EventProviderId Value="EP_Microsoft-WindowsPhone-Silverlight" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-Splash" />
</EventProviders>
</EventCollectorId>
<EventCollectorId Value="EC_Responsiveness.LowCost.Light.UTC">
<EventProviders>
<EventProviderId Value="EP_UTC"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<Profile Id="AppLifecycle.Responsiveness.Diagnostic.Verbose.File" Base="AppLifecycle.Responsiveness.Light.File" LoggingMode="File" Name="AppLifecycle.Responsiveness.Diagnostic" DetailLevel="Verbose" Description="App lifecycle responsiveness verbose to file">
<Collectors Operation="Add">
<SystemCollectorId Value="SC_Responsiveness.LowCost">
<SystemProviderId Value="SP_Responsiveness" />
</SystemCollectorId>
<EventCollectorId Value="EC_Responsiveness.LowCost">
<EventProviders>
<EventProviderId Value="EP_Microsoft-Windows-XAML-Verbose" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-ExecManLogPublisher"/>
<EventProviderId Value="EP_Microsoft-WindowsMobile-Compositor" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-UIXMobile" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-StartMenu" />
<EventProviderId Value="EP_Microsoft-WindowsPhone-MobileUI" />
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<Profile Id="AppLifecycle.Responsiveness.Diagnostic.Verbose.Memory" Base="AppLifecycle.Responsiveness.Light.File" LoggingMode="Memory" Name="AppLifecycle.Responsiveness.Diagnostic" DetailLevel="Verbose" Description="App life cycle responsiveness verbose to memory">
<Collectors>
<SystemCollectorId Value="SC_Responsiveness.HighCost.Verbose">
<SystemProviderId Value="SP_Responsiveness"/>
</SystemCollectorId>
<EventCollectorId Value="EC_Responsiveness.HighCost.Verbose">
<EventProviders>
<EventProviderId Value="EP_Microsoft-Windows-ProcessLifetimeManager" />
<EventProviderId Value="EP_Microsoft-Windows-Shell-CortanaSearch"/>
<EventProviderId Value="EP_Microsoft-WindowsMobile-ExecManLogPublisher"/>
<EventProviderId Value="EP_Microsoft-WindowsMobile-Compositor" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-UIXMobile" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-StartMenu" />
<EventProviderId Value="EP_Microsoft-WindowsPhone-MobileUI" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Power" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Processor-Power" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Pep" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Acpi" />
<EventProviderId Value="EP_Microsoft-Windows-UserModePowerService" />
<EventProviderId Value="EP_Microsoft-Windows-Dwm-Core" />
<EventProviderId Value="EP_Microsoft-Windows-ImageLoad" />
<EventProviderId Value="EP_Microsoft.ClipC" />
<EventProviderId Value="EP_Microsoft.ClipSp" />
<EventProviderId Value="EP_Microsoft.ClipSvc" />
<EventProviderId Value="EP_Microsoft.Windows.LicenseManager.Telemetry" />
<EventProviderId Value="EP_Microsoft-Windows-Win32k" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Prefetch" />
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<Profile Id="AppLifecycle.Memory.Light.File" LoggingMode="File" Name="AppLifecycle.Memory" DetailLevel="Light" Description="App lifecycle memory light to file">
<Collectors>
<SystemCollectorId Value="SC_Memory.LowCost.Light">
<SystemProviderId Value="SP_Memory.Light" />
</SystemCollectorId>
<EventCollectorId Value="EC_Memory.LowCost.Light">
<EventProviders>
<EventProviderId Value="EP_Microsoft-Windows-TestExecution" />
<EventProviderId Value="EP_Microsoft.Windows.WinPerf" />
<EventProviderId Value="EP_Microsoft-Windows-Immersive-Shell"/>
<EventProviderId Value="EP_Microsoft-Windows-AppModel-Exec"/>
<EventProviderId Value="EP_Microsoft.Windows.ActivationManager" />
<EventProviderId Value="EP_Microsoft-Windows-AppLifeCycle" />
<EventProviderId Value="EP_Microsoft-Windows-AppLifeCycle-UI" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-EventTracing" />
<EventProviderId Value="EP_Microsoft-Windows-Desktop-ApplicationFrame" />
<EventProviderId Value="EP_XNA" />
<EventProviderId Value="EP_TaskHost" />
<EventProviderId Value="EP_Device-Health-Etw" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-ExecManLogPublisher"/>
<EventProviderId Value="EP_Microsoft-Microsoft-Phone-AppLifecycle"/>
<EventProviderId Value="EP_Microsoft-WindowsPhone-CoreUIComponents"/>
<EventProviderId Value="EP_Microsoft-WindowsPhone-AppPlatProvider" />
<EventProviderId Value="EP_Microsoft-WindowsPhone-Silverlight" />
<EventProviderId Value="EP_Microsoft-Windows-XAML-Light" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-Splash" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Prefetch" />
</EventProviders>
</EventCollectorId>
<EventCollectorId Value="EC_Responsiveness.LowCost.Light.UTC">
<EventProviders>
<EventProviderId Value="EP_UTC"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
<Profile Id="AppLifecycle.Memory.Diagnostic.Verbose.File" Base="AppLifecycle.Memory.Light.File" LoggingMode="File" Name="AppLifecycle.Memory.Diagnostic" DetailLevel="Verbose" Description="App lifecycle memory verbose to file">
<Collectors Operation="Add">
<SystemCollectorId Value="SC_Memory.HighCost.Verbose">
<SystemProviderId Value="SP_Memory" />
</SystemCollectorId>
<EventCollectorId Value="EC_Memory.LowCost.Light">
<EventProviders>
<EventProviderId Value="EP_Microsoft-Windows-Shell-Launcher" />
<EventProviderId Value="EP_Microsoft-Windows-XAML-Verbose" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Power" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Processor-Power" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Pep" />
<EventProviderId Value="EP_Microsoft-Windows-Dwm-Core" />
<EventProviderId Value="EP_Microsoft-Windows-ImageLoad" />
<EventProviderId Value="EP_Microsoft-Windows-Kernel-Process" />
<EventProviderId Value="EP_Microsoft-Windows-Shell-CortanaSearch"/>
<EventProviderId Value="EP_Microsoft-WindowsMobile-Compositor" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-UIXMobile" />
<EventProviderId Value="EP_Microsoft-WindowsMobile-StartMenu" />
<EventProviderId Value="EP_Microsoft-WindowsPhone-MobileUI" />
<EventProviderId Value="EP_Microsoft-Windows-ProcessLifetimeManager" />
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
</Profiles>
<TraceMergeProperties>
<TraceMergeProperty Id="TraceMerge_Default" Name="TraceMerge_Default" Base="">
<DeletePreMergedTraceFiles Value="true"/>
<CustomEvents>
<CustomEvent Value="ImageId"/>
<CustomEvent Value="BuildInfo"/>
<CustomEvent Value="VolumeMapping"/>
<CustomEvent Value="EventMetadata"/>
<CustomEvent Value="PerfTrackMetadata"/>
<CustomEvent Value="WinSAT"/>
<CustomEvent Value="NetworkInterface"/>
</CustomEvents>
</TraceMergeProperty>
</TraceMergeProperties>
</WindowsPerformanceRecorder>

View file

@ -1,364 +0,0 @@
<# // Copyright (c) Microsoft Corporation. All rights reserved. #>
<#@ template language="C#" hostspecific="True" #>
<#@ output extension=".xml" #>
<# // Set options specific to your app here
var options = new {
RegionPrefix = "Calculator",
ImageFileName = "Calculator.exe",
PackageFamilyName = "Microsoft.WindowsCalculator",
FirstView = "ms-resource:///Files/Views/MainPage.xbf"
};
#>
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<!--
Based on:
\base\PerfTest\MemRe\AppLifecycle\Common\Regions\Regions_Calculator.xml Regions_Calculator.xml
This is a regions of interest file that can be used by WPA to get a quick overview of the time
spent on a set of operations called "regions".
A region is defined as the combination of a Start and a Stop event.
This file contains regions that are of interest for the startup of a UWP app.
The first region "<#= options.RegionPrefix #>_AppLifecycle" is defined by the Start and Stop event of the test.
Subsequent regions are defined as children of this region to make sure we are only tracking
events that occurred during the test.
The events that are defined as Start and Stop events must come from an event provider that is enabled for the
trace that is being analyzed. For WinPerf, that means that the WPR Profile must have these providers enabled.
-->
<?Copyright (c) Microsoft Corporation. All rights reserved.?>
<InstrumentationManifest>
<Instrumentation>
<Regions>
<RegionRoot Guid="{7e8672b5-efe5-4862-90f3-944f136d6c75}"
Name="<#= options.RegionPrefix #>_AppLifeCycle Region Root"
FriendlyName="Root">
<Region Guid="{cf6c4996-1dc8-4fc5-b275-7a7051376f77}"
Name="<#= options.RegionPrefix #>_AppLifeCycle"
FriendlyName="Application Life Cycle Test">
<Start>
<!-- Microsoft-Windows-TestExecution\RunTest_TestRunScope\win:Start -->
<Event Provider="{70d27130-f2f3-4365-b790-d31223254ef4}" Name="RunTest_TestRunScope" Opcode="1"/>
<!-- Match the name of the test we are running. -->
<PayloadIdentifier FieldName="Name" FieldValue="Calculator.PerfTests.AppLifecycleTests.*" FieldValueRelationship="RegEx"/>
</Start>
<Stop>
<!-- Microsoft-Windows-TestExecution\RunTest_TestRunScope\win:Stop -->
<Event Provider="{70d27130-f2f3-4365-b790-d31223254ef4}" Name="RunTest_TestRunScope" Opcode="2"/>
<!-- Match the name of the test we are running. -->
<PayloadIdentifier FieldName="Name" FieldValue="Calculator.PerfTests.AppLifecycleTests.*" FieldValueRelationship="RegEx"/>
</Stop>
<Naming>
<PayloadBased NameField="Name"/>
</Naming>
<Region Guid="{b18b32ec-6796-43e1-802f-aec9aea5eb28}"
Name="<#= options.RegionPrefix #>_Launch_ProcessStart"
FriendlyName="Process Started">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<Event Provider="{2839ff94-8f12-4e1b-82e3-af7af77a450f}" Name="ProcessStarted" Version="0" />
<PayloadIdentifier FieldName="ImageFileName" FieldValue=".*<#= options.ImageFileName #>" FieldValueRelationship="RegEx" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{b1e4255d-131c-4ea8-899d-30b7345bf7d3}"
Name="<#= options.RegionPrefix #>_Launch_UIThreadStart"
FriendlyName="UI Thread Started">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<!-- Ideally use actual thread start event, for now it's just close, using InitializeCore -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="31" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{38084b96-d955-4603-a2c7-2720195ce160}"
Name="<#= options.RegionPrefix #>_Launch_InitializeCore"
FriendlyName="Create XAML Core">
<Start>
<!-- Initialize Core Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="31" Version="0" />
</Start>
<Stop>
<!-- Initialize Core Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="32" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{cc909ec4-17c0-4cd9-9a83-293e06e0dc72}"
Name="<#= options.RegionPrefix #>_Launch_CreateDevice"
FriendlyName="Create Graphics Device">
<Start>
<!-- Create Device Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="76" Version="0" />
</Start>
<Stop>
<!-- Create Device Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="77" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{0ed49a01-2604-499e-8003-0878b3b3c61e}"
Name="<#= options.RegionPrefix #>_Launch_CreateResourceManager"
FriendlyName="Create Resource Manager">
<Start>
<!-- Create Resource Manager Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="463" Version="0" />
</Start>
<Stop>
<!-- Create Resource Manager Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="464" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{365920df-10e7-4b6e-8dcb-e769844ac11f}"
Name="<#= options.RegionPrefix #>_Launch_CreateWindow"
FriendlyName="Create Window">
<Start>
<!-- Create Window Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="29" Version="0" />
</Start>
<Stop>
<!-- Create Window Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="30" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{09995446-0266-4a34-aa39-d99467dfe85d}"
Name="<#= options.RegionPrefix #>_Launch_InitializeTheme"
FriendlyName="Initialize Theme Resources">
<Start>
<!-- Theme Changed Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="457" Version="0" />
</Start>
<Stop>
<!-- Theme Changed Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="458" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{a2fdff0b-75c8-440d-bb55-b87a3c60d55f}"
Name="<#= options.RegionPrefix #>_Launch_NavToFirstFrame"
FriendlyName="XAML Navigate To First Frame Drawn">
<Start>
<!-- Parse XAML -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="1" Version="0" />
<PayloadIdentifier FieldName="URI" FieldValue="<#= options.FirstView #>" />
</Start>
<Stop>
<!-- Frame Drawn -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="65" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
<Match>
<Event PID="true"/>
</Match>
</Region>
<Region Guid="{ffc47f79-2d90-470a-bfde-0d075972f23b}"
Name="<#= options.RegionPrefix #>_ApplicationActivate"
FriendlyName="Application Activate">
<Start>
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="5901" Version="1" />
</Start>
<Stop>
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="5902" Version="1" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{b0c74cf1-16fc-4a33-ba7e-2169727a08d7}"
Name="<#= options.RegionPrefix #>_Launch_SplashScreen"
FriendlyName="Splash Screen Dismissed">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<!-- NavigationServerTask_SplashScreenDismissed -->
<Event Provider="{a0b7550f-4e9a-4f03-ad41-b8042d06a2f7}" Id="1572" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{a1648637-d5ec-46d2-9655-a26d00a35764}"
Name="<#= options.RegionPrefix #>_Launch_UIResponsive"
FriendlyName="UI Responsive">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<Event Provider="{EF00584A-2655-462C-BC24-E7DE630E7FBF}" Name="ModernAppLaunch_UIResponsive" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{74d63c4e-7dd7-4ff6-9ee8-adb462c1c101}"
Name="<#= options.RegionPrefix #>_Launch_VisibleComplete"
FriendlyName="Visible Complete">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<Event Provider="{EF00584A-2655-462C-BC24-E7DE630E7FBF}" Name="ModernAppLaunch_VisibleComplete" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{ec31fb10-992b-438b-8c9e-42454f4b2e5a}"
Name="<#= options.RegionPrefix #>_Suspend"
FriendlyName="Suspended">
<Start>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_SuspendApplication\win:Start -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="2450" Version="1" />
<PayloadIdentifier FieldName="PsmKey" FieldValueRelationship="RegEx" FieldValue="<#= options.PackageFamilyName #>.*" />
</Start>
<Stop>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_SuspendApplication\win:Stop -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="2451" Version="1" />
<PayloadIdentifier FieldName="AppUserModelId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{83735b08-b17e-48cf-82f1-02cb08e45597}"
Name="<#= options.RegionPrefix #>_Resume"
FriendlyName="Resumed">
<Start>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_ResumeApplication_EndToEnd\win:Start -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="11118" Version="0" />
<PayloadIdentifier FieldName="PsmKey" FieldValueRelationship="RegEx" FieldValue="<#= options.PackageFamilyName #>.*" />
</Start>
<Stop>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_ResumeApplication_EndToEnd\win:Stop -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="11119" Version="0" />
<PayloadIdentifier FieldName="AppUserModelId" FieldValue="<#= options.PackageFamilyName #>.*" FieldValueRelationship="RegEx" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName><#= options.ImageFileName #></WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
</Region>
</RegionRoot>
</Regions>
</Instrumentation>
</InstrumentationManifest>

View file

@ -1,353 +0,0 @@
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<!--
Based on:
\base\PerfTest\MemRe\AppLifecycle\Common\Regions\Regions_Calculator.xml Regions_Calculator.xml
This is a regions of interest file that can be used by WPA to get a quick overview of the time
spent on a set of operations called "regions".
A region is defined as the combination of a Start and a Stop event.
This file contains regions that are of interest for the startup of a UWP app.
The first region "Calculator_AppLifecycle" is defined by the Start and Stop event of the test.
Subsequent regions are defined as children of this region to make sure we are only tracking
events that occurred during the test.
The events that are defined as Start and Stop events must come from an event provider that is enabled for the
trace that is being analyzed. For WinPerf, that means that the WPR Profile must have these providers enabled.
-->
<?Copyright (c) Microsoft Corporation. All rights reserved.?>
<InstrumentationManifest>
<Instrumentation>
<Regions>
<RegionRoot Guid="{7e8672b5-efe5-4862-90f3-944f136d6c75}"
Name="Calculator_AppLifeCycle Region Root"
FriendlyName="Root">
<Region Guid="{cf6c4996-1dc8-4fc5-b275-7a7051376f77}"
Name="Calculator_AppLifeCycle"
FriendlyName="Application Life Cycle Test">
<Start>
<!-- Microsoft-Windows-TestExecution\TE_TestRun\win:Start -->
<Event Provider="{065903c1-4883-4fb8-b163-d02bd5efc74c}" Id="7" Version="0" />
<!-- Match the name of the test we are running. -->
<PayloadIdentifier FieldName="Name" FieldValue="Calculator.PerfTests.AppLifecycleTests.*" FieldValueRelationship="RegEx"/>
</Start>
<Stop>
<!-- Microsoft-Windows-TestExecution\TE_TestRun\win:Stop -->
<Event Provider="{065903c1-4883-4fb8-b163-d02bd5efc74c}" Id="8" Version="0" />
<!-- Match the name of the test we are running. -->
<PayloadIdentifier FieldName="Name" FieldValue="Calculator.PerfTests.AppLifecycleTests.*" FieldValueRelationship="RegEx"/>
</Stop>
<Naming>
<PayloadBased NameField="Name"/>
</Naming>
<Region Guid="{b18b32ec-6796-43e1-802f-aec9aea5eb28}"
Name="Calculator_Launch_ProcessStart"
FriendlyName="Process Started">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<Event Provider="{2839ff94-8f12-4e1b-82e3-af7af77a450f}" Name="ProcessStarted" Version="0" />
<PayloadIdentifier FieldName="ImageFileName" FieldValue=".*Calculator.exe" FieldValueRelationship="RegEx" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{b1e4255d-131c-4ea8-899d-30b7345bf7d3}"
Name="Calculator_Launch_UIThreadStart"
FriendlyName="UI Thread Started">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<!-- Ideally use actual thread start event, for now it's just close, using InitializeCore -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="31" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{38084b96-d955-4603-a2c7-2720195ce160}"
Name="Calculator_Launch_InitializeCore"
FriendlyName="Create XAML Core">
<Start>
<!-- Initialize Core Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="31" Version="0" />
</Start>
<Stop>
<!-- Initialize Core Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="32" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{cc909ec4-17c0-4cd9-9a83-293e06e0dc72}"
Name="Calculator_Launch_CreateDevice"
FriendlyName="Create Graphics Device">
<Start>
<!-- Create Device Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="76" Version="0" />
</Start>
<Stop>
<!-- Create Device Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="77" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{0ed49a01-2604-499e-8003-0878b3b3c61e}"
Name="Calculator_Launch_CreateResourceManager"
FriendlyName="Create Resource Manager">
<Start>
<!-- Create Resource Manager Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="463" Version="0" />
</Start>
<Stop>
<!-- Create Resource Manager Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="464" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{365920df-10e7-4b6e-8dcb-e769844ac11f}"
Name="Calculator_Launch_CreateWindow"
FriendlyName="Create Window">
<Start>
<!-- Create Window Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="29" Version="0" />
</Start>
<Stop>
<!-- Create Window Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="30" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{09995446-0266-4a34-aa39-d99467dfe85d}"
Name="Calculator_Launch_InitializeTheme"
FriendlyName="Initialize Theme Resources">
<Start>
<!-- Theme Changed Start -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="457" Version="0" />
</Start>
<Stop>
<!-- Theme Changed Stop -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="458" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{a2fdff0b-75c8-440d-bb55-b87a3c60d55f}"
Name="Calculator_Launch_NavToFirstFrame"
FriendlyName="XAML Navigate To First Frame Drawn">
<Start>
<!-- Parse XAML -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="1" Version="0" />
<PayloadIdentifier FieldName="URI" FieldValue="ms-resource:///Files/Views/MainPage.xbf" />
</Start>
<Stop>
<!-- Frame Drawn -->
<Event Provider="{531A35AB-63CE-4BCF-AA98-F88C7A89E455}" Id="65" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
<Match>
<Event PID="true"/>
</Match>
</Region>
<Region Guid="{ffc47f79-2d90-470a-bfde-0d075972f23b}"
Name="Calculator_ApplicationActivate"
FriendlyName="Application Activate">
<Start>
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="5901" Version="1" />
</Start>
<Stop>
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="5902" Version="1" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{b0c74cf1-16fc-4a33-ba7e-2169727a08d7}"
Name="Calculator_Launch_SplashScreen"
FriendlyName="Splash Screen Dismissed">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<!-- NavigationServerTask_SplashScreenDismissed -->
<Event Provider="{a0b7550f-4e9a-4f03-ad41-b8042d06a2f7}" Id="1572" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{a1648637-d5ec-46d2-9655-a26d00a35764}"
Name="Calculator_Launch_UIResponsive"
FriendlyName="UI Responsive">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<Event Provider="{EF00584A-2655-462C-BC24-E7DE630E7FBF}" Name="ModernAppLaunch_UIResponsive" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{74d63c4e-7dd7-4ff6-9ee8-adb462c1c101}"
Name="Calculator_Launch_VisibleComplete"
FriendlyName="Visible Complete">
<Start>
<!-- Use AAMShim_ActivationStart instead of AppLaunch_UserClick as we don't lanch from Start -->
<Event Provider="{cf7f94b3-08dc-5257-422f-497d7dc86ab3}" Name="AAMShim_ActivationStart" />
<PayloadIdentifier FieldName="AppId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Start>
<Stop>
<Event Provider="{EF00584A-2655-462C-BC24-E7DE630E7FBF}" Name="ModernAppLaunch_VisibleComplete" Version="0" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{ec31fb10-992b-438b-8c9e-42454f4b2e5a}"
Name="Calculator_Suspend"
FriendlyName="Suspended">
<Start>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_SuspendApplication\win:Start -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="2450" Version="1" />
<PayloadIdentifier FieldName="PsmKey" FieldValueRelationship="RegEx" FieldValue="Microsoft.WindowsCalculator.*" />
</Start>
<Stop>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_SuspendApplication\win:Stop -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="2451" Version="1" />
<PayloadIdentifier FieldName="AppUserModelId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
<Region Guid="{83735b08-b17e-48cf-82f1-02cb08e45597}"
Name="Calculator_Resume"
FriendlyName="Resumed">
<Start>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_ResumeApplication_EndToEnd\win:Start -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="11118" Version="0" />
<PayloadIdentifier FieldName="PsmKey" FieldValueRelationship="RegEx" FieldValue="Microsoft.WindowsCalculator.*" />
</Start>
<Stop>
<!-- Microsoft-Windows-Immersive-Shell\PerfTrack_PLM_ResumeApplication_EndToEnd\win:Stop -->
<Event Provider="{315a8872-923e-4ea2-9889-33cd4754bf64}" Id="11119" Version="0" />
<PayloadIdentifier FieldName="AppUserModelId" FieldValue="Microsoft.WindowsCalculator.*" FieldValueRelationship="RegEx" />
</Stop>
<Naming>
<PrependParentName />
</Naming>
<Metadata>
<WinperfWPAPreset.1>CPU</WinperfWPAPreset.1>
<WinperfWPAPreset.1.ProcessName>Calculator.exe</WinperfWPAPreset.1.ProcessName>
<WinperfWPAPreset.2>Commit</WinperfWPAPreset.2>
<WinperfWPAPreset.2.ProcessName>Calculator.exe</WinperfWPAPreset.2.ProcessName>
</Metadata>
</Region>
</Region>
</RegionRoot>
</Regions>
</Instrumentation>
</InstrumentationManifest>

View file

@ -1,54 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.IO;
using System.Runtime.InteropServices;
using Calculator.UIAutomationLibrary;
using Microsoft.OneCoreUap.Test.AppModel;
using WEX.TestExecution;
using WEX.TestExecution.Markup;
namespace Calculator.UITests
{
[TestClass]
public class Initialization
{
[DllImport("AppModel.TestHelper.dll")]
private static extern Int32 WinRTHelper_Register();
[AssemblyInitialize]
[TestProperty("CoreClrProfile", "TestNetv2.0")]
[TestProperty("RunFixtureAs:Assembly", "System")]
public static void AssemblySetup(TestContext context)
{
Verify.AreEqual(0, WinRTHelper_Register());
TestHelper.Initialize();
// Install and Start the Etw.Service service to enable the use of EtwWaiter.
EtwHelper.InstallAndStartETWService();
bool installApp = false;
if (context.Properties.Contains("InstallApp") && (bool.TryParse(context.Properties["InstallApp"].ToString(), out installApp)) && installApp)
{
string certToDeploy = Path.Combine(TAEFHelper.GetTestDeploymentDirectory(), Constants.CertificateFileName);
InstallHelper.InstallCertFile(certToDeploy);
string vcLibsToDeploy = Path.Combine(TAEFHelper.GetTestDeploymentDirectory(), Constants.VCLibsPackageFileName);
string winUIToDeploy = Path.Combine(TAEFHelper.GetTestDeploymentDirectory(), Constants.WinUIPackageFileName);
string appxToDeploy = Path.Combine(TAEFHelper.GetTestDeploymentDirectory(), Constants.PackageFileName);
Impersonater.RunAs(Impersonater.RunAsUser.RestrictedUser, () => InstallHelper.InstallPackage(appxToDeploy, vcLibsToDeploy, winUIToDeploy));
}
}
[AssemblyCleanup]
[TestProperty("RunFixtureAs:Assembly", "System")]
public static void AssemblyCleanup()
{
// Stop and remove the Etw.Service service.
EtwHelper.StopAndRemoveETWService();
TestHelper.Uninitialize();
}
}
}

View file

@ -1,21 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UIAutomationTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f5e8f9b8-f7f1-4300-a5cb-35bfab83f51e")]
// The following was autogenerated by UpdateVersion.ps1
[assembly: AssemblyProduct(@"10.16.1128.1252")]

View file

@ -1,51 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Linq;
using Etw.Managed;
using Microsoft.Windows.Apps.Performance;
using WEX.Logging.Interop;
using WEX.TestExecution;
using WEX.TestExecution.Markup;
using Calculator.UIAutomationLibrary;
namespace Calculator.PerfTests
{
[TestClass]
public class AppLifecycleTests
{
[TestInitialize]
[TestProperty("RunAs", "ElevatedUserOrSystem")]
public void MethodSetup()
{
Utilities.KillExistingCalculatorProcesses();
}
[TestCleanup]
[TestProperty("RunAs", "ElevatedUserOrSystem")]
public void MethodCleanup()
{
Utilities.KillExistingCalculatorProcesses();
}
/// <summary>
/// This method executes the AppLifecycle performance test.
/// The test launches the application, suspend and resumes it and then terminates the app.
///
/// A TAEF data source is used to specify the Windows Performance Recorder profile and
/// regions of interest file to use and defines three different configurations to execute this test with.
/// Cold: The initial run to get dlls loaded into memory and to execute any first-run app logic.
/// Warm: The run that will produce consistent results and that would be used for measures.
/// Memory: A run that is focused on collecting more info on allocations.
/// </summary>
[TestMethod]
[TestProperty("RunAs", "User")]
[TestProperty("Category", "Performance")]
[TestProperty(WinperfConstants.DataSource, PerfConstants.AppLifecycleIterationsSource)]
public void AppLifecycleTest()
{
AppLifecycle.Run(Constants.PackageAppUserModelId);
}
}
}

View file

@ -1,49 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Calculator.UIAutomationLibrary;
using Calculator.UIAutomationLibrary.Tests;
using WEX.TestExecution.Markup;
namespace Calculator.UITests
{
[TestClass]
public class CalculatorTests
{
[TestInitialize]
[TestProperty("RunAs", "ElevatedUserOrSystem")]
public void MethodSetup()
{
Utilities.KillExistingCalculatorProcesses();
}
[TestCleanup]
[TestProperty("RunAs", "ElevatedUserOrSystem")]
public void MethodCleanup()
{
Utilities.KillExistingCalculatorProcesses();
}
[TestMethod]
[TestProperty("RunAs", "User")]
public void OnePlusTwoTest()
{
var calculatorLfm = CalculatorAppLauncher.Launch();
calculatorLfm.CalculateOnePlusTwo();
calculatorLfm.Close();
}
[TestMethod]
[TestProperty("RunAs", "User")]
public void Sqrt4Minus2Test()
{
var calculatorLfm = CalculatorAppLauncher.Launch();
calculatorLfm.CalculateSqrt4Minus2();
calculatorLfm.Close();
}
}
}

Some files were not shown because too many files have changed in this diff Show more