Changeset 190335 in webkit


Ignore:
Timestamp:
Sep 29, 2015 6:20:23 PM (9 years ago)
Author:
Simon Fraser
Message:

WebKitTestRunner fails to apply "useFlexibleViewport" when it's specified in a file comment
https://bugs.webkit.org/show_bug.cgi?id=149650

Reviewed by Tim Horton.

TestInvocation::invoke() consulted shouldMakeViewportFlexible(), but that only
looks at the file path, and not the custom options that come from file comments.

Fix by computing TestOptions before making the TestInvocation, and setting them
as const TestInvocation data. This meant changing various call sites to take
the std::string pathOrURL, rather than the TestInvocation itself.

Also initialize TestInvocation with a WKURLRef, rather than a std::string.

  • WebKitTestRunner/CMakeLists.txt:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::ensureViewSupportsOptionsForTest):
(WTR::testPath):
(WTR::createTestURL):
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::testOptionsForTest):
(WTR::TestController::updateWebViewSizeForTest):
(WTR::TestController::updateWindowScaleForTest):
(WTR::TestController::runTest):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::TestInvocation):
(WTR::TestInvocation::invoke):
(WTR::createWKURL): Deleted.
(WTR::TestInvocation::shouldMakeViewportFlexible): Deleted.
(WTR::TestInvocation::shouldUseFixedLayout): Deleted.

  • WebKitTestRunner/TestInvocation.h:

(WTR::TestInvocation::options):

  • WebKitTestRunner/TestOptions.cpp: Copied from Tools/WebKitTestRunner/TestOptions.h.

(WTR::pathContains):
(WTR::shouldMakeViewportFlexible):
(WTR::shouldUseFixedLayout):
(WTR::isSVGTestPath):
(WTR::isHiDPITestPath):
(WTR::TestOptions::TestOptions):

  • WebKitTestRunner/TestOptions.h:
  • WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
  • WebKitTestRunner/efl/TestControllerEfl.cpp:

(WTR::pathContains):
(WTR::shouldUseFixedLayout):
(WTR::TestController::updatePlatformSpecificTestOptionsForTest):

  • WebKitTestRunner/gtk/TestControllerGtk.cpp:

(WTR::TestController::updatePlatformSpecificTestOptionsForTest):

  • WebKitTestRunner/ios/TestControllerIOS.mm:

(WTR::TestController::updatePlatformSpecificTestOptionsForTest):

  • WebKitTestRunner/mac/TestControllerMac.mm:

(WTR::TestController::updatePlatformSpecificTestOptionsForTest):

