Merge m-c to inbound, a=merge

This commit is contained in:
Wes Kocher 2015-06-02 18:43:25 -07:00
commit 315a009cb0
244 changed files with 2469 additions and 1593 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

View File

@ -19,11 +19,11 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="22664edc4c73e5fe8f5095ff1d5549db78a2bc10"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="218a5637399d023f4326e12c8a486dad95403b6c"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="aac9cc4bb94cf720baf8f7ee419b4d76ac86b1ac"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="10b3daf0093db94c64e78a72ac43a93b68976087"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<!-- Stock Android things -->

View File

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
@ -129,10 +129,10 @@
<!-- Emulator specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="f390788a00706c06e5248edfd8d27b365387e84a"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d2f58dbee70cba71bd3fad8cdd0fee620d10cf92"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c4d9746e5f1a3a2e6cb53d59d5d721e9888cd2e1"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="f37bd545063039e30a92f2550ae78c0e6e4e2d08"/>
<project name="platform_external_wpa_supplicant_8" path="external/wpa_supplicant_8" remote="b2g" revision="0c6a6547cd1fd302fa2b0f6e375654df36bf0ec4"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="42f61f665e7a9857da8cd14b455e15bae98e6b44"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="de4bfffbbc2aabe5b5eca485e459da75e49097e2"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d82e00fb6380b4f6cea7a96213913ee9eb441239"/>
<project name="platform/development" path="development" revision="5968ff4e13e0d696ad8d972281fc27ae5a12829b"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="0951179277915335251c5e11d242e4e1a8c2236f"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>

View File

@ -19,11 +19,11 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="22664edc4c73e5fe8f5095ff1d5549db78a2bc10"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="218a5637399d023f4326e12c8a486dad95403b6c"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="aac9cc4bb94cf720baf8f7ee419b4d76ac86b1ac"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="10b3daf0093db94c64e78a72ac43a93b68976087"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "6d477a7884273886605049b20f60af5c1583a150",
"git_revision": "9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "c7beef2b034d2308a85e8c866395c78245bc554f",
"revision": "d5e509fd9697316bcbc267413a30478dcd4dbca9",
"repo_path": "integration/gaia-central"
}

View File

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6d477a7884273886605049b20f60af5c1583a150"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="9b7ed13e0dee26b9f16ae5fbc076fa8bd588b256"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4a697ec692aa762eb8cdb7812f5a051c5870020f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="15a220c3e411f9606e4059e4c9fd0c57a4290c13"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>

View File

