View | Details | Raw Unified | Return to bug 90968 | Differences between
and this patch

Collapse All | Expand All

(-)a/Tools/ChangeLog (+59 lines)
Lines 1-3 Link Here
1
2012-11-30  János Badics  <jbadics@inf.u-szeged.hu>
2
3
        [Qt][NRWT] Pass --timeout to DRT/WTR if a test is marked as SLOW.
4
        https://bugs.webkit.org/show_bug.cgi?id=90968.
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Added functionality in DRT and WTR to use any timeout value while running
9
        slow tests (eventually, any test). Now NRWT --time-out-ms determines the
10
        timeout value for the test. Added a flag in NRWT (supports_per_test_timeout)
11
        to indicate whether the current port supports setting timeout value
12
        per test (it's False by default; I enabled it only on Qt).
13
        Also corrected a typo in driver.py
14
15
        * DumpRenderTree/DumpRenderTree.h:
16
        (TestCommand::TestCommand):
17
        (TestCommand):
18
        * DumpRenderTree/DumpRenderTreeCommon.cpp:
19
        (parseInputLine):
20
        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
21
        (WebCore::DumpRenderTree::processLine):
22
        * Scripts/webkitpy/layout_tests/port/base.py:
23
        (Port.supports_per_test_timeout):
24
        * Scripts/webkitpy/layout_tests/port/driver.py:
25
        (Driver.run_test):
26
        (Driver._command_from_driver_input):
27
        * Scripts/webkitpy/layout_tests/port/qt.py:
28
        (QtPort.supports_per_test_timeout):
29
        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
30
        (WTR::InjectedBundle::InjectedBundle):
31
        (WTR::InjectedBundle::didReceiveMessage):
32
        (WTR::InjectedBundle::beginTesting):
33
        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
34
        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
35
        (WTR::TestRunner::setCustomTimeout):
36
        (WTR):
37
        * WebKitTestRunner/InjectedBundle/TestRunner.h:
38
        (TestRunner):
39
        * WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
40
        (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
41
        * WebKitTestRunner/TestController.cpp:
42
        (WTR::TestController::TestController):
43
        (WTR::TestController::getCustomTimeout):
44
        (WTR):
45
        (WTR::TestCommand::TestCommand):
46
        (TestCommand):
47
        (WTR::parseInputLine):
48
        (WTR::TestController::runTest):
49
        (WTR::TestController::runUntil):
50
        * WebKitTestRunner/TestController.h:
51
        (TestController):
52
        * WebKitTestRunner/TestInvocation.cpp:
53
        (WTR::TestInvocation::TestInvocation):
54
        (WTR::TestInvocation::setCustomTimeout):
55
        (WTR):
56
        (WTR::TestInvocation::invoke):
57
        * WebKitTestRunner/TestInvocation.h:
58
        (TestInvocation):
59
1
2012-11-29  Rafael Weinstein  <rafaelw@chromium.org>
60
2012-11-29  Rafael Weinstein  <rafaelw@chromium.org>
2
61
3
        [HTMLTemplateElement] Add feature flag
62
        [HTMLTemplateElement] Add feature flag
(-)a/Tools/DumpRenderTree/DumpRenderTree.h (-1 / +2 lines)
Lines 66-76 void dump(); Link Here
66
void displayWebView();
66
void displayWebView();
67
67
68
struct TestCommand {
68
struct TestCommand {
69
    TestCommand() : shouldDumpPixels(false) { }
69
    TestCommand() : shouldDumpPixels(false), timeout(30000) { }
70
70
71
    std::string pathOrURL;
71
    std::string pathOrURL;
72
    bool shouldDumpPixels;
72
    bool shouldDumpPixels;
73
    std::string expectedPixelHash;
73
    std::string expectedPixelHash;
74
    int timeout; // in ms
74
};
75
};
75
76
76
TestCommand parseInputLine(const std::string&);
77
TestCommand parseInputLine(const std::string&);
(-)a/Tools/DumpRenderTree/DumpRenderTreeCommon.cpp (-10 / +13 lines)
Lines 66-82 TestCommand parseInputLine(const std::string& inputLine) Link Here
66
    if (!tokenizer.hasNext())
66
    if (!tokenizer.hasNext())
67
        die(inputLine);
67
        die(inputLine);
68
68
69
    result.pathOrURL = tokenizer.next();
70
    if (!tokenizer.hasNext())
71
        return result;
72
73
    std::string arg = tokenizer.next();
69
    std::string arg = tokenizer.next();
74
    if (arg != std::string("-p") && arg != std::string("--pixel-test"))
70
    result.pathOrURL = arg;
75
        die(inputLine);
71
    while (tokenizer.hasNext()) {
76
    result.shouldDumpPixels = true;
72
        arg = tokenizer.next();
77
73
        if (arg == std::string("--timeout")) {
78
    if (tokenizer.hasNext())
74
            std::string timeoutToken = tokenizer.next();
79
        result.expectedPixelHash = tokenizer.next();
75
            result.timeout = atoi(timeoutToken.c_str());
76
        } else if (arg == std::string("-p") || arg == std::string("--pixel-test")) {
77
            result.shouldDumpPixels = true;
78
            if (tokenizer.hasNext())
79
                result.expectedPixelHash = tokenizer.next();
80
        } else
81
            die(inputLine);
82
    }
80
83
81
    return result;
84
    return result;
82
}
85
}
(-)a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp (+2 lines)
Lines 720-725 void DumpRenderTree::processLine(const QString &input) Link Here
720
        open(QUrl::fromLocalFile(fi.absoluteFilePath()));
