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 169-174
static void decidePolicyForGeolocationPermissionRequest(WKPageRef, WKFrameRef, W
Link Here
|
169 |
TestController::shared().handleGeolocationPermissionRequest(permissionRequest); |
170 |
TestController::shared().handleGeolocationPermissionRequest(permissionRequest); |
170 |
} |
171 |
} |
171 |
|
172 |
|
|
|
173 |
double TestController::getCustomTimeout() |
174 |
{ |
175 |
return m_timeout; |
176 |
} |
177 |
|
172 |
WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*) |
178 |
WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*) |
173 |
{ |
179 |
{ |
174 |
PlatformWebView* view = new PlatformWebView(WKPageGetContext(oldPage), WKPageGetPageGroup(oldPage)); |
180 |
PlatformWebView* view = new PlatformWebView(WKPageGetContext(oldPage), WKPageGetPageGroup(oldPage)); |
Lines 585-595
bool TestController::resetStateToConsistentValues()
Link Here
|
585 |
} |
591 |
} |
586 |
|
592 |
|
587 |
struct TestCommand { |
593 |
struct TestCommand { |
588 |
TestCommand() : shouldDumpPixels(false) { } |
594 |
TestCommand() : shouldDumpPixels(false), timeout(0) { } |
589 |
|
595 |
|
590 |
std::string pathOrURL; |
596 |
std::string pathOrURL; |
591 |
bool shouldDumpPixels; |
597 |
bool shouldDumpPixels; |
592 |
std::string expectedPixelHash; |
598 |
std::string expectedPixelHash; |
|
|
599 |
double timeout; |
593 |
}; |
600 |
}; |
594 |
|
601 |
|
595 |
class CommandTokenizer { |
602 |
class CommandTokenizer { |
Lines 651-667
TestCommand parseInputLine(const std::string& inputLine)
Link Here
|
651 |
if (!tokenizer.hasNext()) |
658 |
if (!tokenizer.hasNext()) |
652 |
die(inputLine); |
659 |
die(inputLine); |
653 |
|
660 |
|
654 |
result.pathOrURL = tokenizer.next(); |
|
|
655 |
if (!tokenizer.hasNext()) |
656 |
return result; |
657 |
|
658 |
std::string arg = tokenizer.next(); |
661 |
std::string arg = tokenizer.next(); |
659 |
if (arg != std::string("-p") && arg != std::string("--pixel-test")) |
662 |
result.pathOrURL = arg; |
660 |
die(inputLine); |
663 |
while (tokenizer.hasNext()) { |
661 |
result.shouldDumpPixels = true; |
664 |
arg = tokenizer.next(); |
662 |
|
665 |
if (arg == std::string("--timeout")) { |
663 |
if (tokenizer.hasNext()) |
666 |
std::string timeoutToken = tokenizer.next(); |
664 |
result.expectedPixelHash = tokenizer.next(); |
667 |
result.timeout = atof(timeoutToken.c_str()); |
|
|
668 |
} else if (arg == std::string("-p") || arg == std::string("--pixel-test")) { |
669 |
result.shouldDumpPixels = true; |
670 |
if (tokenizer.hasNext()) |
671 |
result.expectedPixelHash = tokenizer.next(); |
672 |
} else |
673 |
die(inputLine); |
674 |
} |
665 |
|
675 |
|
666 |
return result; |
676 |
return result; |
667 |
} |
677 |
} |
Lines 675-680
bool TestController::runTest(const char* inputLine)
Link Here
|
675 |
m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL)); |
685 |
m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL)); |
676 |
if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests) |
686 |
if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests) |
677 |
m_currentInvocation->setIsPixelTest(command.expectedPixelHash); |
687 |
m_currentInvocation->setIsPixelTest(command.expectedPixelHash); |
|
|
688 |
if (command.timeout > 0) |
689 |
m_currentInvocation->setCustomTimeout(command.timeout); |
678 |
|
690 |
|
679 |
m_currentInvocation->invoke(); |
691 |
m_currentInvocation->invoke(); |
680 |
m_currentInvocation.clear(); |
692 |
m_currentInvocation.clear(); |