Changeset 273303 in webkit


Ignore:
Timestamp:
Feb 23, 2021 5:01:29 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Use std::bitset to specify WebKitTestServer's options
https://bugs.webkit.org/show_bug.cgi?id=222273

Patch by Frederic Wang <fwang@igalia.com> on 2021-02-23
Reviewed by Carlos Garcia Campos.

  • TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:

(beforeAll):

  • TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:

(WebKitTestServer::WebKitTestServer):

  • TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r273287 r273303  
     12021-02-23  Frederic Wang  <fwang@igalia.com>
     2
     3        [GTK] Use std::bitset to specify WebKitTestServer's options
     4        https://bugs.webkit.org/show_bug.cgi?id=222273
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
     9        (beforeAll):
     10        * TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
     11        (WebKitTestServer::WebKitTestServer):
     12        * TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h:
     13
    1142021-02-22  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp

    r273236 r273303  
    566566    kHttpsServer->run(httpsServerCallback);
    567567
    568     kHttpServer = new WebKitTestServer(WebKitTestServer::ServerHTTP);
     568    kHttpServer = new WebKitTestServer();
    569569    kHttpServer->run(httpServerCallback);
    570570
  • trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp

    r273236 r273303  
    2626#include <wtf/threads/BinarySemaphore.h>
    2727
    28 WebKitTestServer::WebKitTestServer(ServerOptions options)
     28WebKitTestServer::WebKitTestServer(ServerOptionsBitSet options)
    2929{
    30     if (options & ServerRunInThread) {
     30    if (options[ServerRunInThread]) {
    3131        WTF::initialize();
    3232        m_queue = WorkQueue::create("WebKitTestServer");
     
    3535    m_soupServer = adoptGRef(soup_server_new("server-header", "WebKitTestServer ", nullptr));
    3636
    37     if (options & ServerHTTPS) {
     37    if (options[ServerHTTPS]) {
    3838        CString resourcesDir = Test::getResourcesDir();
    3939        GUniquePtr<char> sslCertificateFile(g_build_filename(resourcesDir.data(), "test-cert.pem", nullptr));
  • trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h

    r272984 r273303  
    2020#pragma once
    2121
     22#include <bitset>
    2223#include <libsoup/soup.h>
    2324#include <wtf/URL.h>
     
    3132
    3233    enum ServerOptions {
    33         ServerHTTP = 0,
    34         ServerHTTPS = 1 << 1,
    35         ServerRunInThread = 1 << 2,
     34        ServerHTTPS = 0,
     35        ServerRunInThread = 1,
    3636    };
     37    using ServerOptionsBitSet = std::bitset<2>;
    3738
    38     WebKitTestServer(ServerOptions = ServerHTTP);
     39    WebKitTestServer(ServerOptionsBitSet = 0);
     40    WebKitTestServer(ServerOptions option)
     41        : WebKitTestServer(ServerOptionsBitSet().set(option)) { }
    3942
    4043    const URL& baseURL() const { return m_baseURL; }
Note: See TracChangeset for help on using the changeset viewer.