720
        open(QUrl::fromLocalFile(fi.absoluteFilePath()));
721
    }
721
    }
722
722
723
    if (command.timeout > 0)
724
        setTimeout(command.timeout);
723
    fflush(stdout);
725
    fflush(stdout);
724
}
726
}
725
727
(-)a/Tools/Scripts/webkitpy/layout_tests/port/base.py (+3 lines)
Lines 150-155 class Port(object): Link Here
150
    def additional_drt_flag(self):
150
    def additional_drt_flag(self):
151
        return []
151
        return []
152
152
153
    def supports_per_test_timeout(self):
154
        return False
155
153
    def default_pixel_tests(self):
156
    def default_pixel_tests(self):
154
        # FIXME: Disable until they are run by default on build.webkit.org.
157
        # FIXME: Disable until they are run by default on build.webkit.org.
155
        return False
158
        return False
(-)a/Tools/Scripts/webkitpy/layout_tests/port/driver.py (-1 / +3 lines)
Lines 156-162 class Driver(object): Link Here
156
        the driver in an indeterminate state. The upper layers of the program
156
        the driver in an indeterminate state. The upper layers of the program
157
        are responsible for cleaning up and ensuring things are okay.
157
        are responsible for cleaning up and ensuring things are okay.
158
158
159
        Returns a DriverOuput object.
159
        Returns a DriverOutput object.
160
        """
160
        """
161
        start_time = time.time()
161
        start_time = time.time()
162
        self.start(driver_input.should_run_pixel_test, driver_input.args)
162
        self.start(driver_input.should_run_pixel_test, driver_input.args)
Lines 365-370 class Driver(object): Link Here
365
        assert not driver_input.image_hash or driver_input.should_run_pixel_test
365
        assert not driver_input.image_hash or driver_input.should_run_pixel_test
366
366
367
        # ' is the separator between arguments.
367
        # ' is the separator between arguments.
368
        if self._port.supports_per_test_timeout():
369
            command += "'--timeout'%s" % driver_input.timeout
368
        if driver_input.should_run_pixel_test:
370
        if driver_input.should_run_pixel_test:
369
            command += "'--pixel-test"
371
            command += "'--pixel-test"
370
        if driver_input.image_hash:
372
        if driver_input.image_hash:
(-)a/Tools/Scripts/webkitpy/layout_tests/port/qt.py (+3 lines)
Lines 80-85 class QtPort(Port): Link Here
80
        # The Qt port builds DRT as part of the main build step
80
        # The Qt port builds DRT as part of the main build step
81
        return True
81
        return True
82
82
83
    def supports_per_test_timeout(self):
84
        return True
85
83
    def _path_to_driver(self):
86
    def _path_to_driver(self):
84
        return self._build_path('bin/%s' % self.driver_name())
87
        return self._build_path('bin/%s' % self.driver_name())
85
88
(-)a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (+6 lines)
Lines 55-60 InjectedBundle::InjectedBundle() Link Here
55
    , m_dumpPixels(false)
55
    , m_dumpPixels(false)
56
    , m_useWaitToDumpWatchdogTimer(true)
