From 18587e78f0f3c0e1bf29f8c18ceb8668f3f0ead3 Mon Sep 17 00:00:00 2001 From: Kristen Wright Date: Thu, 30 Jul 2020 17:21:52 +0000 Subject: [PATCH] Bug 1613178 - Update mozcrash test files with a sample .extra file r=gbrown Updates the test files for `mozcrash` so the .extra file resembles an actual .extra file, which exercises the json parser. This required updating the `LocalPath` to write out UTF-8 text, and the sample .extra files contains some unicode text to exercise the parse functionality. Differential Revision: https://phabricator.services.mozilla.com/D85325 --- testing/mozbase/mozcrash/tests/conftest.py | 37 +++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/testing/mozbase/mozcrash/tests/conftest.py b/testing/mozbase/mozcrash/tests/conftest.py index f92bee7dbe54..1b003794712d 100644 --- a/testing/mozbase/mozcrash/tests/conftest.py +++ b/testing/mozbase/mozcrash/tests/conftest.py @@ -1,3 +1,5 @@ +# coding=UTF-8 + from __future__ import absolute_import import uuid @@ -60,7 +62,40 @@ def minidump_files(request, tmpdir): dmp.write('foo') extra = tmpdir.join('{}.extra'.format(name)) - extra.write('bar') + + extra.write_text(u''' +{ + "ContentSandboxLevel":"2", + "TelemetryEnvironment":"{🍪}", + "EMCheckCompatibility":"true", + "ProductName":"Firefox", + "ContentSandboxCapabilities":"119", + "TelemetryClientId":"", + "Vendor":"Mozilla", + "InstallTime":"1000000000", + "Theme":"classic/1.0", + "ReleaseChannel":"default", + "ServerURL":"https://crash-reports.mozilla.com", + "SafeMode":"0", + "ContentSandboxCapable":"1", + "useragent_locale":"en-US", + "Version":"55.0a1", + "BuildID":"20170512114708", + "ProductID":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}", + "MozCrashReason": "MOZ_CRASH()", + "TelemetryServerURL":"", + "DOMIPCEnabled":"1", + "Add-ons":"", + "CrashTime":"1494582646", + "UptimeTS":"14.9179586", + "ThreadIdNameMapping":"", + "ContentSandboxEnabled":"1", + "ProcessType":"content", + "StartupTime":"1000000000", + "URL":"about:home" +} + + ''', encoding='utf-8') files.append({'dmp': dmp, 'extra': extra})