summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner/Options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/WebKitTestRunner/Options.cpp')
-rw-r--r--Tools/WebKitTestRunner/Options.cpp43
1 files changed, 20 insertions, 23 deletions
diff --git a/Tools/WebKitTestRunner/Options.cpp b/Tools/WebKitTestRunner/Options.cpp
index 8fa6e6e0f..53f0253ac 100644
--- a/Tools/WebKitTestRunner/Options.cpp
+++ b/Tools/WebKitTestRunner/Options.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2013 University of Szeged. All rights reserved.
* Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,10 +32,8 @@
namespace WTR {
-Options::Options(double defaultLongTimeout, double defaultShortTimeout)
- : longTimeout(defaultLongTimeout)
- , shortTimeout(defaultShortTimeout)
- , useWaitToDumpWatchdogTimer(true)
+Options::Options()
+ : useWaitToDumpWatchdogTimer(true)
, forceNoTimeout(false)
, verbose(false)
, gcBetweenTests(false)
@@ -43,28 +42,13 @@ Options::Options(double defaultLongTimeout, double defaultShortTimeout)
, forceComplexText(false)
, shouldUseAcceleratedDrawing(false)
, shouldUseRemoteLayerTree(false)
- , defaultLongTimeout(defaultLongTimeout)
- , defaultShortTimeout(defaultShortTimeout)
+ , shouldShowWebView(false)
{
}
-bool handleOptionTimeout(Options& options, const char*, const char* argument)
-{
- options.longTimeout = atoi(argument);
- // Scale up the short timeout to match.
- options.shortTimeout = options.defaultShortTimeout * options.longTimeout / options.defaultLongTimeout;
- return true;
-}
-
bool handleOptionNoTimeout(Options& options, const char*, const char*)
{
options.useWaitToDumpWatchdogTimer = false;
- return true;
-}
-
-bool handleOptionNoTimeoutAtAll(Options& options, const char*, const char*)
-{
- options.useWaitToDumpWatchdogTimer = false;
options.forceNoTimeout = true;
return true;
}
@@ -111,6 +95,18 @@ bool handleOptionRemoteLayerTree(Options& options, const char*, const char*)
return true;
}
+bool handleOptionShowWebView(Options& options, const char*, const char*)
+{
+ options.shouldShowWebView = true;
+ return true;
+}
+
+bool handleOptionAllowedHost(Options& options, const char*, const char* host)
+{
+ options.allowedHosts.push_back(host);
+ return true;
+}
+
bool handleOptionUnmatched(Options& options, const char* option, const char*)
{
if (option[0] && option[1] && option[0] == '-' && option[1] == '-')
@@ -122,9 +118,7 @@ bool handleOptionUnmatched(Options& options, const char* option, const char*)
OptionsHandler::OptionsHandler(Options& o)
: options(o)
{
- optionList.append(Option("--timeout", "Sets long timeout to <param> and scales short timeout.", handleOptionTimeout, true));
- optionList.append(Option("--no-timeout", "Disables timeout.", handleOptionNoTimeout));
- optionList.append(Option("--no-timeout-at-all", "Disables all timeouts.", handleOptionNoTimeoutAtAll));
+ optionList.append(Option("--no-timeout", "Disables all timeouts.", handleOptionNoTimeout));
optionList.append(Option("--verbose", "Turns on messages.", handleOptionVerbose));
optionList.append(Option("--gc-between-tests", "Garbage collection between tests.", handleOptionGcBetweenTests));
optionList.append(Option("--pixel-tests", "Check pixels.", handleOptionPixelTests));
@@ -133,6 +127,9 @@ OptionsHandler::OptionsHandler(Options& o)
optionList.append(Option("--complex-text", "Force complex tests.", handleOptionComplexText));
optionList.append(Option("--accelerated-drawing", "Use accelerated drawing.", handleOptionAcceleratedDrawing));
optionList.append(Option("--remote-layer-tree", "Use remote layer tree.", handleOptionRemoteLayerTree));
+ optionList.append(Option("--allowed-host", "Allows access to the specified host from tests.", handleOptionAllowedHost, true));
+ optionList.append(Option("--show-webview", "Show the WebView during test runs (for Debugging)", handleOptionShowWebView));
+
optionList.append(Option(0, 0, handleOptionUnmatched));
}