<commit_before>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Run the Skia bench_pictures executable. """

from android_build_step import AndroidBuildStep
from bench_pictures import BenchPictures
from build_step import BuildStep
from utils import misc
import os
import sys

class AndroidBenchPictures(AndroidBuildStep, BenchPictures):
  def _Run(self, args):
    serial = misc.GetSerial(self._device)
    # TODO(borenet): Share logic with RunBench, since much is duplicated
    if self._perf_data_dir:
      self._PreBench()
      misc.RunADB(serial, ['root'])
      misc.RunADB(serial, ['remount'])
      try:
        misc.RunADB(serial, ['shell', 'rm', '-r', self._android_skp_perf_dir])
      except:
        pass
      misc.RunADB(serial, ['shell', 'mkdir', '-p', self._android_skp_perf_dir])
      cmd_args = [self._android_skp_dir]
      cmd_args += self._BuildArgs(self.BENCH_REPEAT_COUNT,
                                 self._BuildDataFile(self._android_skp_perf_dir))
      misc.Run(serial, 'bench_pictures', arguments=cmd_args)
      misc.RunADB(serial, ['pull',
                           self._BuildDataFile(self._android_skp_perf_dir),
                           self._perf_data_dir])
      misc.RunADB(serial, ['shell', 'rm', '-r', self._android_skp_perf_dir])
    else:
      misc.Run(serial, 'bench_pictures', self._android_skp_dir)

if '__main__' == __name__:
  sys.exit(BuildStep.Run(AndroidBenchPictures))
<commit_msg>Fix Android BenchPictures build step in Debug mode Review URL: https://codereview.appspot.com/6493102<commit_after>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Run the Skia bench_pictures executable. """

from android_build_step import AndroidBuildStep
from bench_pictures import BenchPictures
from build_step import BuildStep
from utils import misc
import os
import sys

class AndroidBenchPictures(AndroidBuildStep, BenchPictures):
  def _Run(self, args):
    cmd_args = [self._android_skp_dir]
    # TODO(borenet): Share logic with RunBench, since much is duplicated
    if self._perf_data_dir:
      self._PreBench()
      misc.RunADB(self._serial, ['root'])
      misc.RunADB(self._serial, ['remount'])
      try:
        misc.RunADB(self._serial, ['shell', 'rm', '-r',
                                   self._android_skp_perf_dir])
      except:
        pass
      misc.RunADB(self._serial, ['shell', 'mkdir', '-p',
                                 self._android_skp_perf_dir])
      cmd_args += self._BuildArgs(self.BENCH_REPEAT_COUNT,
                                  self._BuildDataFile(
                                     self._android_skp_perf_dir))
      misc.Run(self._serial, 'bench_pictures', arguments=cmd_args)
      misc.RunADB(self._serial, ['pull',
                                 self._BuildDataFile(
                                     self._android_skp_perf_dir),
                                 self._perf_data_dir])
      misc.RunADB(self._serial, ['shell', 'rm', '-r',
                                 self._android_skp_perf_dir])
    else:
      misc.Run(self._serial, 'bench_pictures', cmd_args)

if '__main__' == __name__:
  sys.exit(BuildStep.Run(AndroidBenchPictures))

{'fraction_non_alphanumeric': 0.10380924687409131, 'fraction_numerical': 0.004361733061936609, 'mean_word_length': 2.706896551724138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3308331', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1042, 'n_words': 244}