Esempio n. 1
0
  def test_fix_thread_names(self):
    with contextlib.nested(
        open(ATRACE_DATA_STRIPPED, 'r'),
        open(ATRACE_THREAD_NAMES, 'r'),
        open(ATRACE_DATA_THREAD_FIXED, 'r')) as (f1, f2, f3):
      atrace_data_stripped = f1.read()
      atrace_thread_names = f2.read()
      atrace_data_thread_fixed = f3.read()
      thread_names = eval(atrace_thread_names)

      trace_data = atrace_agent.fix_thread_names(
          atrace_data_stripped, thread_names)
      self.assertEqual(atrace_data_thread_fixed, trace_data)
Esempio n. 2
0
    def test_fix_thread_names(self):
        with contextlib.nested(open(ATRACE_DATA_STRIPPED, 'r'),
                               open(ATRACE_THREAD_NAMES, 'r'),
                               open(ATRACE_DATA_THREAD_FIXED,
                                    'r')) as (f1, f2, f3):
            atrace_data_stripped = f1.read()
            atrace_thread_names = f2.read()
            atrace_data_thread_fixed = f3.read()
            thread_names = eval(atrace_thread_names)

            trace_data = atrace_agent.fix_thread_names(atrace_data_stripped,
                                                       thread_names)
            self.assertEqual(atrace_data_thread_fixed, trace_data)