@@ -156,14 +156,15 @@ func TestRedirectFull(t *testing.T) {
156156 )
157157
158158 for _ , params := range []struct {
159- AttributionCode string
160- Referer string
161- ExpectedLocation string
162- ExpectedCode string
163- SkipDownloadLogChecks bool
164- ExpectedClientID string
165- ExpectedClientIDGA4 string
166- ExpectedSessionID string
159+ AttributionCode string
160+ Referer string
161+ ExpectedLocation string
162+ ExpectedCode string
163+ SkipDownloadLogChecks bool
164+ ExpectedClientID string
165+ ExpectedClientIDGA4 string
166+ ExpectedSessionID string
167+ ExpectedDownloadSource string
167168 }{
168169 {
169170 AttributionCode : `campaign=%28not+set%29&content=%28not+set%29&medium=organic&source=www.google.com` ,
@@ -261,6 +262,14 @@ func TestRedirectFull(t *testing.T) {
261262 ExpectedCode : "" ,
262263 SkipDownloadLogChecks : true ,
263264 },
265+
266+ {
267+ AttributionCode : `campaign=%28not+set%29&content=%28not+set%29&medium=organic&source=www.google.com&dlsource=fxdotcom` ,
268+ Referer : "" ,
269+ ExpectedLocation : `/cdn/builds/firefox-stub/en-US/win/` ,
270+ ExpectedCode : `campaign%3D%2528not%2Bset%2529%26content%3D%2528not%2Bset%2529%26dlsource%3Dfxdotcom%26dltoken%3D[\w\d-]+%26medium%3Dorganic%26source%3Dwww.google.com` ,
271+ ExpectedDownloadSource : "fxdotcom" ,
272+ },
264273 } {
265274 testHook .Reset ()
266275
@@ -343,6 +352,11 @@ func TestRedirectFull(t *testing.T) {
343352 t .Errorf ("Expected session_id: %s, got: %v" , params .ExpectedSessionID , sessionID )
344353 }
345354
355+ downloadSource := entry .Data ["dlsource" ]
356+ if downloadSource != params .ExpectedDownloadSource {
357+ t .Errorf ("Expected dlsource: %s, got: %v" , params .ExpectedDownloadSource , downloadSource )
358+ }
359+
346360 product := entry .Data ["product" ]
347361 if entry .Data ["product" ] != "firefox-stub" {
348362 t .Errorf ("Expected product: firefox-stub, got: %v" , product )
0 commit comments