示例#1
0
    def testSetPreload(self):
        chrome_control.SetPreload(False)
        self.assertEqual(0, chrome_control.GetPreload())

        chrome_control.SetPreload(True)
        self.assertEqual(100, chrome_control.GetPreload())

        chrome_control.SetPreload(0)
        self.assertEqual(0, chrome_control.GetPreload())

        chrome_control.SetPreload(50)
        self.assertEqual(50, chrome_control.GetPreload())

        chrome_control.SetPreload(100)
        self.assertEqual(100, chrome_control.GetPreload())
示例#2
0
文件: runner.py 项目: yanxxd/syzygy
 def _TearDown(self):
   chrome_control.SetPreload(self._old_preload)
   if self._temp_dir and not self._keep_temp_dirs:
     _LOGGER.info('Deleting temporary directory "%s".', self._temp_dir)
     shutil.rmtree(self._temp_dir, ignore_errors=True)
     self._temp_dir = None
   super(BenchmarkRunner, self)._TearDown()
示例#3
0
文件: runner.py 项目: yanxxd/syzygy
 def _SetUp(self):
   super(BenchmarkRunner, self)._SetUp()
   self._old_preload = chrome_control.GetPreload()
   chrome_control.SetPreload(self._preload)
   if not self._temp_dir:
     self._temp_dir = tempfile.mkdtemp(prefix='chrome-bench')
     _LOGGER.info('Created temporary directory "%s".', self._temp_dir)