56
    , m_useWaitToDumpWatchdogTimer(true)
57
    , m_useWorkQueue(false)
57
    , m_useWorkQueue(false)
58
    , m_timeout(0)
58
{
59
{
59
}
60
}
60
61
Lines 154-159 void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag Link Here
154
        WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey(AdoptWK, WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer"));
155
        WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey(AdoptWK, WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer"));
155
        m_useWaitToDumpWatchdogTimer = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, useWaitToDumpWatchdogTimerKey.get())));
156
        m_useWaitToDumpWatchdogTimer = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, useWaitToDumpWatchdogTimerKey.get())));
156
157
158
        WKRetainPtr<WKStringRef> timeoutKey(AdoptWK, WKStringCreateWithUTF8CString("Timeout"));
159
        m_timeout = (int)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeoutKey.get())));
160
157
        WKRetainPtr<WKStringRef> ackMessageName(AdoptWK, WKStringCreateWithUTF8CString("Ack"));
161
        WKRetainPtr<WKStringRef> ackMessageName(AdoptWK, WKStringCreateWithUTF8CString("Ack"));
158
        WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
162
        WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
159
        WKBundlePostMessage(m_bundle, ackMessageName.get(), ackMessageBody.get());
163
        WKBundlePostMessage(m_bundle, ackMessageName.get(), ackMessageBody.get());
Lines 267-272 void InjectedBundle::beginTesting(WKDictionaryRef settings) Link Here
267
    m_testRunner->setAcceptsEditing(true);
271
    m_testRunner->setAcceptsEditing(true);
268
    m_testRunner->setTabKeyCyclesThroughElements(true);
272
    m_testRunner->setTabKeyCyclesThroughElements(true);
269
273
274
    m_testRunner->setCustomTimeout(m_timeout);
275
270
    page()->prepare();
276
    page()->prepare();
271
277
272
    WKBundleClearAllDatabases(m_bundle);
278
    WKBundleClearAllDatabases(m_bundle);
(-)a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (+1 lines)
Lines 156-161 private: Link Here
156
    bool m_dumpPixels;
156
    bool m_dumpPixels;
157
    bool m_useWaitToDumpWatchdogTimer;
157
    bool m_useWaitToDumpWatchdogTimer;
158
    bool m_useWorkQueue;
158
    bool m_useWorkQueue;
159
    int m_timeout;
159
160
160
    WKRetainPtr<WKImageRef> m_pixelResult;
161
    WKRetainPtr<WKImageRef> m_pixelResult;
161
    WKRetainPtr<WKArrayRef> m_repaintRects;
162
    WKRetainPtr<WKArrayRef> m_repaintRects;
(-)a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (+5 lines)
Lines 166-171 void TestRunner::notifyDone() Link Here
166
    m_waitToDump = false;
166
    m_waitToDump = false;
