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; |