static void runTest(TestShell& shell, TestParams& params, const string& inputLine, const bool forceDumpPixels) { int oldTimeoutMsec = shell.layoutTestTimeout(); TestCommand command = parseInputLine(inputLine); params.testUrl = webkit_support::CreateURLForPathOrURL(command.pathOrURL); params.pixelHash = command.shouldDumpPixels; webkit_support::SetCurrentDirectoryForFileURL(params.testUrl); v8::V8::SetFlagsFromString(shell.javaScriptFlags().c_str(), shell.javaScriptFlags().length()); if (shell.stressOpt() || shell.stressDeopt()) { if (shell.stressOpt()) v8::Testing::SetStressRunType(v8::Testing::kStressTypeOpt); else v8::Testing::SetStressRunType(v8::Testing::kStressTypeDeopt); for (int i = 0; i < v8::Testing::GetStressRuns(); i++) { v8::Testing::PrepareStressRun(i); bool isLastLoad = (i == (v8::Testing::GetStressRuns() - 1)); shell.setDumpWhenFinished(isLastLoad); shell.resetTestController(); shell.runFileTest(params, command.shouldDumpPixels || forceDumpPixels); } } else { shell.resetTestController(); shell.runFileTest(params, command.shouldDumpPixels || forceDumpPixels); } shell.setLayoutTestTimeout(oldTimeoutMsec); }
static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode) { int oldTimeoutMsec = shell.layoutTestTimeout(); params.pixelHash = ""; string pathOrURL = testName; if (testShellMode) { string timeOut; string::size_type separatorPosition = pathOrURL.find(' '); if (separatorPosition != string::npos) { timeOut = pathOrURL.substr(separatorPosition + 1); pathOrURL.erase(separatorPosition); separatorPosition = timeOut.find_first_of(' '); if (separatorPosition != string::npos) { params.pixelHash = timeOut.substr(separatorPosition + 1); timeOut.erase(separatorPosition); } shell.setLayoutTestTimeout(atoi(timeOut.c_str())); } } else { string::size_type separatorPosition = pathOrURL.find("'"); if (separatorPosition != string::npos) { params.pixelHash = pathOrURL.substr(separatorPosition + 1); pathOrURL.erase(separatorPosition); } } params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL); webkit_support::SetCurrentDirectoryForFileURL(params.testUrl); shell.resetTestController(); shell.runFileTest(params); shell.setLayoutTestTimeout(oldTimeoutMsec); }
static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode) { int oldTimeoutMsec = shell.layoutTestTimeout(); params.pixelHash = ""; string pathOrURL = testName; if (testShellMode) { string timeOut; string::size_type separatorPosition = pathOrURL.find(' '); if (separatorPosition != string::npos) { timeOut = pathOrURL.substr(separatorPosition + 1); pathOrURL.erase(separatorPosition); separatorPosition = timeOut.find_first_of(' '); if (separatorPosition != string::npos) { params.pixelHash = timeOut.substr(separatorPosition + 1); timeOut.erase(separatorPosition); } shell.setLayoutTestTimeout(atoi(timeOut.c_str())); } } else { string::size_type separatorPosition = pathOrURL.find("'"); if (separatorPosition != string::npos) { params.pixelHash = pathOrURL.substr(separatorPosition + 1); pathOrURL.erase(separatorPosition); } } params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL); webkit_support::SetCurrentDirectoryForFileURL(params.testUrl); v8::V8::SetFlagsFromString(shell.javaScriptFlags().c_str(), shell.javaScriptFlags().length()); if (shell.stressOpt() || shell.stressDeopt()) { if (shell.stressOpt()) v8::Testing::SetStressRunType(v8::Testing::kStressTypeOpt); else v8::Testing::SetStressRunType(v8::Testing::kStressTypeDeopt); for (int i = 0; i < v8::Testing::GetStressRuns(); i++) { v8::Testing::PrepareStressRun(i); bool isLastLoad = (i == (v8::Testing::GetStressRuns() - 1)); shell.setDumpWhenFinished(isLastLoad); shell.resetTestController(); shell.runFileTest(params); } } else { shell.resetTestController(); shell.runFileTest(params); } shell.setLayoutTestTimeout(oldTimeoutMsec); }
static void runTest(TestShell& shell, TestParams& params, const string& testName) { string pathOrURL = testName; string::size_type separatorPosition = pathOrURL.find("'"); if (separatorPosition != string::npos) { params.pixelHash = pathOrURL.substr(separatorPosition + 1); pathOrURL.erase(separatorPosition); } params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL); shell.resetTestController(); shell.runFileTest(params); }