Index: tools/telemetry/telemetry/core/browser_finder.py |
diff --git a/tools/telemetry/telemetry/core/browser_finder.py b/tools/telemetry/telemetry/core/browser_finder.py |
index 9fc34e75deab9818dc8fe4f8cb9ab151f5e6785b..eb189aff2c161a96f1135a369599e4b3c0054f4d 100644 |
--- a/tools/telemetry/telemetry/core/browser_finder.py |
+++ b/tools/telemetry/telemetry/core/browser_finder.py |
@@ -8,6 +8,7 @@ import logging |
import operator |
from telemetry import decorators |
+from telemetry.core import browser_finder_exceptions |
from telemetry.core.backends.chrome import android_browser_finder |
from telemetry.core.backends.chrome import cros_browser_finder |
from telemetry.core.backends.chrome import desktop_browser_finder |
@@ -25,14 +26,6 @@ BROWSER_FINDERS = [ |
] |
-class BrowserTypeRequiredException(Exception): |
- pass |
- |
- |
-class BrowserFinderException(Exception): |
- pass |
- |
- |
def FindAllBrowserTypes(options): |
return reduce(operator.add, |
[bf.FindAllBrowserTypes(options) for bf in BROWSER_FINDERS]) |
@@ -52,19 +45,19 @@ def FindBrowser(options): |
BrowserFinderException: Options improperly set, or an error occurred. |
""" |
if options.browser_type == 'exact' and options.browser_executable == None: |
- raise BrowserFinderException( |
+ raise browser_finder_exceptions.BrowserFinderException( |
'--browser=exact requires --browser-executable to be set.') |
if options.browser_type != 'exact' and options.browser_executable != None: |
- raise BrowserFinderException( |
+ raise browser_finder_exceptions.BrowserFinderException( |
'--browser-executable requires --browser=exact.') |
if options.browser_type == 'cros-chrome' and options.cros_remote == None: |
- raise BrowserFinderException( |
+ raise browser_finder_exceptions.BrowserFinderException( |
'browser_type=cros-chrome requires cros_remote be set.') |
if (options.browser_type != 'cros-chrome' and |
options.browser_type != 'cros-chrome-guest' and |
options.cros_remote != None): |
- raise BrowserFinderException( |
+ raise browser_finder_exceptions.BrowserFinderException( |
'--remote requires --browser=cros-chrome or cros-chrome-guest.') |
browsers = [] |
@@ -95,7 +88,7 @@ def FindBrowser(options): |
browsers[0].UpdateExecutableIfNeeded() |
return browsers[0] |
- raise BrowserTypeRequiredException( |
+ raise browser_finder_exceptions.BrowserTypeRequiredException( |
'--browser must be specified. Available browsers:\n%s' % |
'\n'.join(sorted(set([b.browser_type for b in browsers])))) |