summaryrefslogtreecommitdiffstats
path: root/services/fxaccounts/tests/xpcshell/head.js
diff options
context:
space:
mode:
Diffstat (limited to 'services/fxaccounts/tests/xpcshell/head.js')
-rw-r--r--services/fxaccounts/tests/xpcshell/head.js62
1 files changed, 62 insertions, 0 deletions
diff --git a/services/fxaccounts/tests/xpcshell/head.js b/services/fxaccounts/tests/xpcshell/head.js
new file mode 100644
index 0000000000..b8e8b3ac52
--- /dev/null
+++ b/services/fxaccounts/tests/xpcshell/head.js
@@ -0,0 +1,62 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/* import-globals-from ../../../common/tests/unit/head_helpers.js */
+/* import-globals-from ../../../common/tests/unit/head_http.js */
+
+"use strict";
+
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+ "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
+const {
+ SCOPE_OLD_SYNC,
+ SCOPE_ECOSYSTEM_TELEMETRY,
+ LEGACY_SCOPE_WEBEXT_SYNC,
+} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
+
+// Some mock key data, in both scoped-key and legacy field formats.
+const MOCK_ACCOUNT_KEYS = {
+ scopedKeys: {
+ [SCOPE_OLD_SYNC]: {
+ kid: "1234567890123-u7u7u7u7u7u7u7u7u7u7uw",
+ k:
+ "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg",
+ kty: "oct",
+ },
+ [SCOPE_ECOSYSTEM_TELEMETRY]: {
+ kid: "1234567890123-7u7u7u7u7u7u7u7u7u7u7g",
+ k: "7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u4",
+ kty: "oct",
+ },
+ [LEGACY_SCOPE_WEBEXT_SYNC]: {
+ kid: "1234567890123-3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d0",
+ k:
+ "zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzA",
+ kty: "oct",
+ },
+ },
+ kSync:
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ kXCS: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+ kExtSync:
+ "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
+ kExtKbHash:
+ "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd ",
+ ecosystemUserId:
+ "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
+};
+
+(function initFxAccountsTestingInfrastructure() {
+ do_get_profile();
+
+ let ns = {};
+ ChromeUtils.import(
+ "resource://testing-common/services/common/logging.js",
+ ns
+ );
+
+ ns.initTestLogging("Trace");
+}.call(this));