167
}
167
}
168
168
169
void TestRunner::setCustomTimeout(int timeout)
170
{
171
    m_timeout = timeout;
172
}
173
169
unsigned TestRunner::numberOfActiveAnimations() const
174
unsigned TestRunner::numberOfActiveAnimations() const
170
{
175
{
171
    // FIXME: Is it OK this works only for the main frame?
176
    // FIXME: Is it OK this works only for the main frame?
(-)a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (+4 lines)
Lines 262-267 public: Link Here
262
262
263
    bool callShouldCloseOnWebView();
263
    bool callShouldCloseOnWebView();
264
264
265
    void setCustomTimeout(int duration);
266
265
    // Work queue.
267
    // Work queue.
266
    void queueBackNavigation(unsigned howFarBackward);
268
    void queueBackNavigation(unsigned howFarBackward);
267
    void queueForwardNavigation(unsigned howFarForward);
269
    void queueForwardNavigation(unsigned howFarForward);
Lines 314-319 private: Link Here
314
    bool m_globalFlag;
316
    bool m_globalFlag;
315
    bool m_customFullScreenBehavior;
317
    bool m_customFullScreenBehavior;
316
318
319
    int m_timeout;
320
317
    bool m_userStyleSheetEnabled;
321
    bool m_userStyleSheetEnabled;
318
    WKRetainPtr<WKStringRef> m_userStyleSheetLocation;
322
    WKRetainPtr<WKStringRef> m_userStyleSheetLocation;
319
323
(-)a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp (-1 / +6 lines)
Lines 74-86 void TestRunner::invalidateWaitToDumpWatchdogTimer() Link Here
74
74
75
void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
75
void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
76
{
76
{
77
    int timerInterval;
77
    if (qgetenv("QT_WEBKIT2_DEBUG") == "1")
78
    if (qgetenv("QT_WEBKIT2_DEBUG") == "1")
78
        return;
79
        return;
79
80
80
    if (m_waitToDumpWatchdogTimer.isActive())
81
    if (m_waitToDumpWatchdogTimer.isActive())
81
        return;
82
        return;
83
    if (m_timeout > 0)
84
        timerInterval = m_timeout;
85
    else
86
        timerInterval = waitToDumpWatchdogTimerInterval * 1000;
82
87
83
    m_waitToDumpWatchdogTimer.start(waitToDumpWatchdogTimerInterval * 1000);
88
    m_waitToDumpWatchdogTimer.start(timerInterval);
84
}
89
}
85
90
86
JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
91
JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
(-)a/Tools/WebKitTestRunner/TestController.cpp (-12 / +26 lines)
Lines 93-98 TestController::TestController(int argc, const char* argv[]) Link Here
93
    , m_noTimeout(defaultNoTimeout)
93
    , m_noTimeout(defaultNoTimeout)
94
    , m_useWaitToDumpWatchdogTimer(true)
94
    , m_useWaitToDumpWatchdogTimer(true)
95
    , m_forceNoTimeout(false)
95
    , m_forceNoTimeout(false)
96
    , m_timeout(0)
96
    , m_didPrintWebProcessCrashedMessage(false)
97
    , m_didPrintWebProcessCrashedMessage(false)
97
    , m_shouldExitWhenWebProcessCrashes(true)
98
    , m_shouldExitWhenWebProcessCrashes(true)
98
    , m_beforeUnloadReturnValue(true)
99
    , m_beforeUnloadReturnValue(true)
Lines 170-175 static void decidePolicyForGeolocationPermissionRequest(WKPageRef, WKFrameRef, W Link Here
170
    TestController::shared().handleGeolocationPermissionRequest(permissionRequest);
171
    TestController::shared().handleGeolocationPermissionRequest(permissionRequest);
171
}
172
}
172
173
174
int TestController::getCustomTimeout()
175
{
176
    return m_timeout;
177
}
178
173
WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*)
179
WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*)
174
{
180
{
175
    PlatformWebView* view = new PlatformWebView(WKPageGetContext(oldPage), WKPageGetPageGroup(oldPage));
181
    PlatformWebView* view = new PlatformWebView(WKPageGetContext(oldPage), WKPageGetPageGroup(oldPage));
Lines 586-596 bool TestController::resetStateToConsistentValues() Link Here
586
}
592
}
587
593
588
struct TestCommand {
594
struct TestCommand {
589
    TestCommand() : shouldDumpPixels(false) { }
595
    TestCommand() : shouldDumpPixels(false), timeout(0) { }
590
596
591
    std::string pathOrURL;
597
    std::string pathOrURL;
592
    bool shouldDumpPixels;
598
    bool shouldDumpPixels;
593
    std::string expectedPixelHash;
599
    std::string expectedPixelHash;
600
    int timeout;
594
};
601
};
595
602
596
class CommandTokenizer {
603
class CommandTokenizer {
Lines 652-669 TestCommand parseInputLine(const std::string& inputLine) Link Here
652
    if (!tokenizer.hasNext())
659
    if (!tokenizer.hasNext())
653
        die(inputLine);
660
        die(inputLine);
654
661
655
    result.pathOrURL = tokenizer.next();
656
    if (!tokenizer.hasNext())
657
        return result;
658
659
    std::string arg = tokenizer.next();
662
    std::string arg = tokenizer.next();
660
    if (arg != std::string("-p") && arg != std::string("--pixel-test"))
663
    result.pathOrURL = arg;
661
        die(inputLine);
664
    while (tokenizer.hasNext()) {
662
    result.shouldDumpPixels = true;
665
        arg = tokenizer.next();
663
666
        if (arg == std::string("--timeout")) {
664
    if (tokenizer.hasNext())
667
            std::string timeoutToken = tokenizer.next();
665
        result.expectedPixelHash = tokenizer.next();
668
            result.timeout = atoi(timeoutToken.c_str());
666
669
        } else if (arg == std::string("-p") || arg == std::string("--pixel-test")) {
670
            result.shouldDumpPixels = true;
671
            if (tokenizer.hasNext())
672
                result.expectedPixelHash = tokenizer.next();
673
        } else
674
            die(inputLine);
675
    }
667
    return result;
676
    return result;
668
}
677
}
669
678
Lines 676-681 bool TestController::runTest(const char* inputLine) Link Here
676
    m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL));
