Searched refs:self (Results 1 - 25 of 114) sorted by relevance

12345

/system/extras/tests/bootloader/
H A Dbootctl.py16 def __init__(self, device):
17 self.device = device
18 self.base = ["bootctl"]
20 def _exec(self, cmd):
21 return self.device.shell_nocheck(self.base + [cmd])
23 def get_number_slots(self):
26 return int(self._exec("get-number-slots")[1])
28 def get_current_slot(self):
31 return int(self
[all...]
H A Dhaltest.py23 def __init__(self, *args, **kwargs):
24 super(HalTest, self).__init__(*args, **kwargs)
25 self.bootctl = bootctl.Bootctl(self.device)
27 def test_slots(self):
30 self.device.root()
31 self.device.wait()
32 num_slots = self.bootctl.get_number_slots()
35 suffix = self.bootctl.get_suffix(slot)
36 self
[all...]
H A Dbootloadertest.py31 def exists_validvals(self, varname, varlist, validlist):
32 self.assertIn(varname, varlist)
33 self.assertIn(varlist[varname], validlist)
36 def exists_yes_no(self, varname, varlist):
37 return self.exists_validvals(varname, varlist, ["yes", "no"])
39 def exists_nonempty(self, varname, varlist):
40 self.assertIn(varname, varlist)
41 self.assertGreater(len(varlist[varname]), 0)
44 def exists_integer(self, varname, varlist, base=10):
46 self
[all...]
H A Dshelltest.py20 def __init__(self, *args, **kwargs):
21 super(ShellTest, self).__init__(*args, **kwargs)
22 self.device = adb.get_device(os.getenv("BOOTLOADER_TEST_SERIAL"));
/system/extras/simpleperf/scripts/
H A Dsimpleperf_report_lib.py88 def __init__(self, sample):
89 self.ip = sample.ip
90 self.pid = sample.pid
91 self.tid = sample.tid
92 self.thread_comm = _char_pt_to_str(sample.thread_comm)
93 self.time = sample.time
94 self.in_kernel = sample.in_kernel
95 self.cpu = sample.cpu
96 self.period = sample.period
100 def __init__(self, even
[all...]
H A Dapp_profiler.py45 def __init__(self, config):
46 self.check_config(config)
47 self.config = config
48 self.adb = AdbHelper()
49 self.is_root_device = False
50 self.android_version = 0
51 self.device_arch = None
52 self.app_arch = None
53 self.app_pid = None
56 def check_config(self, confi
[all...]
H A Dpprof_proto_generator.py56 def __init__(self, profile):
57 self.profile = profile
58 self.string_table = profile.string_table
60 def show(self):
61 p = self.profile
67 self.show_value_type(p.sample_type[i])
71 self.show_sample(p.sample[i], sub_space)
75 self.show_mapping(p.mapping[i], sub_space)
79 self.show_location(p.location[i], sub_space)
82 self
[all...]
H A Dbinary_cache_builder.py38 def __init__(self, config):
44 self.perf_data_path = config.get('perf_data_path')
45 if not os.path.isfile(self.perf_data_path):
46 log_exit("can't find file %s" % self.perf_data_path)
47 self.symfs_dirs = config.get('symfs_dirs')
48 for symfs_dir in self.symfs_dirs:
51 self.adb = AdbHelper()
52 self.readelf_path = find_tool_path('readelf')
53 if not self.readelf_path and self
[all...]
/system/update_engine/scripts/update_payload/
H A Dformat_utils_unittest.py15 def testHundredPercent(self):
16 self.assertEqual(format_utils.NumToPercent(1, 1), '100%')
18 def testOverHundredPercent(self):
19 self.assertEqual(format_utils.NumToPercent(5, 2), '250%')
21 def testWholePercent(self):
22 self.assertEqual(format_utils.NumToPercent(3, 10), '30%')
24 def testDefaultMinPrecision(self):
25 self.assertEqual(format_utils.NumToPercent(3, 9), '33.3%')
26 self.assertEqual(format_utils.NumToPercent(3, 900), '0.3%')
28 def testDefaultMaxPrecision(self)
[all...]
H A Dpayload.py61 def __init__(self):
62 self.version = None
63 self.manifest_len = None
64 self.metadata_signature_len = None
65 self.size = None
67 def ReadFromPayload(self, payload_file, hasher=None):
85 magic = common.Read(payload_file, len(self._MAGIC), hasher=hasher)
86 if magic != self._MAGIC:
89 self.version = _ReadInt(payload_file, self
[all...]
H A Dhistogram_unittest.py22 def CompareToExpectedDefault(self, actual_str):
27 self.assertEqual(actual_str, expected_str)
29 def testExampleHistogram(self):
30 self.CompareToExpectedDefault(str(histogram.Histogram(
33 def testFromCountDict(self):
34 self.CompareToExpectedDefault(str(histogram.Histogram.FromCountDict(
37 def testFromKeyList(self):
38 self.CompareToExpectedDefault(str(histogram.Histogram.FromKeyList(
41 def testCustomScale(self):
47 self
[all...]
H A Dchecker.py124 def GenerateLines(self, base_indent, sub_indent, curr_section):
141 def __init__(self, name, value, linebreak, indent):
142 super(_PayloadReport.FieldNode, self).__init__()
143 self.name = name
144 self.value = value
145 self.linebreak = linebreak
146 self.indent = indent
148 def GenerateLines(self, base_indent, sub_indent, curr_section):
151 if self.name:
152 report_output += self
[all...]
H A Dhistogram.py30 def __init__(self, data, scale=20, formatter=None):
39 self.data = data
40 self.scale = scale
41 self.formatter = formatter or str
42 self.max_key_len = max([len(str(key)) for key, count in self.data])
43 self.total = sum([count for key, count in self.data])
96 def __str__(self):
99 for key, count in self
[all...]
/system/extras/simpleperf/inferno/
H A Ddata_types.py18 def __init__(self, ip, method, dso):
19 self.ip = ip
20 self.method = method
21 self.dso = dso
26 def __init__(self, tid):
27 self.tid = tid
28 self.samples = []
29 self.flamegraph = {}
30 self.num_samples = 0
33 def add_callchain(self, callchai
[all...]
H A Dadb_root.py5 def collect_data(self, process):
7 self.push_simpleperf_binary()
/system/media/camera/docs/
H A Dmetadata_model.py52 def __init__(self):
53 self._parent = None
54 self._name = None
57 def parent(self):
58 return self._parent
61 def name(self):
62 return self._name
64 def find_all(self, pred):
75 if pred(self):
76 yield self
[all...]
H A Dmetadata_helpers_test.py71 def test_enum_calculate_value_string(self):
74 self.assertEquals(val,
107 def test_enumerate_with_last(self):
111 self.fail("Should not return anything for empty list")
115 self.assertEquals(1, x)
116 self.assertEquals(True, last)
120 self.assertListEqual([(4, False), (5, False), (6, True)], lst)
122 def test_filter_tags(self):
158 self.assertEqual(result_text, expected_text)
160 def test_wbr(self)
[all...]
/system/tpm/trunks/generator/
H A Dgenerator.py300 def __init__(self, old_type, new_type):
307 self.old_type = old_type
308 self.new_type = new_type
310 def OutputForward(self, out_file, defined_types, typemap):
322 self.Output(out_file, defined_types, typemap)
324 def Output(self, out_file, defined_types, typemap):
335 if self.new_type in defined_types:
338 if self.old_type not in defined_types:
339 typemap[self.old_type].OutputForward(out_file, defined_types, typemap)
340 out_file.write(self
[all...]
H A Dgenerator_test.py32 def testTypedef(self):
42 self.assertEqual(out_file.getvalue(), 'typedef int INT;\n')
43 self.assertIn('INT', defined_types)
51 self.assertRegexpMatches(out_file2.getvalue(), output_re)
52 self.assertIn('TYPE2', defined_types)
56 def testTypedefSerialize(self):
64 self.assertIn('INT', serialized_types)
65 self.assertIn('INT2', serialized_types)
68 def testConstant(self):
76 self
[all...]
/system/sepolicy/tests/
H A Dpolicy.py34 def __init__(self, rule):
36 self.flavor = data[0]
37 self.sctx = data[1]
38 self.tctx = data[2]
39 self.tclass = data[3]
40 self.perms = set((data[4].strip()).split(' '))
41 self.rule = rule
54 def AssertPathTypesHaveAttr(self, MatchPrefix, DoNotMatchPrefix, Attr):
56 TypesPol = self.QueryTypeAttribute(Attr, True)
59 TypesFc = self
[all...]
H A Dmini_parser.py19 def _getNextStmt(self, infile):
42 def _parseType(self, stmt):
44 self.types.add(m.group(1))
47 def _parseTypeattribute(self, stmt):
49 self.typeattributes.add(m.group(1))
52 def _parseTypeattributeset(self, stmt):
59 if self.typeattributesets.get(ta) is None:
60 self.typeattributesets[ta] = set()
61 self.typeattributesets[ta].update(set(tas))
63 if self
[all...]
/system/bt/vendor_libs/test_vendor_lib/scripts/
H A Dtest_channel.py66 def __init__(self, port):
67 self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
68 self._socket.connect(('localhost', port))
70 def close(self):
71 self._socket.close()
73 def send(self, data):
74 self._socket.sendall(data)
84 def __init__(self, port):
85 self._connection = Connection(port)
86 self
[all...]
/system/core/adb/
H A Dtest_device.py43 def wrapper(self, *args):
44 if self.device.get_prop('ro.debuggable') != '1':
47 was_root = self.device.shell(['id', '-un'])[0].strip() == 'root'
49 self.device.root()
50 self.device.wait()
53 func(self, *args)
56 self.device.unroot()
57 self.device.wait()
63 def wrapper(self, *args):
64 was_root = self
[all...]
/system/extras/simpleperf/runtest/
H A Druntest.py38 def __init__(self, name):
39 self.name = name
40 self.children = []
42 def add_child(self, child):
43 self.children.append(child)
45 def __str__(self):
46 return 'CallTreeNode:\n' + '\n'.join(self._dump(1))
48 def _dump(self, indent):
50 strs = [indent_str + self.name]
51 for child in self
[all...]
/system/update_engine/scripts/
H A Dupdate_device.py78 def __init__(self, otafilename):
79 self.otafilename = otafilename
82 payload_info = otazip.getinfo(self.OTA_PAYLOAD_BIN)
83 self.offset = payload_info.header_offset + len(payload_info.FileHeader())
84 self.size = payload_info.file_size
85 self.properties = otazip.read(self.OTA_PAYLOAD_PROPERTIES_TXT)
122 def do_GET(self): # pylint: disable=invalid-name
124 if self.path != '/payload':
125 self
[all...]

Completed in 313 milliseconds

12345