dom/bindings/mach_commands.py

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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 from __future__ import unicode_literals
michael@0 6
michael@0 7 import os
michael@0 8 import sys
michael@0 9
michael@0 10 from mach.decorators import (
michael@0 11 CommandArgument,
michael@0 12 CommandProvider,
michael@0 13 Command,
michael@0 14 )
michael@0 15
michael@0 16 from mozbuild.base import MachCommandBase
michael@0 17
michael@0 18
michael@0 19 @CommandProvider
michael@0 20 class WebIDLProvider(MachCommandBase):
michael@0 21 @Command('webidl-example', category='misc',
michael@0 22 description='Generate example files for a WebIDL interface.')
michael@0 23 @CommandArgument('interface', nargs='+',
michael@0 24 help='Interface(s) whose examples to generate.')
michael@0 25 def webidl_example(self, interface):
michael@0 26 from mozwebidlcodegen import BuildSystemWebIDL
michael@0 27
michael@0 28 manager = self._spawn(BuildSystemWebIDL).manager
michael@0 29 for i in interface:
michael@0 30 manager.generate_example_files(i)
michael@0 31
michael@0 32 @Command('webidl-parser-test', category='testing',
michael@0 33 description='Run WebIDL tests.')
michael@0 34 @CommandArgument('--verbose', '-v', action='store_true',
michael@0 35 help='Run tests in verbose mode.')
michael@0 36 def webidl_test(self, verbose=False):
michael@0 37 sys.path.insert(0, os.path.join(self.topsrcdir, 'other-licenses',
michael@0 38 'ply'))
michael@0 39
michael@0 40 from runtests import run_tests
michael@0 41 return run_tests(None, verbose=verbose)

mercurial