685
    m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL));
677
    if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests)
686
    if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests)
678
        m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
687
        m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
688
    if (command.timeout > 0)
689
        m_currentInvocation->setCustomTimeout(command.timeout);
679
690
680
    m_currentInvocation->invoke();
691
    m_currentInvocation->invoke();
681
    m_currentInvocation.clear();
692
    m_currentInvocation.clear();
Lines 727-732 void TestController::runUntil(bool& done, TimeoutDuration timeoutDuration) Link Here
727
        case LongTimeout:
738
        case LongTimeout:
728
            timeout = m_longTimeout;
739
            timeout = m_longTimeout;
729
            break;
740
            break;
741
        case CustomTimeout:
742
            timeout = m_timeout;
743
            break;
730
        case NoTimeout:
744
        case NoTimeout:
731
        default:
745
        default:
732
            timeout = m_noTimeout;
746
            timeout = m_noTimeout;
(-)a/Tools/WebKitTestRunner/TestController.h (-1 / +5 lines)
Lines 60-69 public: Link Here
60
    void ensureViewSupportsOptions(WKDictionaryRef options);
60
    void ensureViewSupportsOptions(WKDictionaryRef options);
61
    
61
    
62
    // Runs the run loop until `done` is true or the timeout elapses.
62
    // Runs the run loop until `done` is true or the timeout elapses.
63
    enum TimeoutDuration { ShortTimeout, LongTimeout, NoTimeout };
63
    enum TimeoutDuration { ShortTimeout, LongTimeout, NoTimeout, CustomTimeout };
64
    bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; }
64
    bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; }
65
    void runUntil(bool& done, TimeoutDuration);
65
    void runUntil(bool& done, TimeoutDuration);
66
    void notifyDone();
66
    void notifyDone();
67
68
    int getCustomTimeout();
67
    
69
    
68
    bool beforeUnloadReturnValue() const { return m_beforeUnloadReturnValue; }
70
    bool beforeUnloadReturnValue() const { return m_beforeUnloadReturnValue; }
69
    void setBeforeUnloadReturnValue(bool value) { m_beforeUnloadReturnValue = value; }
71
    void setBeforeUnloadReturnValue(bool value) { m_beforeUnloadReturnValue = value; }
Lines 166-171 private: Link Here
166
    bool m_useWaitToDumpWatchdogTimer;
168
    bool m_useWaitToDumpWatchdogTimer;
167
    bool m_forceNoTimeout;
169
    bool m_forceNoTimeout;
168
170
171
    int m_timeout;
172
169
    bool m_didPrintWebProcessCrashedMessage;
173
    bool m_didPrintWebProcessCrashedMessage;
170
    bool m_shouldExitWhenWebProcessCrashes;
174
    bool m_shouldExitWhenWebProcessCrashes;
171
    
175
    
(-)a/Tools/WebKitTestRunner/TestInvocation.cpp (-1 / +18 lines)
Lines 101-106 TestInvocation::TestInvocation(const std::string& pathOrURL) Link Here
101
    : m_url(AdoptWK, createWKURL(pathOrURL.c_str()))
101
    : m_url(AdoptWK, createWKURL(pathOrURL.c_str()))
102
    , m_pathOrURL(pathOrURL)
102
    , m_pathOrURL(pathOrURL)
103
    , m_dumpPixels(false)
103
    , m_dumpPixels(false)
104
    , m_timeout(0)
104
    , m_gotInitialResponse(false)
105
    , m_gotInitialResponse(false)
105
    , m_gotFinalMessage(false)
106
    , m_gotFinalMessage(false)
106
    , m_gotRepaint(false)
107
    , m_gotRepaint(false)
Lines 119-124 void TestInvocation::setIsPixelTest(const std::string& expectedPixelHash) Link Here
119
    m_expectedPixelHash = expectedPixelHash;
120
    m_expectedPixelHash = expectedPixelHash;