Location:
trunk/Tools
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r190334 r190335  
     12015-09-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        WebKitTestRunner fails to apply "useFlexibleViewport" when it's specified in a file comment
     4        https://bugs.webkit.org/show_bug.cgi?id=149650
     5
     6        Reviewed by Tim Horton.
     7       
     8        TestInvocation::invoke() consulted shouldMakeViewportFlexible(), but that only
     9        looks at the file path, and not the custom options that come from file comments.
     10       
     11        Fix by computing TestOptions before making the TestInvocation, and setting them
     12        as const TestInvocation data. This meant changing various call sites to take
     13        the std::string pathOrURL, rather than the TestInvocation itself.
     14       
     15        Also initialize TestInvocation with a WKURLRef, rather than a std::string.
     16
     17        * WebKitTestRunner/CMakeLists.txt:
     18        * WebKitTestRunner/TestController.cpp:
     19        (WTR::TestController::ensureViewSupportsOptionsForTest):
     20        (WTR::testPath):
     21        (WTR::createTestURL):
     22        (WTR::updateTestOptionsFromTestHeader):
     23        (WTR::TestController::testOptionsForTest):
     24        (WTR::TestController::updateWebViewSizeForTest):
     25        (WTR::TestController::updateWindowScaleForTest):
     26        (WTR::TestController::runTest):
     27        * WebKitTestRunner/TestController.h:
     28        * WebKitTestRunner/TestInvocation.cpp:
     29        (WTR::TestInvocation::TestInvocation):
     30        (WTR::TestInvocation::invoke):
     31        (WTR::createWKURL): Deleted.
     32        (WTR::TestInvocation::shouldMakeViewportFlexible): Deleted.
     33        (WTR::TestInvocation::shouldUseFixedLayout): Deleted.
     34        * WebKitTestRunner/TestInvocation.h:
     35        (WTR::TestInvocation::options):
     36        * WebKitTestRunner/TestOptions.cpp: Copied from Tools/WebKitTestRunner/TestOptions.h.
     37        (WTR::pathContains):
     38        (WTR::shouldMakeViewportFlexible):
     39        (WTR::shouldUseFixedLayout):
     40        (WTR::isSVGTestPath):
     41        (WTR::isHiDPITestPath):
     42        (WTR::TestOptions::TestOptions):
     43        * WebKitTestRunner/TestOptions.h:
     44        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
     45        * WebKitTestRunner/efl/TestControllerEfl.cpp:
     46        (WTR::pathContains):
     47        (WTR::shouldUseFixedLayout):
     48        (WTR::TestController::updatePlatformSpecificTestOptionsForTest):
     49        * WebKitTestRunner/gtk/TestControllerGtk.cpp:
     50        (WTR::TestController::updatePlatformSpecificTestOptionsForTest):
     51        * WebKitTestRunner/ios/TestControllerIOS.mm:
     52        (WTR::TestController::updatePlatformSpecificTestOptionsForTest):
     53        * WebKitTestRunner/mac/TestControllerMac.mm:
     54        (WTR::TestController::updatePlatformSpecificTestOptionsForTest):
     55
    1562015-09-29  Aakash Jain  <aakash_jain@apple.com>
    257
  • trunk/Tools/WebKitTestRunner/CMakeLists.txt

    r190065 r190335  
    1313    ${WEBKIT_TESTRUNNER_DIR}/TestController.cpp
    1414    ${WEBKIT_TESTRUNNER_DIR}/TestInvocation.cpp
     15    ${WEBKIT_TESTRUNNER_DIR}/TestOptions.cpp
    1516    ${WEBKIT_TESTRUNNER_DIR}/WebNotificationProvider.cpp
    1617    ${WEBKIT_TESTRUNNER_DIR}/WorkQueueManager.cpp
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r190262 r190335  
    5959#include <stdlib.h>
    6060#include <string>
     61#include <unistd.h>
    6162#include <wtf/MainThread.h>
    6263#include <wtf/RunLoop.h>
     
    586587void TestController::ensureViewSupportsOptionsForTest(const TestInvocation& test)
    587588{
    588     auto options = testOptionsForTest(test);
     589    auto options = test.options();
    589590
    590591    if (m_mainWebView) {
     
    808809}
    809810
    810 static std::string testPath(const WKURLRef url)
     811static std::string testPath(WKURLRef url)
    811812{
    812813    auto scheme = adoptWK(WKURLCopyScheme(url));
     
    820821}
    821822
     823static WKURLRef createTestURL(const char* pathOrURL)
     824{
     825    if (strstr(pathOrURL, "http://") || strstr(pathOrURL, "https://") || strstr(pathOrURL, "file://"))
     826        return WKURLCreateWithUTF8CString(pathOrURL);
     827
     828    // Creating from filesytem path.
     829    size_t length = strlen(pathOrURL);
     830    if (!length)
     831        return 0;
     832
     833    const char separator = '/';
     834    bool isAbsolutePath = pathOrURL[0] == separator;
     835    const char* filePrefix = "file://";
     836    static const size_t prefixLength = strlen(filePrefix);
     837
     838    std::unique_ptr<char[]> buffer;
     839    if (isAbsolutePath) {
     840        buffer = std::make_unique<char[]>(prefixLength + length + 1);
     841        strcpy(buffer.get(), filePrefix);
     842        strcpy(buffer.get() + prefixLength, pathOrURL);
     843    } else {
     844        buffer = std::make_unique<char[]>(prefixLength + PATH_MAX + length + 2); // 1 for the separator
     845        strcpy(buffer.get(), filePrefix);
     846        if (!getcwd(buffer.get() + prefixLength, PATH_MAX))
     847            return 0;
     848        size_t numCharacters = strlen(buffer.get());
     849        buffer[numCharacters] = separator;
     850        strcpy(buffer.get() + numCharacters + 1, pathOrURL);
     851    }
     852
     853    return WKURLCreateWithUTF8CString(buffer.get());
     854}
     855
    822856static bool parseBooleanTestHeaderValue(const std::string& value)
    823857{
     
    831865}
    832866
    833 static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const TestInvocation& test)
    834 {
    835     std::string filename = testPath(test.url());
     867static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const std::string& pathOrURL)
     868{
     869    // Gross. Need to reduce conversions between all the string types and URLs.
     870    WKRetainPtr<WKURLRef> wkURL(AdoptWK, createTestURL(pathOrURL.c_str()));
     871    std::string filename = testPath(wkURL.get());
    836872    if (filename.empty())
    837873        return;
     
    875911}
    876912
    877 TestOptions TestController::testOptionsForTest(const TestInvocation& test) const
    878 {
    879     TestOptions options;
     913TestOptions TestController::testOptionsForTest(const std::string& pathOrURL) const
     914{
     915    TestOptions options(pathOrURL);
    880916
    881917    options.useRemoteLayerTree = m_shouldUseRemoteLayerTree;
    882918    options.shouldShowWebView = m_shouldShowWebView;
    883     options.useFixedLayout = test.shouldUseFixedLayout();
    884     options.useFlexibleViewport = test.shouldMakeViewportFlexible();
    885 
    886     updatePlatformSpecificTestOptionsForTest(options, test);
    887 
    888     updateTestOptionsFromTestHeader(options, test);
     919
     920    updatePlatformSpecificTestOptionsForTest(options, pathOrURL);
     921    updateTestOptionsFromTestHeader(options, pathOrURL);
    889922
    890923    return options;
     
    893926void TestController::updateWebViewSizeForTest(const TestInvocation& test)
    894927{
    895     bool isSVGW3CTest = test.urlContains("svg/W3C-SVG-1.1") || test.urlContains("svg\\W3C-SVG-1.1");
    896 
    897928    unsigned width = viewWidth;
    898929    unsigned height = viewHeight;
    899     if (isSVGW3CTest) {
     930    if (test.options().isSVGTest) {
    900931        width = w3cSVGViewWidth;
    901932        height = w3cSVGViewHeight;
     
    907938void TestController::updateWindowScaleForTest(PlatformWebView* view, const TestInvocation& test)
    908939{
    909     bool needsHighDPIWindow = test.urlContains("/hidpi-");
    910     view->changeWindowScaleIfNeeded(needsHighDPIWindow ? 2 : 1);
     940    view->changeWindowScaleIfNeeded(test.options().isHiDPITest ? 2 : 1);
    911941}
    912942
     
    10101040
    10111041    m_state = RunningTest;
    1012 
    1013     m_currentInvocation = std::make_unique<TestInvocation>(command.pathOrURL);
     1042   
     1043    TestOptions options = testOptionsForTest(command.pathOrURL);
     1044
     1045    WKRetainPtr<WKURLRef> wkURL(AdoptWK, createTestURL(command.pathOrURL.c_str()));
     1046    m_currentInvocation = std::make_unique<TestInvocation>(wkURL.get(), options);
     1047
    10141048    if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests)
    10151049        m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
  • trunk/Tools/WebKitTestRunner/TestController.h

    r189668 r190335  
    159159
    160160    void ensureViewSupportsOptionsForTest(const TestInvocation&);
    161     TestOptions testOptionsForTest(const TestInvocation&) const;
    162     void updatePlatformSpecificTestOptionsForTest(TestOptions&, const TestInvocation&) const;
     161    TestOptions testOptionsForTest(const std::string& pathOrURL) const;
     162    void updatePlatformSpecificTestOptionsForTest(TestOptions&, const std::string& pathOrURL) const;
    163163
    164164    void updateWebViewSizeForTest(const TestInvocation&);
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r190304 r190335  
    5252#endif
    5353
    54 #include <unistd.h> // For getcwd.
    55 
    5654using namespace JSC;
    5755using namespace WebKit;
     
    6058namespace WTR {
    6159
    62 static WKURLRef createWKURL(const char* pathOrURL)
    63 {
    64     if (strstr(pathOrURL, "http://") || strstr(pathOrURL, "https://") || strstr(pathOrURL, "file://"))
    65         return WKURLCreateWithUTF8CString(pathOrURL);
    66 
    67     // Creating from filesytem path.
    68     size_t length = strlen(pathOrURL);
    69     if (!length)
    70         return 0;
    71 
    72     const char separator = '/';
    73     bool isAbsolutePath = pathOrURL[0] == separator;
    74     const char* filePrefix = "file://";
    75     static const size_t prefixLength = strlen(filePrefix);
    76 
    77     std::unique_ptr<char[]> buffer;
    78     if (isAbsolutePath) {
    79         buffer = std::make_unique<char[]>(prefixLength + length + 1);
    80         strcpy(buffer.get(), filePrefix);
    81         strcpy(buffer.get() + prefixLength, pathOrURL);
    82     } else {
    83         buffer = std::make_unique<char[]>(prefixLength + PATH_MAX + length + 2); // 1 for the separator
    84         strcpy(buffer.get(), filePrefix);
    85         if (!getcwd(buffer.get() + prefixLength, PATH_MAX))
    86             return 0;
    87         size_t numCharacters = strlen(buffer.get());
    88         buffer[numCharacters] = separator;
    89         strcpy(buffer.get() + numCharacters + 1, pathOrURL);
    90     }
    91 
    92     return WKURLCreateWithUTF8CString(buffer.get());
    93 }
    94 
    95 TestInvocation::TestInvocation(const std::string& pathOrURL)
    96     : m_url(AdoptWK, createWKURL(pathOrURL.c_str()))
    97     , m_dumpPixels(false)
    98     , m_timeout(0)
    99     , m_gotInitialResponse(false)
    100     , m_gotFinalMessage(false)
    101     , m_gotRepaint(false)
    102     , m_error(false)
    103     , m_webProcessIsUnresponsive(false)
     60TestInvocation::TestInvocation(WKURLRef url, const TestOptions& options)
     61    : m_options(options)
     62    , m_url(url)
    10463{
    10564    WKRetainPtr<WKStringRef> urlString = adoptWK(WKURLCopyString(m_url.get()));
     
    143102{
    144103    return urlContains("globalhistory/");
    145 }
    146 
    147 bool TestInvocation::shouldMakeViewportFlexible() const
    148 {
    149     return urlContains("viewport/");
    150 }
    151 
    152 bool TestInvocation::shouldUseFixedLayout() const
    153 {
    154 #if ENABLE(CSS_DEVICE_ADAPTATION)
    155     if (urlContains("device-adapt/") || urlContains("device-adapt\\"))
    156         return true;
    157 #endif
    158 
    159     return false;
    160104}
    161105
     
    182126
    183127    WKRetainPtr<WKStringRef> useFlexibleViewportKey = adoptWK(WKStringCreateWithUTF8CString("UseFlexibleViewport"));
    184     WKRetainPtr<WKBooleanRef> useFlexibleViewportValue = adoptWK(WKBooleanCreate(shouldMakeViewportFlexible()));
     128    WKRetainPtr<WKBooleanRef> useFlexibleViewportValue = adoptWK(WKBooleanCreate(options().useFlexibleViewport));
    185129    WKDictionarySetItem(beginTestMessageBody.get(), useFlexibleViewportKey.get(), useFlexibleViewportValue.get());
    186130
  • trunk/Tools/WebKitTestRunner/TestInvocation.h

    r190304 r190335  
    2828
    2929#include "JSWrappable.h"
     30#include "TestOptions.h"
    3031#include "UIScriptContext.h"
    31 #include <JavaScriptCore/JSRetainPtr.h>
    3232#include <WebKit/WKRetainPtr.h>
    3333#include <string>
     
    4040    WTF_MAKE_NONCOPYABLE(TestInvocation);
    4141public:
    42     explicit TestInvocation(const std::string& pathOrURL);
     42    explicit TestInvocation(WKURLRef, const TestOptions&);
    4343    ~TestInvocation();
    4444
    4545    WKURLRef url() const;
    4646    bool urlContains(const char*) const;
     47   
     48    const TestOptions& options() const { return m_options; }
    4749
    4850    void setIsPixelTest(const std::string& expectedPixelHash);
     
    6365    void didEndSwipe();
    6466    void didRemoveSwipeSnapshot();
    65 
    66     bool shouldMakeViewportFlexible() const;
    67     bool shouldUseFixedLayout() const;
    6867
    6968private:
     
    9190    void uiScriptDidComplete(WKStringRef result, unsigned callbackID) override;
    9291
     92    const TestOptions m_options;
     93   
    9394    WKRetainPtr<WKURLRef> m_url;
    9495    WTF::String m_urlString;
    9596
    96     bool m_dumpPixels;
    97     bool m_pixelResultIsPending { false };
    9897    std::string m_expectedPixelHash;
    9998
    100     int m_timeout;
     99    int m_timeout { 0 };
    101100
    102101    // Invocation state
    103     bool m_gotInitialResponse;
    104     bool m_gotFinalMessage;
    105     bool m_gotRepaint;
    106     bool m_error;
     102    bool m_gotInitialResponse { false };
     103    bool m_gotFinalMessage { false };
     104    bool m_gotRepaint { false };
     105    bool m_error { false };
     106
     107    bool m_dumpPixels { false };
     108    bool m_pixelResultIsPending { false };
     109    bool m_webProcessIsUnresponsive { false };
    107110
    108111    StringBuilder m_textOutput;
     
    111114    WKRetainPtr<WKArrayRef> m_repaintRects;
    112115    std::string m_errorMessage;
    113     bool m_webProcessIsUnresponsive;
    114116   
    115117    std::unique_ptr<UIScriptContext> m_UIScriptContext;
  • trunk/Tools/WebKitTestRunner/TestOptions.cpp

    r190334 r190335  
    2424 */
    2525
    26 #ifndef TestOptions_h
    27 #define TestOptions_h
     26#include "config.h"
     27#include "TestOptions.h"
    2828
    29 #include <wtf/Vector.h>
     29#include <string>
    3030#include <wtf/text/WTFString.h>
    3131
    3232namespace WTR {
    3333
    34 struct TestOptions {
    35     bool useThreadedScrolling { false };
    36     bool useRemoteLayerTree { false };
    37     bool shouldShowWebView { false };
    38     bool useFlexibleViewport { false };
    39     bool useFixedLayout { false };
    40     Vector<String> overrideLanguages;
    41 };
     34static bool pathContains(const std::string& pathOrURL, const char* substring)
     35{
     36    String path(pathOrURL.c_str());
     37    return path.contains(substring); // Case-insensitive.
     38}
     39
     40static bool shouldMakeViewportFlexible(const std::string& pathOrURL)
     41{
     42    return pathContains(pathOrURL, "viewport/");
     43}
     44
     45static bool shouldUseFixedLayout(const std::string& pathOrURL)
     46{
     47#if ENABLE(CSS_DEVICE_ADAPTATION)
     48    if (pathContains(pathOrURL, "device-adapt/") || pathContains(pathOrURL, "device-adapt\\"))
     49        return true;
     50#endif
     51    return false;
     52}
     53
     54static bool isSVGTestPath(const std::string& pathOrURL)
     55{
     56    return pathContains(pathOrURL, "svg/W3C-SVG-1.1") || pathContains(pathOrURL, "svg\\W3C-SVG-1.1");
     57}
     58
     59static bool isHiDPITestPath(const std::string& pathOrURL)
     60{
     61    return pathContains(pathOrURL, "/hidpi-");
     62}
     63
     64TestOptions::TestOptions(const std::string& pathOrURL)
     65    : useFlexibleViewport(shouldMakeViewportFlexible(pathOrURL))
     66    , useFixedLayout(shouldUseFixedLayout(pathOrURL))
     67    , isSVGTest(isSVGTestPath(pathOrURL))
     68    , isHiDPITest(isHiDPITestPath(pathOrURL))
     69{
     70}
    4271
    4372}
    44 
    45 #endif // TestOptions_h
  • trunk/Tools/WebKitTestRunner/TestOptions.h

    r190065 r190335  
    3838    bool useFlexibleViewport { false };
    3939    bool useFixedLayout { false };
     40    bool isSVGTest { false };
     41    bool isHiDPITest { false };
     42
    4043    Vector<String> overrideLanguages;
     44   
     45    TestOptions(const std::string& pathOrURL);
    4146};
    4247
  • trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj

    r190065 r190335  
    3535/* Begin PBXBuildFile section */
    3636                0F5169CC1445222D00E0A9D7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; };
     37                0F622CE91BBB3A1A00838AD3 /* TestOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F622CE81BBB3A1A00838AD3 /* TestOptions.cpp */; settings = {ASSET_TAGS = (); }; };
    3738                0F73B5511BA78968004B3EF4 /* JSUIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */; };
    3839                0F73B5521BA78968004B3EF4 /* JSUIScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */; };
     
    171172                0F2109C7189C650D00F879A3 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
    172173                0F5169CA1445222D00E0A9D7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
     174                0F622CE81BBB3A1A00838AD3 /* TestOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestOptions.cpp; sourceTree = "<group>"; };
    173175                0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSUIScriptController.cpp; path = DerivedSources/WebKitTestRunner/JSUIScriptController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
    174176                0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSUIScriptController.h; path = DerivedSources/WebKitTestRunner/JSUIScriptController.h; sourceTree = BUILT_PRODUCTS_DIR; };
     
    407409                                BCD7D2F711921278006DB7EE /* TestInvocation.cpp */,
    408410                                BCD7D2F611921278006DB7EE /* TestInvocation.h */,
     411                                0F622CE81BBB3A1A00838AD3 /* TestOptions.cpp */,
    409412                                1A3326051B75396500F89F62 /* TestOptions.h */,
    410413                                BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */,
     
    936939                        buildActionMask = 2147483647;
    937940                        files = (
     941                                0F622CE91BBB3A1A00838AD3 /* TestOptions.cpp in Sources */,
    938942                                0F73B55A1BA792FF004B3EF4 /* JSWrapper.cpp in Sources */,
    939943                                A18510441B9AE14A00744AEB /* WorkQueueManager.cpp in Sources */,
  • trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp

    r189668 r190335  
    135135}
    136136
    137 static bool shouldUseFixedLayout(const TestInvocation& test)
     137static bool pathContains(const std::string& pathOrURL, const char* substring)
    138138{
    139 #if ENABLE(CSS_DEVICE_ADAPTATION)
    140     if (test.urlContains("device-adapt/") || test.urlContains("device-adapt\\"))
    141         return true;
    142 #endif
     139    String path(pathOrURL.c_str());
     140    return path.contains(substring); // Case-insensitive.
     141}
    143142
     143static bool shouldUseFixedLayout(const std::string& pathOrURL)
     144{
    144145#if USE(COORDINATED_GRAPHICS)
    145     if (test.urlContains("sticky/") || test.urlContains("sticky\\"))
     146    if (pathContains(pathOrURL, "sticky/") || pathContains(pathOrURL, "sticky\\"))
    146147        return true;
    147148#endif
     
    149150}
    150151
    151 void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& testOptions, const TestInvocation& test) const
     152void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& testOptions, const std::string& pathOrURL) const
    152153{
    153     testOptions.useFixedLayout = shouldUseFixedLayout(test);
     154    testOptions.useFixedLayout = shouldUseFixedLayout(pathOrURL);
    154155}
    155156
  • trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp

    r189668 r190335  
    129129}
    130130
    131 void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions&, const TestInvocation&) const
     131void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions&, const std::string&) const
    132132{
    133133}
  • trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm

    r189958 r190335  
    8989void TestController::platformConfigureViewForTest(const TestInvocation& test)
    9090{
    91     if (test.shouldMakeViewportFlexible()) {
     91    if (test.options().useFlexibleViewport) {
    9292        const unsigned phoneViewHeight = 480;
    9393        const unsigned phoneViewWidth = 320;
     
    9999}
    100100
    101 void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions&, const TestInvocation&) const
     101void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions&, const std::string&) const
    102102{
    103103}
  • trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm

    r190065 r190335  
    9292}
    9393
    94 void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& options, const TestInvocation& test) const
     94void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& options, const std::string&) const
    9595{
    9696    options.useThreadedScrolling = true;
Note: See TracChangeset for help on using the changeset viewer.