@ -49,6 +49,51 @@ let healthReportWrapper = {
}
},
sendTelemetryPingList: function () {
console.log("AboutHealthReport: Collecting Telemetry ping list.");
MozSelfSupport.getTelemetryPingList().then((list) => {
console.log("AboutHealthReport: Sending Telemetry ping list.");
this.injectData("telemetry-ping-list", list);
}).catch((ex) => {
console.log("AboutHealthReport: Collecting ping list failed: " + ex);
});
},
sendTelemetryPingData: function (pingId) {
console.log("AboutHealthReport: Collecting Telemetry ping data.");
MozSelfSupport.getTelemetryPing(pingId).then((ping) => {
console.log("AboutHealthReport: Sending Telemetry ping data.");
this.injectData("telemetry-ping-data", {
id: pingId,
pingData: ping,
});
}).catch((ex) => {
console.log("AboutHealthReport: Loading ping data failed: " + ex);
this.injectData("telemetry-ping-data", {
id: pingId,
error: "error-generic",
});
});
},
sendCurrentEnvironment: function () {
console.log("AboutHealthReport: Sending Telemetry environment data.");
MozSelfSupport.getCurrentTelemetryEnvironment().then((environment) => {
this.injectData("telemetry-current-environment-data", environment);
}).catch((ex) => {
console.log("AboutHealthReport: Collecting current environment data failed: " + ex);
});
},
sendCurrentPingData: function () {
console.log("AboutHealthReport: Sending current Telemetry ping data.");
MozSelfSupport.getCurrentTelemetrySubsessionPing().then((ping) => {
this.injectData("telemetry-current-ping-data", ping);
}).catch((ex) => {
console.log("AboutHealthReport: Collecting current ping data failed: " + ex);
});
},
refreshPayload: function () {
MozSelfSupport.getHealthReportPayload().then(this.updatePayload,
this.handlePayloadFailure);
@ -60,7 +105,7 @@ let healthReportWrapper = {
injectData: function (type, content) {
let report = this._getReportURI();
// file URIs can't be used for targetOrigin, so we use "*" for this special case
// in all other cases, pass in the URL to the report so we properly restrict the message dispatch
let reportUrl = report.scheme == "file" ? "*" : report.spec;
@ -88,6 +133,18 @@ let healthReportWrapper = {
case "RequestCurrentPayload":
this.refreshPayload();
break;
case "RequestTelemetryPingList":
this.sendTelemetryPingList();
break;
case "RequestTelemetryPingData":
this.sendTelemetryPingData(evt.detail.id);
break;
case "RequestCurrentEnvironment":
this.sendCurrentEnvironment();
break;
case "RequestCurrentPingData":
this.sendCurrentPingData();
break;
default:
Cu.reportError("Unexpected remote command received: " + evt.detail.command + ". Ignoring command.");
break;

View File

@ -64,7 +64,7 @@
<button class="launchButton" id="downloads">&abouthome.downloadsButton.label;</button>
<button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button>
<button class="launchButton" id="history">&abouthome.historyButton.label;</button>
<button class="launchButton" id="apps">&abouthome.appsButton.label;</button>
<button class="launchButton" id="apps">&abouthome.appsButton2.label;</button>
<button class="launchButton" id="addons">&abouthome.addonsButton.label;</button>
<button class="launchButton" id="sync">&abouthome.syncButton.label;</button>
#ifdef XP_WIN

View File

@ -1508,6 +1508,13 @@
aBrowser.setAttribute("remote", aShouldBeRemote ? "true" : "false");
parent.appendChild(aBrowser);
// Switching a browser's remoteness will create a new frameLoader.
// As frameLoaders start out with an active docShell we have to
// deactivate it if this is not the selected tab's browser or the
// browser window is minimized.
aBrowser.docShellIsActive = (aBrowser == this.selectedBrowser &&
window.windowState != window.STATE_MINIMIZED);
// Restore the progress listener.
aBrowser.webProgress.addProgressListener(filter, Ci.nsIWebProgress.NOTIFY_ALL);

View File

@ -64,6 +64,7 @@ support-files =
file_fullscreen-window-open.html
get_user_media.html
head.js
healthreport_pingData.js
healthreport_testRemoteCommands.html
moz.png
navigating_window_with_download.html

View File

@ -7,28 +7,70 @@ XPCOMUtils.defineLazyModuleGetter(this, "Promise",
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
const CHROME_BASE = "chrome://mochitests/content/browser/browser/base/content/test/general/";
const HTTPS_BASE = "https://example.com/browser/browser/base/content/test/general/";
const TELEMETRY_LOG_PREF = "toolkit.telemetry.log.level";
const telemetryOriginalLogPref = Preferences.get(TELEMETRY_LOG_PREF, null);
registerCleanupFunction(function() {
// Ensure we don't pollute prefs for next tests.
if (telemetryOriginalLogPref) {
Preferences.set(TELEMETRY_LOG_PREF, telemetryOriginalLogPref);
} else {
Preferences.reset(TELEMETRY_LOG_PREF);
}
try {
Services.prefs.clearUserPref("datareporting.healthreport.about.reportUrl");
let policy = Cc["@mozilla.org/datareporting/service;1"]
.getService(Ci.nsISupports)
.wrappedJSObject
.policy;
policy.recordHealthReportUploadEnabled(true,
policy.recordHealthReportUploadEnabled(true,
"Resetting after tests.");
} catch (ex) {}
});
function fakeTelemetryNow(...args) {
let date = new Date(...args);
let scope = {};
const modules = [
Cu.import("resource://gre/modules/TelemetrySession.jsm", scope),
Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", scope),
Cu.import("resource://gre/modules/TelemetryController.jsm", scope),
];
for (let m of modules) {
m.Policy.now = () => new Date(date);
}
return date;
}
function setupPingArchive() {
let scope = {};
Cu.import("resource://gre/modules/TelemetryController.jsm", scope);
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
.loadSubScript(CHROME_BASE + "healthreport_pingData.js", scope);
for (let p of scope.TEST_PINGS) {
fakeTelemetryNow(p.date);
p.id = yield scope.TelemetryController.submitExternalPing(p.type, p.payload);
}
}
let gTests = [
{
desc: "Test the remote commands",
setup: function ()
setup: Task.async(function*()
{
Services.prefs.setCharPref("datareporting.healthreport.about.reportUrl",
"https://example.com/browser/browser/base/content/test/general/healthreport_testRemoteCommands.html");
},
Preferences.set(TELEMETRY_LOG_PREF, "Trace");
yield setupPingArchive();
Preferences.set("datareporting.healthreport.about.reportUrl",
HTTPS_BASE + "healthreport_testRemoteCommands.html");
}),
run: function (iframe)
{
let deferred = Promise.defer();
@ -61,7 +103,6 @@ let gTests = [
}
},
]; // gTests
function test()
@ -74,7 +115,7 @@ function test()
Task.spawn(function () {
for (let test of gTests) {
info(test.desc);
test.setup();
yield test.setup();
let iframe = yield promiseNewTabLoadEvent("about:healthreport");
@ -105,4 +146,3 @@ function promiseNewTabLoadEvent(aUrl, aEventType="load")
}, true);
return deferred.promise;
}

View File

@ -0,0 +1,17 @@
const TEST_PINGS = [
{
type: "test-telemetryArchive-1",
payload: { foo: "bar" },
date: new Date(2010, 1, 1, 10, 0, 0),
},
{
type: "test-telemetryArchive-2",
payload: { x: { y: "z"} },
date: new Date(2010, 1, 1, 11, 0, 0),
},
{
type: "test-telemetryArchive-3",
payload: { moo: "meh" },
date: new Date(2010, 1, 1, 12, 0, 0),
},
];

View File

@ -1,8 +1,10 @@
<html>
<head>
<meta charset="utf-8">
<script>
<script type="application/javascript;version=1.7"
src="healthreport_pingData.js">
</script>
<script type="application/javascript;version=1.7">
function init() {
window.addEventListener("message", function process(e) {
@ -34,6 +36,80 @@ function validatePayload(payload) {
return true;
}
function isArray(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
}
function writeDiagnostic(text) {
let node = document.createTextNode(text);
let br = document.createElement("br");
document.body.appendChild(node);
document.body.appendChild(br);
}
function validateCurrentTelemetryEnvironment(data) {
// Simple check for now: check that the received object has the expected
// top-level properties.
const expectedKeys = ["profile", "settings", "system", "build", "partner", "addons"];
return expectedKeys.every(key => (key in data));
}
function validateCurrentTelemetryPingData(ping) {
// Simple check for now: check that the received object has the expected
// top-level properties and that the type and reason match.
const expectedKeys = ["environment", "clientId", "payload", "application",
"version", "type", "id"];
return expectedKeys.every(key => (key in ping)) &&
(ping.type == "main") &&
("info" in ping.payload) &&
("reason" in ping.payload.info) &&
(ping.payload.info.reason == "gather-subsession-payload");
}
function validateTelemetryPingList(list) {
if (!isArray(list)) {
console.log("Telemetry ping list is not an array.");
return false;
}
if (list.length != TEST_PINGS.length) {
console.log("Telemetry ping length is not correct.");
return false;
}
let valid = true;
for (let i=0; i<list.length; ++i) {
let received = list[i];
let expected = TEST_PINGS[i];
if (received.type != expected.type ||
received.timestampCreated != expected.date.getTime()) {
writeDiagnostic("Telemetry ping " + i + " does not match.");
writeDiagnostic("Expected: " + JSON.stringify(expected));
writeDiagnostic("Received: " + JSON.stringify(received));
valid = false;
} else {
writeDiagnostic("Telemetry ping " + i + " matches.");
}
}
return true;
}
function validateTelemetryPingData(expected, received) {
const receivedDate = new Date(received.creationDate);
if (received.id != expected.id ||
received.type != expected.type ||
receivedDate.getTime() != expected.date.getTime()) {
writeDiagnostic("Telemetry ping data for " + expected.id + " doesn't match.");
writeDiagnostic("Expected: " + JSON.stringify(expected));
writeDiagnostic("Received: " + JSON.stringify(received));
return false;
}
writeDiagnostic("Telemetry ping data for " + expected.id + " matched.");
return true;
}
var tests = [
{
info: "Checking initial value is enabled",
@ -91,6 +167,50 @@ var tests = [
return validatePayload(payload);
},
},
{
info: "Verifying that we can get the current Telemetry environment data",
event: "RequestCurrentEnvironment",
payloadType: "telemetry-current-environment-data",
validateResponse: function(payload) {
return validateCurrentTelemetryEnvironment(payload);
},
},
{
info: "Verifying that we can get the current Telemetry ping data",
event: "RequestCurrentPingData",
payloadType: "telemetry-current-ping-data",
validateResponse: function(payload) {
return validateCurrentTelemetryPingData(payload);
},
},
{
info: "Verifying that we get the proper Telemetry ping list",
event: "RequestTelemetryPingList",
payloadType: "telemetry-ping-list",
validateResponse: function(payload) {
// Validate the ping list
if (!validateTelemetryPingList(payload)) {
return false;
}
// Now that we received the ping ids, set up additional test tasks
// that check loading the individual pings.
for (let i=0; i<TEST_PINGS.length; ++i) {
TEST_PINGS[i].id = payload[i].id;
tests.push({
info: "Verifying that we can get the proper Telemetry ping data #" + (i + 1),
event: "RequestTelemetryPingData",
eventData: { id: TEST_PINGS[i].id },
payloadType: "telemetry-ping-data",
validateResponse: function(payload) {
return validateTelemetryPingData(TEST_PINGS[i], payload.pingData);
},
});
}
return true;
},
},
];
var currentTest = -1;
@ -112,7 +232,7 @@ function doTest(evt) {
}
// start the next test if there are any left
if (tests[++currentTest])
sendToBrowser(tests[currentTest].event);
sendToBrowser(tests[currentTest].event, tests[currentTest].eventData);
else
reportFinished();
}
@ -129,8 +249,14 @@ function reportFinished(cmd) {
document.dispatchEvent(event);
}
function sendToBrowser(type) {
var event = new CustomEvent("RemoteHealthReportCommand", {detail: {command: type}, bubbles: true});
function sendToBrowser(type, eventData) {
eventData = eventData || {};
let detail = {command: type};
for (let key of Object.keys(eventData)) {
detail[key] = eventData[key];
}
var event = new CustomEvent("RemoteHealthReportCommand", {detail: detail, bubbles: true});
document.dispatchEvent(event);
}

View File

@ -1507,6 +1507,21 @@ let CustomizableUIInternal = {
// to the panel if we have to. We bail as soon as we find an input,
// a toolbarbutton/item, or the panel:
while (true && target) {
// Skip out of iframes etc:
if (target.nodeType == target.DOCUMENT_NODE) {
if (!target.defaultView) {
// Err, we're done.
break;
}
// Cue some voodoo
target = target.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
if (!target) {
break;
}
}
let tagName = target.localName;
inInput = tagName == "input" || tagName == "textbox";
inItem = tagName == "toolbaritem" || tagName == "toolbarbutton";

View File

@ -40,7 +40,6 @@
dot-location: 0, // [2, property],
"eqeqeq": 0, // TBD. Might need to be separate for content & chrome
"global-strict": 0, // Leave as zero (this will be unsupported in eslint 1.0.0)
"key-spacing": 0, // TODO: Remove (use default)
"linebreak-style": [2, "unix"],
"new-cap": 0, // TODO: Remove (use default)
"no-catch-shadow": 0, // TODO: Remove (use default)
@ -53,13 +52,11 @@
"no-redeclare": 0, // TODO: Remove (use default)
"no-return-assign": 0, // TODO: Remove (use default)
"no-shadow": 0, // TODO: Remove (use default)
"no-spaced-func": 0, // TODO: Remove (use default)
"no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
"no-unneeded-ternary": 2,
"no-unused-expressions": 0, // TODO: Remove (use default)
"no-unused-vars": 0, // TODO: Remove (use default)
"no-use-before-define": 0, // TODO: Remove (use default)
"no-wrap-func": 0, // TODO: Remove (use default)
"quotes": [2, "double", "avoid-escape"],
"strict": 0, // [2, "function"],
// eslint-plugin-react rules. These are documented at

View File

@ -27,13 +27,13 @@ loop.store = loop.store || {};
* @type {Object}
*/
var roomSchema = {
roomToken: String,
roomUrl: String,
// roomName: String - Optional.
// roomKey: String - Optional.
maxSize: Number,
roomToken: String,
roomUrl: String,
// roomName: String - Optional.
// roomKey: String - Optional.
maxSize: Number,
participants: Array,
ctime: Number
ctime: Number
};
/**
@ -263,10 +263,10 @@ loop.store = loop.store || {};
var roomCreationData = {
decryptedContext: {
roomName: this._generateNewRoomName(actionData.nameTemplate)
roomName: this._generateNewRoomName(actionData.nameTemplate)
},
roomOwner: actionData.roomOwner,
maxSize: this.maxRoomCreationSize
maxSize: this.maxRoomCreationSize
};
if ("urls" in actionData) {

View File

@ -429,7 +429,7 @@ loop.store = loop.store || {};
this.mozLoop.rooms.create({
roomName: actionData.roomName,
roomOwner: actionData.roomOwner,
maxSize: loop.store.MAX_ROOM_CREATION_SIZE,
maxSize: loop.store.MAX_ROOM_CREATION_SIZE,
expiresIn: loop.store.DEFAULT_EXPIRES_IN
}, function(err, createdRoomData) {
if (err) {

View File

@ -90,10 +90,10 @@ loop.FeedbackAPIClient = (function($, _) {
*/
send: function(fields, cb) {
var req = $.ajax({
url: this.baseUrl,
method: "POST",
url: this.baseUrl,
method: "POST",
contentType: "application/json",
dataType: "json",
dataType: "json",
data: JSON.stringify(this._createPayload(fields))
});

View File

@ -54,8 +54,8 @@ loop.shared.views.FeedbackView = (function(l10n) {
var FeedbackForm = React.createClass({displayName: "FeedbackForm",
propTypes: {
feedbackStore: React.PropTypes.instanceOf(loop.store.FeedbackStore),
pending: React.PropTypes.bool,
reset: React.PropTypes.func
pending: React.PropTypes.bool,
reset: React.PropTypes.func
},
getInitialState: function() {
@ -70,9 +70,9 @@ loop.shared.views.FeedbackView = (function(l10n) {
return {
audio_quality: l10n.get("feedback_category_audio_quality"),
video_quality: l10n.get("feedback_category_video_quality"),
disconnected : l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing2"),
other: l10n.get("feedback_category_other2")
disconnected: l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing2"),
other: l10n.get("feedback_category_other2")
};
},

View File

@ -54,8 +54,8 @@ loop.shared.views.FeedbackView = (function(l10n) {
var FeedbackForm = React.createClass({
propTypes: {
feedbackStore: React.PropTypes.instanceOf(loop.store.FeedbackStore),
pending: React.PropTypes.bool,
reset: React.PropTypes.func
pending: React.PropTypes.bool,
reset: React.PropTypes.func
},
getInitialState: function() {
@ -70,9 +70,9 @@ loop.shared.views.FeedbackView = (function(l10n) {
return {
audio_quality: l10n.get("feedback_category_audio_quality"),
video_quality: l10n.get("feedback_category_video_quality"),
disconnected : l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing2"),
other: l10n.get("feedback_category_other2")
disconnected: l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing2"),
other: l10n.get("feedback_category_other2")
};
},

View File

@ -109,7 +109,7 @@ loop.store.FxOSActiveRoomStore = (function() {
return;
}
if (event.target.error.name !== "NO_PROVIDER") {
console.error ("Unexpected " + event.target.error.name);
console.error("Unexpected " + event.target.error.name);
return;
}
// We need to install the FxOS app.

View File

@ -12,26 +12,26 @@ loop.shared.models = (function(l10n) {
*/
var ConversationModel = Backbone.Model.extend({
defaults: {
connected: false, // Session connected flag
ongoing: false, // Ongoing call flag
callerId: undefined, // Loop caller id
loopToken: undefined, // Loop conversation token
sessionId: undefined, // OT session id
connected: false, // Session connected flag
ongoing: false, // Ongoing call flag
callerId: undefined, // Loop caller id
loopToken: undefined, // Loop conversation token
sessionId: undefined, // OT session id
sessionToken: undefined, // OT session token
sessionType: undefined, // Hawk session type
apiKey: undefined, // OT api key
windowId: undefined, // The window id
callId: undefined, // The callId on the server
progressURL: undefined, // The websocket url to use for progress
sessionType: undefined, // Hawk session type
apiKey: undefined, // OT api key
windowId: undefined, // The window id
callId: undefined, // The callId on the server
progressURL: undefined, // The websocket url to use for progress
websocketToken: undefined, // The token to use for websocket auth, this is
// stored as a hex string which is what the server
// requires.
callType: undefined, // The type of incoming call selected by
callType: undefined, // The type of incoming call selected by
// other peer ("audio" or "audio-video")
selectedCallType: "audio-video", // The selected type for the call that was
// initiated ("audio" or "audio-video")
callToken: undefined, // Incoming call token.
callUrl: undefined, // Incoming call url
callToken: undefined, // Incoming call token.
callUrl: undefined, // Incoming call url
// Used for blocking a call url
subscribedStream: false, // Used to indicate that a stream has been
// subscribed to
@ -134,11 +134,11 @@ loop.shared.models = (function(l10n) {
setOutgoingSessionData: function(sessionData) {
// Explicit property assignment to prevent later "surprises"
this.set({
sessionId: sessionData.sessionId,
sessionToken: sessionData.sessionToken,
apiKey: sessionData.apiKey,
callId: sessionData.callId,
progressURL: sessionData.progressURL,
sessionId: sessionData.sessionId,
sessionToken: sessionData.sessionToken,
apiKey: sessionData.apiKey,
callId: sessionData.callId,
progressURL: sessionData.progressURL,
websocketToken: sessionData.websocketToken.toString(16)
});
},
@ -151,18 +151,18 @@ loop.shared.models = (function(l10n) {
setIncomingSessionData: function(sessionData) {
// Explicit property assignment to prevent later "surprises"
this.set({
sessionId: sessionData.sessionId,
sessionToken: sessionData.sessionToken,
sessionType: sessionData.sessionType,
apiKey: sessionData.apiKey,
callId: sessionData.callId,
callerId: sessionData.callerId,
sessionId: sessionData.sessionId,
sessionToken: sessionData.sessionToken,
sessionType: sessionData.sessionType,
apiKey: sessionData.apiKey,
callId: sessionData.callId,
callerId: sessionData.callerId,
urlCreationDate: sessionData.urlCreationDate,
progressURL: sessionData.progressURL,
websocketToken: sessionData.websocketToken.toString(16),
callType: sessionData.callType || "audio-video",
callToken: sessionData.callToken,
callUrl: sessionData.callUrl
progressURL: sessionData.progressURL,
websocketToken: sessionData.websocketToken.toString(16),
callType: sessionData.callType || "audio-video",
callToken: sessionData.callToken,
callUrl: sessionData.callUrl
});
},

View File

@ -268,7 +268,7 @@ const batch = function(operation, data, callback) {
let processed = [];
if (!LoopContactsInternal.hasOwnProperty(operation) ||
typeof LoopContactsInternal[operation] != "function") {
callback(new Error ("LoopContactsInternal does not contain a '" +
callback(new Error("LoopContactsInternal does not contain a '" +
operation + "' method"));
return;
}

View File

@ -47,7 +47,7 @@ PushSocket.prototype = {
connect: function(pushUri, onMsg, onStart, onClose) {
if (!pushUri || !onMsg || !onStart || !onClose) {
throw new Error("PushSocket: missing required parameter(s):"
throw new Error("PushSocket: missing required parameter(s):" +
(pushUri ? "" : " pushUri") +
(onMsg ? "" : " onMsg") +
(onStart ? "" : " onStart") +

View File

@ -109,10 +109,10 @@ loop.StandaloneClient = (function($) {
}
var req = $.ajax({
url: this.settings.baseServerUrl + "/calls/" + loopToken,
method: "POST",
url: this.settings.baseServerUrl + "/calls/" + loopToken,
method: "POST",
contentType: "application/json",
dataType: "json",
dataType: "json",
data: JSON.stringify({callType: callType, channel: "standalone"})
});

View File

@ -77,8 +77,8 @@ loop.StandaloneMozLoop = (function(mozL10n) {
*/
get: function(roomToken, callback) {
var req = $.ajax({
url: this._baseServerUrl + "/rooms/" + roomToken,
method: "GET",
url: this._baseServerUrl + "/rooms/" + roomToken,
method: "GET",
contentType: "application/json",
beforeSend: function(xhr) {
if (this.sessionToken) {
@ -119,10 +119,10 @@ loop.StandaloneMozLoop = (function(mozL10n) {
_postToRoom: function(roomToken, sessionToken, roomData, expectedProps,
async, callback) {
var req = $.ajax({
url: this._baseServerUrl + "/rooms/" + roomToken,
method: "POST",
url: this._baseServerUrl + "/rooms/" + roomToken,
method: "POST",
contentType: "application/json",
dataType: "json",
dataType: "json",
data: JSON.stringify(roomData),
beforeSend: function(xhr) {
if (sessionToken) {

View File

@ -165,7 +165,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
request.onerror = (function(event) {
if (event.target.error.name !== "NO_PROVIDER") {
console.error ("Unexpected " + event.target.error.name);
console.error("Unexpected " + event.target.error.name);
this.trigger("session:error", "fxos_app_needed", {
fxosAppName: loop.config.fxosApp.name
});
@ -817,7 +817,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
*/
getMediaPrivs: function() {
this.setState({callStatus: "gumPrompt"});
multiplexGum.getPermsAndCacheMedia({audio:true, video:true},
multiplexGum.getPermsAndCacheMedia({audio: true, video: true},
function(localStream) {
this.props.conversation.gotMediaPrivs();
}.bind(this),

View File

@ -165,7 +165,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
request.onerror = (function(event) {
if (event.target.error.name !== "NO_PROVIDER") {
console.error ("Unexpected " + event.target.error.name);
console.error("Unexpected " + event.target.error.name);
this.trigger("session:error", "fxos_app_needed", {
fxosAppName: loop.config.fxosApp.name
});
@ -817,7 +817,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
*/
getMediaPrivs: function() {
this.setState({callStatus: "gumPrompt"});
multiplexGum.getPermsAndCacheMedia({audio:true, video:true},
multiplexGum.getPermsAndCacheMedia({audio: true, video: true},
function(localStream) {
this.props.conversation.gotMediaPrivs();
}.bind(this),

View File

@ -32,6 +32,6 @@ describe("document.mozL10n", function() {
});
it("should get a plural form", function() {
expect(document.mozL10n.get("plural", {num:10})).eql("10 plural forms");
expect(document.mozL10n.get("plural", {num: 10})).eql("10 plural forms");
});
});

View File

@ -169,7 +169,7 @@ describe("loop.store.RoomStore", function () {
});
describe("refresh", function() {
it ("should clear the list of rooms", function() {
it("should clear the list of rooms", function() {
fakeMozLoop.rooms.trigger("refresh", "refresh");
expect(store.getStoreState().rooms).to.have.length.of(0);
@ -322,7 +322,7 @@ describe("loop.store.RoomStore", function () {
});
it("should switch the pendingCreation state flag to false", function() {
store.setStoreState({pendingCreation:true});
store.setStoreState({pendingCreation: true});
store.createdRoom(new sharedActions.CreatedRoom({
roomToken: "fakeToken"
@ -347,7 +347,7 @@ describe("loop.store.RoomStore", function () {
describe("#createRoomError", function() {
it("should switch the pendingCreation state flag to false", function() {
store.setStoreState({pendingCreation:true});
store.setStoreState({pendingCreation: true});
store.createRoomError({
error: new Error("fake")

View File

@ -170,7 +170,7 @@ const monkeyPatchImporter = function(importer) {
add_task(function* test_CardDavImport() {
let importer = monkeyPatchImporter(new CardDavImporter());
yield new Promise ((resolve, reject) => {
yield new Promise((resolve, reject) => {
info("Initiating import");
importer.startImport({
"host": "example.com",
@ -265,7 +265,7 @@ add_task(function* test_CardDavImport() {
Assert.equal(c.name[0], "anyone@example.com", "Full name should be synthesized correctly");
// Check that a re-import doesn't cause contact duplication.
yield new Promise ((resolve, reject) => {
yield new Promise((resolve, reject) => {
info("Initiating import");
importer.startImport({
"host": "example.com",
@ -278,7 +278,7 @@ add_task(function* test_CardDavImport() {
"Second import shouldn't increase DB size");
// Check that errors are propagated back to caller
let error = yield new Promise ((resolve, reject) => {
let error = yield new Promise((resolve, reject) => {
info("Initiating import");
importer.startImport({
"host": "example.com",
@ -289,7 +289,7 @@ add_task(function* test_CardDavImport() {
});
Assert.equal(error.message, "401 Auth Failure", "Auth error should propagate");
error = yield new Promise ((resolve, reject) => {
error = yield new Promise((resolve, reject) => {
info("Initiating import");
importer.startImport({
"host": "example.invalid",
@ -304,7 +304,7 @@ add_task(function* test_CardDavImport() {
mockDb.getByServiceId = function(serviceId, callback) {
callback(new Error("getByServiceId failed"));
};
error = yield new Promise ((resolve, reject) => {
error = yield new Promise((resolve, reject) => {
info("Initiating import");
importer.startImport({
"host": "example.com",
@ -316,7 +316,7 @@ add_task(function* test_CardDavImport() {
Assert.equal(error.message, "getByServiceId failed", "Database error should propagate");
mockDb.getByServiceId = tmp;
error = yield new Promise ((resolve, reject) => {
error = yield new Promise((resolve, reject) => {
info("Initiating import");
importer.startImport({
"host": "example.com"

View File

@ -20,14 +20,14 @@ describe("loop.shared.models", function() {
requests.push(xhr);
};
fakeSessionData = {
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
callType: "callType",
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
callType: "callType",
websocketToken: 123,
callToken: "callToken",
callUrl: "http://invalid/callToken",
callerId: "mrssmith"
callToken: "callToken",
callUrl: "http://invalid/callToken",
callerId: "mrssmith"
};
fakeSession = _.extend({
connect: function () {},

View File

@ -375,9 +375,9 @@ describe("loop.shared.views", function() {
sandbox.stub(window, "Audio").returns(fakeAudio);
fakeSessionData = {
sessionId: "sessionId",
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey"
apiKey: "apiKey"
};
fakeSession = _.extend({
connection: {connectionId: 42},

View File

@ -129,11 +129,11 @@ describe("loop.webapp", function() {
describe("#_setupWebSocket", function() {
beforeEach(function() {
conversation.setOutgoingSessionData({
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
callId: "Hello",
progressURL: "http://invalid/url",
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
callId: "Hello",
progressURL: "http://invalid/url",
websocketToken: 123
});
});
@ -203,11 +203,11 @@ describe("loop.webapp", function() {
describe("Websocket Events", function() {
beforeEach(function() {
conversation.setOutgoingSessionData({
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
callId: "Hello",
progressURL: "http://progress.example.com",
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
callId: "Hello",
progressURL: "http://progress.example.com",
websocketToken: 123
});
@ -298,12 +298,12 @@ describe("loop.webapp", function() {
beforeEach(function() {
fakeSessionData = {
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
sessionId: "sessionId",
sessionToken: "sessionToken",
apiKey: "apiKey",
websocketToken: 123,
progressURL: "fakeUrl",
callId: "fakeCallId"
progressURL: "fakeUrl",
callId: "fakeCallId"
};
conversation.set(fakeSessionData);
conversation.set("loopToken", "fakeToken");

View File

@ -55,9 +55,9 @@ function run_test() {
// Setup fake login state so we get FxA requests.
const MozLoopServiceInternal = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}).MozLoopServiceInternal;
MozLoopServiceInternal.fxAOAuthTokenData = {
token_type:"bearer",
access_token:"1bad3e44b12f77a88fe09f016f6a37c42e40f974bc7a8b432bb0d2f0e37e1752",
scope:"profile"
token_type: "bearer",
access_token: "1bad3e44b12f77a88fe09f016f6a37c42e40f974bc7a8b432bb0d2f0e37e1752",
scope: "profile"
};
MozLoopServiceInternal.fxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"};

View File

@ -535,7 +535,7 @@
React.createElement(Section, {name: "ConversationView-640"},
React.createElement(Example, {summary: "640px breakpoint for conversation view"},
React.createElement("div", {className: "breakpoint",
style: {"text-align":"center"},
style: {"text-align": "center"},
"data-breakpoint-width": "400px",
"data-breakpoint-height": "780px"},
React.createElement("div", {className: "standalone"},

View File

@ -535,7 +535,7 @@
<Section name="ConversationView-640">
<Example summary="640px breakpoint for conversation view">
<div className="breakpoint"
style={{"text-align":"center"}}
style={{"text-align": "center"}}
data-breakpoint-width="400px"
data-breakpoint-height="780px">
<div className="standalone">

View File

@ -8,7 +8,7 @@
body {
display: flex;
box-sizing: padding-box;
box-sizing: border-box;
min-height: 100vh;
padding: 0 48px;
align-items: center;

View File

@ -21,6 +21,13 @@ XPCOMUtils.defineLazyGetter(this, "reporter", () => {
.healthReporter;
});
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryArchive",
"resource://gre/modules/TelemetryArchive.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
"resource://gre/modules/TelemetryEnvironment.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryController",
"resource://gre/modules/TelemetryController.jsm");
function MozSelfSupportInterface() {
}
@ -73,6 +80,29 @@ MozSelfSupportInterface.prototype = {
Services.search.restoreDefaultEngines();
Services.search.resetToOriginalDefaultEngine();
},
getTelemetryPingList: function() {
return this._wrapPromise(TelemetryArchive.promiseArchivedPingList());
},
getTelemetryPing: function(pingId) {
return this._wrapPromise(TelemetryArchive.promiseArchivedPingById(pingId));
},
getCurrentTelemetryEnvironment: function() {
const current = TelemetryEnvironment.currentEnvironment;
return new this._window.Promise(resolve => resolve(current));
},
getCurrentTelemetrySubsessionPing: function() {
const current = TelemetryController.getCurrentPingData(true);
return new this._window.Promise(resolve => resolve(current));
},
_wrapPromise: function(promise) {
return new this._window.Promise(
(resolve, reject) => promise.then(resolve, reject));
},
}
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MozSelfSupportInterface]);

View File

@ -136,7 +136,11 @@ ContentRestoreInternal.prototype = {
SessionHistory.restore(this.docShell, tabData);
// Add a listener to watch for reloads.
let listener = new HistoryListener(this.docShell, callbacks.onReload);
let listener = new HistoryListener(this.docShell, () => {
// On reload, restore tab contents.
this.restoreTabContent(null, callbacks.onLoadFinished);
});
webNavigation.sessionHistory.addSHistoryListener(listener);
this._historyListener = listener;
@ -193,11 +197,6 @@ ContentRestoreInternal.prototype = {
if (loadArguments) {
// A load has been redirected to a new process so get history into the
// same state it was before the load started then trigger the load.
let activeIndex = tabData.index - 1;
if (activeIndex > 0) {
// Go to the right history entry, but don't load anything yet.
history.getEntryAtIndex(activeIndex, true);
}
let referrer = loadArguments.referrer ?
Utils.makeURI(loadArguments.referrer) : null;
let referrerPolicy = ('referrerPolicy' in loadArguments
@ -210,12 +209,6 @@ ContentRestoreInternal.prototype = {
// If the user typed a URL into the URL bar and hit enter right before
// we crashed, we want to start loading that page again. A non-zero
// userTypedClear value means that the load had started.
let activeIndex = tabData.index - 1;
if (activeIndex > 0) {
// Go to the right history entry, but don't load anything yet.
history.getEntryAtIndex(activeIndex, true);
}
// Load userTypedValue and fix up the URL if it's partial/broken.
webNavigation.loadURI(tabData.userTypedValue,
Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP,
@ -231,7 +224,6 @@ ContentRestoreInternal.prototype = {
// In order to work around certain issues in session history, we need to
// force session history to update its internal index and call reload
// instead of gotoIndex. See bug 597315.
history.getEntryAtIndex(activeIndex, true);
history.reloadCurrentEntry();
} else {
// If there's nothing to restore, we should still blank the page.

View File

@ -265,6 +265,12 @@ let SessionHistoryInternal = {
let persist = "persist" in entry ? entry.persist : true;
history.addEntry(this.deserializeEntry(entry, idMap, docIdentMap), persist);
}
// Select the right history entry.
let index = tabData.index - 1;
if (index < history.count && history.index != index) {
history.getEntryAtIndex(index, true);
}
},
/**

View File

@ -66,10 +66,6 @@ const MESSAGES = [
// SSTabRestored at this time.
"SessionStore:restoreTabContentComplete",
// A tab that is being restored was reloaded. We call restoreTabContent to
// finish restoring it right away.
"SessionStore:reloadPendingTab",
// A crashed tab was revived by navigating to a different page. Remove its
// browser from the list of crashed browsers to stop ignoring its messages.
"SessionStore:crashedTabRevived",
@ -769,11 +765,6 @@ let SessionStoreInternal = {
this._sendTabRestoredNotification(tab);
break;
case "SessionStore:reloadPendingTab":
if (browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE) {
this.restoreTabContent(tab);
}
break;
case "SessionStore:crashedTabRevived":
this._crashedBrowsers.delete(browser.permanentKey);
break;

View File

@ -149,15 +149,10 @@ let MessageListener = {
restoreHistory({epoch, tabData, loadArguments}) {
gContentRestore.restoreHistory(tabData, loadArguments, {
onReload() {
// Inform SessionStore.jsm about the reload. It will send
// restoreTabContent in response.
sendAsyncMessage("SessionStore:reloadPendingTab", {epoch});
},
// Note: The two callbacks passed here will only be used when a load
// starts that was not initiated by sessionstore itself. This can happen
// when some code calls browser.loadURI() on a pending browser/tab.
// Note: The callbacks passed here will only be used when a load starts
// that was not initiated by sessionstore itself. This can happen when
// some code calls browser.loadURI() or browser.reload() on a pending
// browser/tab.
onLoadStarted() {
// Notify the parent that the tab is no longer pending.

View File

@ -94,6 +94,7 @@ skip-if = buildapp == 'mulet'
[browser_merge_closed_tabs.js]
[browser_page_title.js]
[browser_pageStyle.js]
[browser_pending_tabs.js]
[browser_privatetabs.js]
[browser_replace_load.js]
[browser_restore_redirect.js]

View File

@ -11,7 +11,7 @@ function test() {
windows: [{
tabs: [{
entries: [
{ url: "http://www.mozilla.org/projects/minefield/", title: "Minefield Start Page" },
{ url: "about:mozilla", title: "Mozilla" },
{}
]
}]

View File

@ -56,12 +56,8 @@ add_task(function flush_on_duplicate() {
let tab2 = ss.duplicateTab(window, tab);
yield promiseTabRestored(tab2);
let {storage} = JSON.parse(ss.getTabState(tab2));
is(storage["http://example.com"].test, "on-duplicate",
"sessionStorage data has been flushed when duplicating tabs");
yield promiseRemoveTab(tab2);
[{state: {storage}}] = JSON.parse(ss.getClosedTabData(window));
let [{state: {storage}}] = JSON.parse(ss.getClosedTabData(window));
is(storage["http://example.com"].test, "on-duplicate",
"sessionStorage data has been flushed when duplicating tabs");

View File

@ -0,0 +1,32 @@
"use strict";
const TAB_STATE = {
entries: [{ url: "about:mozilla" }, { url: "about:robots" }],
index: 1,
};
add_task(function* () {
// Create a background tab.
let tab = gBrowser.addTab("about:blank");
let browser = tab.linkedBrowser;
yield promiseBrowserLoaded(browser);
// The tab shouldn't be restored right away.
Services.prefs.setBoolPref("browser.sessionstore.restore_on_demand", true);
// Prepare the tab state.
let promise = promiseTabRestoring(tab);
ss.setTabState(tab, JSON.stringify(TAB_STATE));
ok(tab.hasAttribute("pending"), "tab is pending");
yield promise;
// Flush to ensure the parent has all data.
yield TabStateFlusher.flush(browser);
// Check that the shistory index is the one we restored.
let tabState = TabState.collect(tab);
is(tabState.index, TAB_STATE.index, "correct shistory index");
// Cleanup.
gBrowser.removeTab(tab);
});

View File

@ -164,6 +164,13 @@ add_task(function respect_privacy_level() {
[{state: {storage}}] = JSON.parse(ss.getClosedTabData(window));
ok(!storage, "sessionStorage data has *not* been saved");
// Remove all closed tabs before continuing with the next test.
// As Date.now() isn't monotonic we might sometimes check
// the wrong closedTabData entry.
while (ss.getClosedTabCount(window) > 0) {
ss.forgetClosedTab(window, 0);
}
// Restore the default privacy level and close the duplicated tab.
Services.prefs.clearUserPref("browser.sessionstore.privacy_level");
yield promiseRemoveTab(tab2);

View File

@ -50,9 +50,8 @@
// Don't require a default case in switch statements. Avoid being forced to
// add a bogus default when you know all possible cases are handled.
"default-case": 0,
// Don't enforce consistent newlines before or after dots. This depends on
// what gives the most readable code.
"dot-location": [1, "object"],
// Enforce dots on the next line with property name.
"dot-location": [1, "property"],
// Encourage the use of dot notation whenever possible.
"dot-notation": 2,
// Enforce newline at the end of file, with no multiple empty lines.

View File

@ -34,7 +34,7 @@ function test() {
yield ensureThreadClientState(aPanel, "resumed");
let paused = waitForCaretAndScopes(aPanel, 48);
sendMouseClickToTab(gTab, content.document.body);
generateMouseClickInTab(gTab, "content.document.body");
yield paused;
yield ensureThreadClientState(aPanel, "paused");

View File

@ -96,7 +96,7 @@ function test() {
ok(isCaretPos(gPanel, 9),
"The editor location is correct before pausing.");
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return finished;
}

View File

@ -54,7 +54,7 @@ function testResume() {
});
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -22,7 +22,7 @@ function test() {
});
function testClosure() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES).then(() => {
let gVars = gDebugger.DebuggerView.Variables;

View File

@ -49,7 +49,7 @@ function pauseDebuggee(aThreadClient) {
deferred.resolve(aThreadClient);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return deferred.promise;
}

View File

@ -50,7 +50,7 @@ function pauseDebuggee(aThreadClient) {
deferred.resolve(aThreadClient);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return deferred.promise;
}

View File

@ -50,7 +50,7 @@ function pauseDebuggee(aThreadClient) {
deferred.resolve(aThreadClient);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return deferred.promise;
}

View File

@ -43,7 +43,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function testHitCounts() {

View File

@ -45,7 +45,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function testHitCountsBeforeStopping() {

View File

@ -19,7 +19,7 @@ function test() {
// Spin the event loop before causing the debuggee to pause, to allow
// this function to return first.
sendMouseClickToTab(tab, content.document.querySelector("button"));
generateMouseClickInTab(tab, "content.document.querySelector('button')");
yield waitForDebuggerEvents(panel, gDebugger.EVENTS.FETCHED_SCOPES);
let gVars = gDebugger.DebuggerView.Variables;

View File

@ -77,7 +77,7 @@ function testPauseOnExceptionsDisabled() {
return finished;
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return finished;
}
@ -148,7 +148,7 @@ function testPauseOnExceptionsEnabled() {
return finished;
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return finished;
}

View File

@ -104,7 +104,7 @@ function testPauseOnExceptionsAfterReload() {
return finished;
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
return finished;
}

View File

@ -40,7 +40,7 @@ function testNormalReturn() {
gDebugger);
});
sendMouseClickToTab(gTab, content.document.getElementById("return"));
generateMouseClickInTab(gTab, "content.document.getElementById('return')");
}
function testReturnWithException() {
@ -62,7 +62,7 @@ function testReturnWithException() {
gDebugger);
});
sendMouseClickToTab(gTab, content.document.getElementById("throw"));
generateMouseClickInTab(gTab, "content.document.getElementById('throw')");
}
function resumeDebuggee() {

View File

@ -36,7 +36,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function testTraceLogs() {

View File

@ -39,7 +39,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function highlightCall() {

View File

@ -50,7 +50,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function clickTraceLog() {

View File

@ -40,7 +40,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function clickTraceCall() {

View File

@ -69,7 +69,7 @@ function testNoEmptyText() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
registerCleanupFunction(function() {

View File

@ -60,7 +60,7 @@ function test() {
}
function clickButton() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
}
function pushPref() {

View File

@ -114,7 +114,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -35,7 +35,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -37,7 +37,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -36,7 +36,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -36,7 +36,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -35,7 +35,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -36,7 +36,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -35,7 +35,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -29,7 +29,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -34,7 +34,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -31,7 +31,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -33,7 +33,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -28,7 +28,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -44,7 +44,7 @@ function addBreakpoint() {
}
function pauseDebuggee() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
// The first 'with' scope should be expanded by default, but the
// variables haven't been fetched yet. This is how 'with' scopes work.

View File

@ -45,7 +45,7 @@ function addBreakpoint() {
}
function pauseDebuggee() {
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
// The first 'with' scope should be expanded by default, but the
// variables haven't been fetched yet. This is how 'with' scopes work.

View File

@ -29,7 +29,7 @@ function test() {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
sendMouseClickToTab(gTab, content.document.querySelector("button"));
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
});
}

View File

@ -9,59 +9,77 @@ loadSubScript("chrome://marionette/content/EventUtils.js", EventUtils);
dump("Frame script loaded.\n");
addMessageListener("test:call", function (message) {
dump("Calling function with name " + message.data.name + ".\n");
let data = message.data;
let result = XPCNativeWrapper.unwrap(content)[data.name].apply(undefined, data.args);
if (result && result.then) {
result.then(() => {
sendAsyncMessage("test:call");
});
} else {
sendAsyncMessage("test:call");
}
});
addMessageListener("test:click", function (message) {
dump("Sending mouse click.\n");
let target = message.objects.target;
EventUtils.synthesizeMouseAtCenter(target, {},
target.ownerDocument.defaultView);
});
addMessageListener("test:eval", function (message) {
dump("Evalling string " + message.data.string + ".\n");
let result = content.eval(message.data.string);
if (result.then) {
result.then(() => {
sendAsyncMessage("test:eval");
});
} else {
sendAsyncMessage("test:eval");
}
});
let workers = {}
addMessageListener("test:createWorker", function (message) {
dump("Creating worker with url '" + message.data.url + "'.\n");
this.call = function (name, args) {
dump("Calling function with name " + name + ".\n");
let url = message.data.url;
let worker = new content.Worker(message.data.url);
worker.addEventListener("message", function listener() {
worker.removeEventListener("message", listener);
sendAsyncMessage("test:createWorker");
dump("args " + JSON.stringify(args) + "\n");
return XPCNativeWrapper.unwrap(content)[name].apply(undefined, args);
};
this._eval = function (string) {
dump("Evalling string.\n");
return content.eval(string);
};
this.generateMouseClick = function (path) {
dump("Generating mouse click.\n");
let target = eval(path);
EventUtils.synthesizeMouseAtCenter(target, {},
target.ownerDocument.defaultView);
};
this.createWorker = function (url) {
dump("Creating worker with url '" + url + "'.\n");
return new Promise(function (resolve, reject) {
let worker = new content.Worker(url);
worker.addEventListener("message", function listener() {
worker.removeEventListener("message", listener);
workers[url] = worker;
resolve();
});
});
workers[url] = worker;
});
};
addMessageListener("test:terminateWorker", function (message) {
dump("Terminating worker with url '" + message.data.url + "'.\n");
this.terminateWorker = function (url) {
dump("Terminating worker with url '" + url + "'.\n");
let url = message.data.url;
workers[url].terminate();
delete workers[url];
};
this.postMessageToWorker = function (url, message) {
dump("Posting message to worker with url '" + url + "'.\n");
return new Promise(function (resolve) {
let worker = workers[url];
worker.postMessage(message);
worker.addEventListener("message", function listener() {
worker.removeEventListener("message", listener);
resolve();
});
});
};
addMessageListener("jsonrpc", function ({ data: { method, params, id } }) {
method = this[method];
Promise.resolve().then(function () {
return method.apply(undefined, params);
}).then(function (result) {
sendAsyncMessage("jsonrpc", {
result: result,
error: null,
id: id
});
}, function (error) {
sendAsyncMessage("jsonrpc", {
result: null,
error: error.message.toString(),
id: id
});
});
});

View File

@ -959,51 +959,6 @@ function popPrefs() {
return deferred.promise;
}
function sendMessageToTab(tab, name, data, objects) {
info("Sending message with name " + name + " to tab.");
tab.linkedBrowser.messageManager.sendAsyncMessage(name, data, objects);
}
function waitForMessageFromTab(tab, name) {
info("Waiting for message with name " + name + " from tab.");
return new Promise(function (resolve) {
let messageManager = tab.linkedBrowser.messageManager;
messageManager.addMessageListener(name, function listener(message) {
messageManager.removeMessageListener(name, listener);
resolve(message);
});
});
}
function callInTab(tab, name) {
info("Calling function with name " + name + " in tab.");
sendMessageToTab(tab, "test:call", {
name: name,
args: Array.prototype.slice.call(arguments, 2)
});
return waitForMessageFromTab(tab, "test:call");
}
function evalInTab(tab, string) {
info("Evalling string " + string + " in tab.");
sendMessageToTab(tab, "test:eval", {
string: string,
});
return waitForMessageFromTab(tab, "test:eval");
}
function sendMouseClickToTab(tab, target) {
info("Sending mouse click to tab.");
sendMessageToTab(tab, "test:click", undefined, {
target: target
});
}
// Source helpers
function getSelectedSourceURL(aSources) {
@ -1026,22 +981,68 @@ function getSourceForm(aSources, aURL) {
return item.attachment.source;
}
let nextId = 0;
function jsonrpc(tab, method, params) {
return new Promise(function (resolve, reject) {
let currentId = nextId++;
let messageManager = tab.linkedBrowser.messageManager;
messageManager.sendAsyncMessage("jsonrpc", {
method: method,
params: params,
id: currentId
});
messageManager.addMessageListener("jsonrpc", function listener({
data: { result, error, id }
}) {
if (id !== currentId) {
return;
}
messageManager.removeMessageListener("jsonrpc", listener);
if (error != null) {
reject(error);
}
resolve(result);
});
});
}
function callInTab(tab, name) {
info("Calling function with name '" + name + "' in tab.");
return jsonrpc(tab, "call", [name, Array.prototype.slice.call(arguments, 2)]);
}
function evalInTab(tab, string) {
info("Evalling string in tab.");
return jsonrpc(tab, "_eval", [string]);
}
function createWorkerInTab(tab, url) {
info("Creating worker with url '" + url + "' in tab.");
sendMessageToTab(tab, "test:createWorker", {
url: url
});
return waitForMessageFromTab(tab, "test:createWorker");
return jsonrpc(tab, "createWorker", [url]);
}
function terminateWorkerInTab(tab, url) {
info("Terminating worker with url '" + url + "' in tab.");
sendMessageToTab(tab, "test:terminateWorker", {
url: url
});
return waitForMessageFromTab(tab, "test:terminateWorker");
return jsonrpc(tab, "terminateWorker", [url]);
}
function postMessageToWorkerInTab(tab, url, message) {
info("Posting message to worker with url '" + url + "' in tab.");
return jsonrpc(tab, "postMessageToWorker", [url, message]);
}
function generateMouseClickInTab(tab, path) {
info("Generating mouse click in tab.");
return jsonrpc(tab, "generateMouseClick", [path]);
}
function connect(client) {

View File

@ -92,6 +92,9 @@
key="&largerFont.commandkey;"
command="sp-cmd-larger-font"
modifiers="accel"/>
<key key="&largerFont.commandkey2;"
command="sp-cmd-larger-font"
modifiers="accel"/>
<key id="sp-key-smaller-font"
key="&smallerFont.commandkey;"
command="sp-cmd-smaller-font"

View File

@ -16,14 +16,18 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>',
'<span class="testclass2">This is a span</span>',
'<span class="class1 class2">Multiple classes</span>',
'<p>Empty<p>'
'<p>Empty<p>',
'<h1 class="asd@@@@a!!!!:::@asd">Invalid characters in class</h1>',
'<h2 id="asd@@@a!!2a">Invalid characters in id</h2>'
].join("\n");
const TEST_DATA = [
{ node: "#testid", expected: "#testid" },
{ node: ".testclass2", expected: ".testclass2" },
{ node: ".class1.class2", expected: ".class1.class2" },
{ node: "p", expected: "p" }
{ node: "p", expected: "p" },
{ node: "h1", expected: ".asd\\@\\@\\@\\@a\\!\\!\\!\\!\\:\\:\\:\\@asd" },
{ node: "h2", expected: "#asd\\@\\@\\@a\\!\\!2a" }
];
add_task(function*() {

View File

@ -3160,6 +3160,12 @@ Widgets.ObjectRenderers.add({
"message was got cleared away");
}
// Check it again as this method is async!
if (this._linkedToInspector) {
return;
}
this._linkedToInspector = true;
this.highlightDomNode = this.highlightDomNode.bind(this);
this.element.addEventListener("mouseover", this.highlightDomNode, false);
this.unhighlightDomNode = this.unhighlightDomNode.bind(this);
@ -3170,8 +3176,6 @@ Widgets.ObjectRenderers.add({
onClick: this.openNodeInInspector.bind(this)
});
this._openInspectorNode.title = l10n.getStr("openNodeInInspector");
this._linkedToInspector = true;
}),
/**

View File

@ -62,11 +62,13 @@ function test() {
let onInspectorSelected = toolbox.once("inspector-selected");
let onInspectorUpdated = inspector.once("inspector-updated");
let onNewNode = toolbox.selection.once("new-node-front");
let onNodeHighlight = toolbox.once("node-highlight");
EventUtils.synthesizeMouseAtCenter(inspectorIcon, {},
inspectorIcon.ownerDocument.defaultView);
yield onInspectorSelected;
yield onInspectorUpdated;
yield onNodeHighlight;
let nodeFront = yield onNewNode;
ok(true, "Inspector selected and new node got selected");
@ -79,6 +81,13 @@ function test() {
is(attrs[i].value, data.attrs[i].value, "The correct node was highlighted");
}
info("Unhighlight the node by moving away from the markup view");
let onNodeUnhighlight = toolbox.once("node-unhighlight");
let btn = inspector.toolbox.doc.querySelector(".toolbox-dock-button");
EventUtils.synthesizeMouseAtCenter(btn, {type: "mousemove"},
inspector.toolbox.doc.defaultView);
yield onNodeUnhighlight;
info("Switching back to the console");
yield toolbox.selectTool("webconsole");
}

View File

@ -33,6 +33,9 @@
preferences/options item on about:home on Linux and OS X -->
<!ENTITY abouthome.preferencesButtonUnix.label "Preferences">
<!ENTITY abouthome.addonsButton.label "Add-ons">
<!ENTITY abouthome.appsButton.label "Marketplace">
<!-- LOCALIZATION NOTE (abouthome.appsButton2.label): This string should be consistent with
the Apps menu item in the Tools menu (webapps.label in browser.dtd) and the Apps toolbar button in
Firefox's customization palette (web-apps-button.label in customizableWidgets.properties) -->
<!ENTITY abouthome.appsButton2.label "Apps">
<!ENTITY abouthome.downloadsButton.label "Downloads">
<!ENTITY abouthome.syncButton.label "&syncBrand.shortName.label;">

View File

@ -65,6 +65,7 @@
<!ENTITY largerFont.label "Larger Font">
<!ENTITY largerFont.accesskey "a">
<!ENTITY largerFont.commandkey "+">
<!ENTITY largerFont.commandkey2 "="> <!-- + is above this key on many keyboards -->
<!ENTITY smallerFont.label "Smaller Font">
<!ENTITY smallerFont.accesskey "M">

View File

@ -168,7 +168,7 @@ searchbar[oneoffui] .search-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon
}
.searchbar-engine-one-off-item:not(.last-row) {
box-sizing: padding-box;
box-sizing: content-box;
border-bottom: 1px solid #ccc;
}

View File

@ -191,7 +191,7 @@ searchbar[oneoffui] .search-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon
}
.searchbar-engine-one-off-item:not(.last-row) {
box-sizing: padding-box;
box-sizing: content-box;
border-bottom: 1px solid #ccc;
}

View File

@ -6,7 +6,7 @@
body {
display: flex;
box-sizing: padding-box;
box-sizing: border-box;
min-height: 100vh;
padding: 0 48px;
align-items: center;

Some files were not shown because too many files have changed in this diff Show More