120
}
121
}
121
122
123
void TestInvocation::setCustomTimeout(int timeout)
124
{
125
    m_timeout = timeout;
126
}
127
122
static const unsigned w3cSVGWidth = 480;
128
static const unsigned w3cSVGWidth = 480;
123
static const unsigned w3cSVGHeight = 360;
129
static const unsigned w3cSVGHeight = 360;
124
static const unsigned normalWidth = 800;
130
static const unsigned normalWidth = 800;
Lines 189-194 static void updateLayoutType(const char* pathOrURL) Link Here
189
195
190
void TestInvocation::invoke()
196
void TestInvocation::invoke()
191
{
197
{
198
    TestController::TimeoutDuration timeoutToUse = TestController::LongTimeout;
192
    sizeWebViewForCurrentTest(m_pathOrURL.c_str());
199
    sizeWebViewForCurrentTest(m_pathOrURL.c_str());
193
    updateLayoutType(m_pathOrURL.c_str());
200
    updateLayoutType(m_pathOrURL.c_str());
194
    updateTiledDrawingForCurrentTest(m_pathOrURL.c_str());
201
    updateTiledDrawingForCurrentTest(m_pathOrURL.c_str());
Lines 208-213 void TestInvocation::invoke() Link Here
208
    WKRetainPtr<WKBooleanRef> useWaitToDumpWatchdogTimerValue = adoptWK(WKBooleanCreate(TestController::shared().useWaitToDumpWatchdogTimer()));
215
    WKRetainPtr<WKBooleanRef> useWaitToDumpWatchdogTimerValue = adoptWK(WKBooleanCreate(TestController::shared().useWaitToDumpWatchdogTimer()));
209
    WKDictionaryAddItem(beginTestMessageBody.get(), useWaitToDumpWatchdogTimerKey.get(), useWaitToDumpWatchdogTimerValue.get());
216
    WKDictionaryAddItem(beginTestMessageBody.get(), useWaitToDumpWatchdogTimerKey.get(), useWaitToDumpWatchdogTimerValue.get());
210
217
218
    WKRetainPtr<WKStringRef> timeoutKey = adoptWK(WKStringCreateWithUTF8CString("Timeout"));
219
    WKRetainPtr<WKUInt64Ref> timeoutValue = adoptWK(WKUInt64Create(m_timeout));
220
    WKDictionaryAddItem(beginTestMessageBody.get(), timeoutKey.get(), timeoutValue.get());
221
211
    WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get());
222
    WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get());
212
223
213
    TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout);
224
    TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout);
Lines 226-232 void TestInvocation::invoke() Link Here
226
237
227
    WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
238
    WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
228
239
229
    TestController::shared().runUntil(m_gotFinalMessage, TestController::shared().useWaitToDumpWatchdogTimer() ? TestController::LongTimeout : TestController::NoTimeout);
240
    if (TestController::shared().useWaitToDumpWatchdogTimer()) {
241
        if (m_timeout > 0)
242
            timeoutToUse = TestController::CustomTimeout;
243
    } else
244
        timeoutToUse = TestController::NoTimeout;
245
    TestController::shared().runUntil(m_gotFinalMessage, timeoutToUse);
246
230
    if (!m_gotFinalMessage) {
247
    if (!m_gotFinalMessage) {
231
        m_errorMessage = "Timed out waiting for final message from web process\n";
248
        m_errorMessage = "Timed out waiting for final message from web process\n";
232
        m_webProcessIsUnresponsive = true;
249
        m_webProcessIsUnresponsive = true;
(-)a/Tools/WebKitTestRunner/TestInvocation.h (+4 lines)
Lines 40-45 public: Link Here
40
40
41
    void setIsPixelTest(const std::string& expectedPixelHash);
41
    void setIsPixelTest(const std::string& expectedPixelHash);
42
42
43
    void setCustomTimeout(int duration);
44
43
    void invoke();
45
    void invoke();
44
    void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
46
    void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
45
    WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
47
    WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
Lines 61-66 private: Link Here
61
    bool m_dumpPixels;
63
    bool m_dumpPixels;
62
    std::string m_expectedPixelHash;
64
    std::string m_expectedPixelHash;
63
65
66
    int m_timeout;
67
64
    // Invocation state
68
    // Invocation state
65
    bool m_gotInitialResponse;
69
    bool m_gotInitialResponse;
66
    bool m_gotFinalMessage;
70
    bool m_gotFinalMessage;

Return to bug 90968