Exemple #1
0
    def testOldPreload(self):
        key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER,
                                chrome_control._CHROME_FRAME_KEY)
        chrome_control._SetDWORDValueImpl(key, chrome_control._PREREAD_VALUE,
                                          0)
        self.assertEqual(0, chrome_control.GetPreload())

        chrome_control._SetDWORDValueImpl(key, chrome_control._PREREAD_VALUE,
                                          1)
        self.assertEqual(100, chrome_control.GetPreload())
Exemple #2
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())
Exemple #3
0
 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)
Exemple #4
0
 def testGetPreload(self):
     self.assertEqual(100, chrome_control.GetPreload())