Testing experiment for branch support. branch-testing
authorBenjamin Smedberg <benjamin@smedbergs.us>
Wed, 25 Jun 2014 17:08:30 -0400
branchbranch-testing
changeset 12 844cc35009f07b640707cf98319409a685246274
parent 11 3d89a1685e6af1c8fdccbb1baf9d550d31de73cb
push id6
push userbsmedberg@mozilla.com
push dateWed, 25 Jun 2014 21:09:40 +0000
Testing experiment for branch support.
experiments/branch-test/code/bootstrap.js
experiments/branch-test/code/install.rdf
experiments/branch-test/experiment.xpi
experiments/branch-test/manifest.json
new file mode 100644
--- /dev/null
+++ b/experiments/branch-test/code/bootstrap.js
@@ -0,0 +1,26 @@
+let {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+Cu.import("resource:///modules/experiments/Experiments.jsm");
+Cu.import("resource://gre/modules/Task.jsm");
+
+const kSELF_ID = "branch-testing@benjamin.smedbergs.us";
+
+function startup() {
+  Task.spawn(function*() {
+    let branch = yield Experiments.instance().getExperimentBranch(kSELF_ID);
+    if (branch) {
+      Cu.reportError("Found existing experiment branch: " + branch);
+    } else {
+      Cu.reportError("No existing branch found.");
+      let branch = ["a", "b", "c"][Math.floor(Math.random() * 3)];
+      yield Experiments.instance().setExperimentBranch(kSELF_ID, branch);
+      Cu.reportError("Setting experiment branch to " + branch);
+    }
+  }).then(
+    function() {
+      Cu.reportError("Bootstrap startup succeeded");
+    },
+    function(e) {
+      Cu.reportError("Got error during bootstrap startup: " + e);
+    });
+}
new file mode 100644
--- /dev/null
+++ b/experiments/branch-test/code/install.rdf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>jid1-experiment-branch-test@jetpack</em:id>
+    <em:version>1.0.0</em:version>
+    <em:type>128</em:type>
+    <em:bootstrap>true</em:bootstrap>
+    <em:unpack>false</em:unpack>
+
+    <!-- Firefox -->
+    <em:targetApplication>
+      <Description>
+        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+        <em:minVersion>31.0</em:minVersion>
+        <em:maxVersion>45.0</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
+    <!-- Front End MetaData -->
+    <em:name>experiment branch tester</em:name>
+    <em:description>An add-on which uses experiment branches.</em:description>
+  </Description>
+</RDF>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3d5d8d2d28b17c4a489bd6e35ab102cf4195a71b
GIT binary patch
literal 1299
zc$^FHW@Zs#U}E54SlxEh#YLgCb_yc{!z^Y71|Eh2hNS%blH!u0!~(sn;$W9(h9wL@
zz`?LKI&@ufN<yYUVnTvJLIZ=mLRt!|ainYGk-PW0=I@MDZ0g?@@^W9oG2P=QjvP2}
zMBv~7o@ru<KhA5MKX8I0P@83$ib9f)fFY~GLWZ=}4o5!T;A995;bmYyWVSlE#dLM>
z7n9Y&wUZ9!-8SH9d(ZfZuf?zE`N{UXK|B((mL6^>o&GIMq*>{5XH>M23s-jFle^lM
z8;w(P^~`i9+5fCB>gHL$?5c|gcf>5AHOV}^W{0=yDsIXxmMH%qI&I(Uz0Su=Ea#t1
zKfNNyibKcM;gg|6Oi1X}pH|yEMD4yy<V-)k`l?}A|CP>1pB8`fJ>dD!@ABmkyZMsu
zJ089)`}+FV`Sb5H<u~%(n)x=}E$Ow{{cA7eO4H{q;(Kk{#=FuZ=|%1$<D9+BNwOB-
zHZ@%T$&(=AxcA@dClN)4&lqkUNw-(_t=@R!+K2VRv%h(IPHDZRAa5M*+%02%_IA4I
z?S?z6eVG*|hB6wrhH}_>6uw=&nsNTy1kOGI{%#$I1IwLlxZX2FAL=))|GoIZLBGkz
zH4L@pMC=uhn!=f1C-JeMesSgMS=ZDzD*BXeeJ`|}`$v$Ck5oG6MM<ZpoeTf#-cj0r
zp83Xpca{BRt&eoAcG^p=51-dq|I}8P{cit$&Hxj(jmN5-wrcx-`Ox!#|9pdGi&Y!r
z|CcR)YacC{*SzJgbO1cH$hO~fc_Q}Rcp)&g!~jzZH!!ti<`tJD=H%!VrKHg#vCK4I
z9b5s#1wfn|>{~qBKwxjW+J8sY^u`|<NfJJ@B-OXaRh_8i?OrRwqO9Ax<nsSG$qgIl
z&XL$#>;L=PS`Yd5T}kx;(l=LZeZ2cn;)+kpCS+|dv(ox`s`5-;{-yZY;%O^St(j{Z
zIJ+Y5{`WljUA^}z>tv44<JhC{V3)?u%5WCu@Mq^{ns8nd-?Z!JgizMSW&%o|HrR2z
zm$}`!v7}k;`X<%v&V$=tp0K*8H8Zp`q;0{f3SO^i85u#5ve!CwHkn8MkZBj&x+YNY
zepbNGd6QHBRXArU{-0YVTzc^=XNnm^c+XSiO$9IZ9zDY!mRxD0vo-hf1V!Flw_S%P
zZgk*Y8{Gaal5^@z595Mr<KlgV=i-(e+axLR{P|hO_Y>yb+BV7ZLed+fb;1>1kM*Bv
z3wC{KeBQ_)ch_CDe>>Aoc_$9TWBd=bew9m}2#oXoYPDS8SFuj|4N=LqWW`@~D*880
zuKj-VoyZGu=6UUlq+Q=cioQ`7%4v9DB+qJ^cKX`QEv02QtX^$Acp`%3=*(XA-{-oT
zZa=^Feraea8}IKDNvZNZD|Sdds9JJmvwip9f9wI?j7;L(xJnv9P*P!FWKdw()(B#u
wmOCuqq!b#$3Mn9vjlxWZ$VTZgF`y<&B$Gg?C%~JP4Wyb02&V$+3>FX%06fzoH~;_u
new file mode 100644
--- /dev/null
+++ b/experiments/branch-test/manifest.json
@@ -0,0 +1,15 @@
+{
+  "publish": true,
+  "priority": 4,
+  "name": "Test experiment branching",
+  "description": "Test the experiment branch API",
+  "info": "<p>Blah</p>",
+  "manifest": {
+    "id": "branch-testing@benjamin.smedbergs.us",
+    "startTime": 1388552400,
+    "endTime": 2000000000,
+    "maxActiveSeconds": 432000,
+    "appName": ["Firefox"],
+    "channel": ["default"]
+  }
+}