+2018-04-02 Daniel Bates <dabates@apple.com>
+
+ Remove Options constructor and use internal linkage for option handlers
+ https://bugs.webkit.org/show_bug.cgi?id=184229
+
+ Reviewed by Andy Estes.
+
+ Use C++11 default initializer syntax to remove the need to explicitly have a constructor
+ for the struct Options. Use internal linkage for option handler functions as these
+ are never invoked outside the translation unit they are defined in.
+
+ * WebKitTestRunner/Options.cpp:
+ (WTR::handleOptionNoTimeout):
+ (WTR::handleOptionVerbose):
+ (WTR::handleOptionGcBetweenTests):
+ (WTR::handleOptionPixelTests):
+ (WTR::handleOptionPrintSupportedFeatures):
+ (WTR::handleOptionComplexText):
+ (WTR::handleOptionAcceleratedDrawing):
+ (WTR::handleOptionRemoteLayerTree):
+ (WTR::handleOptionShowWebView):
+ (WTR::handleOptionShowTouches):
+ (WTR::handleOptionAllowedHost):
+ (WTR::handleOptionUnmatched):
+ (WTR::Options::Options): Deleted.
+ * WebKitTestRunner/Options.h:
+
2018-04-02 Alejandro G. Castro <alex@igalia.com>
Unreviewed GTK port dependencies fix after r230152.
/*
* 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.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
namespace WTR {
-Options::Options()
- : useWaitToDumpWatchdogTimer(true)
- , forceNoTimeout(false)
- , verbose(false)
- , gcBetweenTests(false)
- , shouldDumpPixelsForAllTests(false)
- , printSupportedFeatures(false)
- , forceComplexText(false)
- , shouldUseAcceleratedDrawing(false)
- , shouldUseRemoteLayerTree(false)
- , shouldShowWebView(false)
- , shouldShowTouches(false)
-{
-}
-
-bool handleOptionNoTimeout(Options& options, const char*, const char*)
+static bool handleOptionNoTimeout(Options& options, const char*, const char*)
{
options.useWaitToDumpWatchdogTimer = false;
options.forceNoTimeout = true;
return true;
}
-bool handleOptionVerbose(Options& options, const char*, const char*)
+static bool handleOptionVerbose(Options& options, const char*, const char*)
{
options.verbose = true;
return true;
}
-bool handleOptionGcBetweenTests(Options& options, const char*, const char*)
+static bool handleOptionGcBetweenTests(Options& options, const char*, const char*)
{
options.gcBetweenTests = true;
return true;
}
-bool handleOptionPixelTests(Options& options, const char*, const char*)
+static bool handleOptionPixelTests(Options& options, const char*, const char*)
{
options.shouldDumpPixelsForAllTests = true;
return true;
}
-bool handleOptionPrintSupportedFeatures(Options& options, const char*, const char*)
+static bool handleOptionPrintSupportedFeatures(Options& options, const char*, const char*)
{
options.printSupportedFeatures = true;
return true;
}
-bool handleOptionComplexText(Options& options, const char*, const char*)
+static bool handleOptionComplexText(Options& options, const char*, const char*)
{
options.forceComplexText = true;
return true;
}
-bool handleOptionAcceleratedDrawing(Options& options, const char*, const char*)
+static bool handleOptionAcceleratedDrawing(Options& options, const char*, const char*)
{
options.shouldUseAcceleratedDrawing = true;
return true;
}
-bool handleOptionRemoteLayerTree(Options& options, const char*, const char*)
+static bool handleOptionRemoteLayerTree(Options& options, const char*, const char*)
{
options.shouldUseRemoteLayerTree = true;
return true;
}
-bool handleOptionShowWebView(Options& options, const char*, const char*)
+static bool handleOptionShowWebView(Options& options, const char*, const char*)
{
options.shouldShowWebView = true;
return true;
}
-
-bool handleOptionShowTouches(Options& options, const char*, const char*)
+
+static bool handleOptionShowTouches(Options& options, const char*, const char*)
{
options.shouldShowTouches = true;
return true;
}
-bool handleOptionAllowedHost(Options& options, const char*, const char* host)
+static 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*)
+static bool handleOptionUnmatched(Options& options, const char* option, const char*)
{
if (option[0] && option[1] && option[0] == '-' && option[1] == '-')
return true;
/*
* 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.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Options_h
-#define Options_h
+#pragma once
#include <functional>
#include <stdio.h>
namespace WTR {
struct Options {
- Options();
- bool useWaitToDumpWatchdogTimer;
- bool forceNoTimeout;
- bool verbose;
- bool gcBetweenTests;
- bool shouldDumpPixelsForAllTests;
- bool printSupportedFeatures;
- bool forceComplexText;
- bool shouldUseAcceleratedDrawing;
- bool shouldUseRemoteLayerTree;
- bool shouldShowWebView;
- bool shouldShowTouches;
+ bool useWaitToDumpWatchdogTimer { true };
+ bool forceNoTimeout { false };
+ bool verbose { false };
+ bool gcBetweenTests { false };
+ bool shouldDumpPixelsForAllTests { false };
+ bool printSupportedFeatures { false };
+ bool forceComplexText { false };
+ bool shouldUseAcceleratedDrawing { false };
+ bool shouldUseRemoteLayerTree { false };
+ bool shouldShowWebView { false };
+ bool shouldShowTouches { false };
std::vector<std::string> paths;
std::vector<std::string> allowedHosts;
};
} // namespace WTR
-#endif // Options_h