-
Notifications
You must be signed in to change notification settings - Fork 0
/
df_test.go
47 lines (42 loc) · 2.16 KB
/
df_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package adyendfgo
import (
"testing"
)
func TestMain(t *testing.T) {
expectedFingerPrint := "DpqwU4zEdN0050000000000000CK1aUgqatB0039372870cVB94iKzBGRaIEwiHpQzBix7RX3az8002rKkEK1Ha8P00000YVxErxMpCOfKkhnraRhXiZCqnI4lsk:40"
f := &Fingerprinter{
Plugins: 10,
NrOfPlugins: 3,
Fonts: 10,
NrOfFonts: 3,
TimeZone: 10,
Video: 10,
SuperCookies: 10,
UserAgent: 10,
MimeTypes: 10,
NrOfMimeTypes: 3,
Canvas: 10,
CpuClass: 5,
Platform: 5,
DoNotTrack: 5,
WebGlFp: 10,
JsFonts: 10,
UserAgentString: "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
PluginsString: "Plugin 0: Chrome PDF Viewer; Portable Document Format; internal-pdf-viewer; (Portable Document Format; application/pdf; pdf) (Portable Document Format; text/pdf; pdf). Plugin 1: Chromium PDF Viewer; Portable Document Format; internal-pdf-viewer; (Portable Document Format; application/pdf; pdf) (Portable Document Format; text/pdf; pdf). Plugin 2: Microsoft Edge PDF Viewer; Portable Document Format; internal-pdf-viewer; (Portable Document Format; application/pdf; pdf) (Portable Document Format; text/pdf; pdf). Plugin 3: PDF Viewer; Portable Document Format; internal-pdf-viewer; (Portable Document Format; application/pdf; pdf) (Portable Document Format; text/pdf; pdf). Plugin 4: WebKit built-in PDF; Portable Document Format; internal-pdf-viewer; (Portable Document Format; application/pdf; pdf) (Portable Document Format; text/pdf; pdf). ",
PluginCount: 5,
ScreenWidth: 1440,
ScreenHeight: 900,
ScreenColorDepth: 30,
DeviceStroage: "DOM-LS: Yes, DOM-SS: Yes",
OXMLStorage: ", IE-UD: No",
MimeTypesString: "Portable Document Formatapplication/pdfpdfPortable Document Formattext/pdfpdf",
MimetTypesLength: 2,
PlatformString: "MacIntel",
DoNotTrackString: "1",
Entropy: "40",
}
fingerprint := f.GenerateFingerPrint()
if fingerprint != expectedFingerPrint {
t.Errorf("Incorrect fingerprint expected: %s, got %s\n", expectedFingerPrint, fingerprint)
}
}