Increase stablility of run-benchmark script
[WebKit.git] / Tools / Scripts / webkitpy / benchmark_runner / browser_driver / osx_safari_driver.py
index fbf491d2dc49e26514f32175e1cb334bb9aa9f10..a63652b6f539773424045d252227686e131839cd 100644 (file)
@@ -8,6 +8,7 @@ import time
 # We assume that this handle can only be used when the platform is OSX.
 from AppKit import NSRunningApplication
 from browser_driver import BrowserDriver
+from webkitpy.benchmark_runner.utils import forceRemove
 
 
 _log = logging.getLogger(__name__)
@@ -17,6 +18,8 @@ class OSXSafariDriver(BrowserDriver):
 
     def prepareEnv(self):
         self.closeBrowsers()
+        forceRemove(os.path.join(os.path.expanduser('~'), 'Library/Saved Application State/com.apple.Safari.savedState'))
+        forceRemove(os.path.join(os.path.expanduser('~'), 'Library/Safari/LastSession.plist'))
         self.safariPreferences = ["-HomePage", "about:blank", "-WarnAboutFraudulentWebsites", "0", "-ExtensionsEnabled", "0", "-ShowStatusBar", "0", "-NewWindowBehavior", "1", "-NewTabBehavior", "1"]
 
     def launchUrl(self, url, browserBuildPath=None):