Skip to content

Commit 768b6e3

Browse files
authored
Update the Dynamic Links testapp to handle Windows and Linux (#231)
* Handle missing keys on error in Dynamic Links better * Use the Application.identifier in the test, instead of hardcoding it
1 parent 2502cb5 commit 768b6e3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

dynamic_links/testapp/Assets/Firebase/Sample/DynamicLinks/UIHandlerAutomated.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ Task TestCreateLongLinkAsync() {
6464
return result;
6565
};
6666

67+
// Dynamic Links uses the Application identifier for some of the fields.
68+
// Note that on Windows and Linux desktop, this field will likely be empty.
69+
string identifier = Application.identifier;
70+
6771
// This is taken from the values given in UIHandler.
6872
var expected =
6973
urlHost + "/?afl=https://mysite/fallback&" +
70-
"amv=12&apn=com.google.FirebaseUnityDynamicLinksTestApp.dev&at=abcdefg&ct=hijklmno&" +
71-
"ibi=com.google.FirebaseUnityDynamicLinksTestApp.dev&ifl=https://mysite/fallback&imv=1.2.3&" +
72-
"ipbi=com.google.FirebaseUnityDynamicLinksTestApp.dev&" +
74+
"amv=12&apn=" + identifier + "&at=abcdefg&ct=hijklmno&" +
75+
"ibi=" + identifier + "&ifl=https://mysite/fallback&imv=1.2.3&" +
76+
"ipbi=" + identifier + "&" +
7377
"ipfl=https://mysite/fallbackipad&ius=mycustomscheme&link=https://google.com/abc&" +
7478
"pt=pq-rstuv&sd=My app is awesome!&si=https://mysite.com/someimage.jpg&st=My App!&" +
7579
"utm_campaign=mycampaign&utm_content=mycontent&utm_medium=mymedium&utm_source=mysource&" +
@@ -105,7 +109,8 @@ Task TestCreateLongLinkAsync() {
105109
differences.Add(String.Format(
106110
"{0}: \n" +
107111
" Expected: {1}\n" +
108-
" Actual: {2}", key, expectedParams[key], resultParams[key]));
112+
" Actual: {2}", key, expectedParams[key],
113+
resultParams.ContainsKey(key) ? resultParams[key] : "(missing key)"));
109114
}
110115
}
111116
source.TrySetException(new Exception(String.Join("\n", differences.ToArray())));

0 commit comments

Comments
 (0)