Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | # Integrates the xpcshell test runner with mach. |
michael@0 | 6 | |
michael@0 | 7 | import os |
michael@0 | 8 | import sys |
michael@0 | 9 | |
michael@0 | 10 | from mozbuild.base import ( |
michael@0 | 11 | MachCommandBase, |
michael@0 | 12 | MozbuildObject, |
michael@0 | 13 | ) |
michael@0 | 14 | |
michael@0 | 15 | from mach.decorators import ( |
michael@0 | 16 | CommandArgument, |
michael@0 | 17 | CommandProvider, |
michael@0 | 18 | Command, |
michael@0 | 19 | ) |
michael@0 | 20 | |
michael@0 | 21 | class JetpackRunner(MozbuildObject): |
michael@0 | 22 | """Run jetpack tests.""" |
michael@0 | 23 | def run_tests(self, **kwargs): |
michael@0 | 24 | self._run_make(target='jetpack-tests') |
michael@0 | 25 | |
michael@0 | 26 | @CommandProvider |
michael@0 | 27 | class MachCommands(MachCommandBase): |
michael@0 | 28 | @Command('jetpack-test', category='testing', |
michael@0 | 29 | description='Runs the jetpack test suite.') |
michael@0 | 30 | def run_jetpack_test(self, **params): |
michael@0 | 31 | # We should probably have a utility function to ensure the tree is |
michael@0 | 32 | # ready to run tests. Until then, we just create the state dir (in |
michael@0 | 33 | # case the tree wasn't built with mach). |
michael@0 | 34 | self._ensure_state_subdir_exists('.') |
michael@0 | 35 | |
michael@0 | 36 | jetpack = self._spawn(JetpackRunner) |
michael@0 | 37 | |
michael@0 | 38 | jetpack.run_tests(**params) |