summaryrefslogtreecommitdiff
path: root/Tools/DumpRenderTree
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-20 21:53:03 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-20 21:53:03 +0200
commit171053e5e2efcdc6854d8b3a0d06934fb309e53d (patch)
treec85f2b00cea9c5b648ad9945be3155d29d96395f /Tools/DumpRenderTree
parent0b3dc81d9701aea106543b49bde511a5697cdd6e (diff)
downloadqtwebkit-171053e5e2efcdc6854d8b3a0d06934fb309e53d.tar.gz
Imported WebKit commit f35955d976484e57fd83612794aefd58fdaa6337 (http://svn.webkit.org/repository/webkit/trunk@129155)
New snapshot with prospective build fix
Diffstat (limited to 'Tools/DumpRenderTree')
-rw-r--r--Tools/DumpRenderTree/chromium/DumpRenderTree.cpp16
-rw-r--r--Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp6
2 files changed, 16 insertions, 6 deletions
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
index bee1777c6..0949aa7a6 100644
--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -43,7 +43,8 @@
using namespace std;
static const char optionComplexText[] = "--complex-text";
-static const char optionDumpAllPixels[] = "--dump-all-pixels";
+static const char optionDumpPixels[] = "--pixel-tests";
+static const char optionDumpPixelsShortForm[] = "-p";
static const char optionNotree[] = "--notree";
static const char optionThreaded[] = "--threaded";
static const char optionDebugRenderTree[] = "--debug-render-tree";
@@ -85,7 +86,7 @@ private:
OwnPtr<MockWebKitPlatformSupport> m_mockPlatform;
};
-static void runTest(TestShell& shell, TestParams& params, const string& inputLine)
+static void runTest(TestShell& shell, TestParams& params, const string& inputLine, const bool forceDumpPixels)
{
int oldTimeoutMsec = shell.layoutTestTimeout();
TestCommand command = parseInputLine(inputLine);
@@ -103,11 +104,11 @@ static void runTest(TestShell& shell, TestParams& params, const string& inputLin
bool isLastLoad = (i == (v8::Testing::GetStressRuns() - 1));
shell.setDumpWhenFinished(isLastLoad);
shell.resetTestController();
- shell.runFileTest(params, command.shouldDumpPixels);
+ shell.runFileTest(params, command.shouldDumpPixels || forceDumpPixels);
}
} else {
shell.resetTestController();
- shell.runFileTest(params, command.shouldDumpPixels);
+ shell.runFileTest(params, command.shouldDumpPixels || forceDumpPixels);
}
shell.setLayoutTestTimeout(oldTimeoutMsec);
}
@@ -120,6 +121,7 @@ int main(int argc, char* argv[])
TestParams params;
Vector<string> tests;
bool serverMode = false;
+ bool dumpAllPixels = false;
bool allowExternalPages = false;
bool startupDialog = false;
bool acceleratedCompositingForVideoEnabled = false;
@@ -139,6 +141,8 @@ int main(int argc, char* argv[])
string argument(argv[i]);
if (argument == "-")
serverMode = true;
+ else if (argument == optionDumpPixels || argument == optionDumpPixelsShortForm)
+ dumpAllPixels = true;
else if (argument == optionNotree)
params.dumpTree = false;
else if (argument == optionDebugRenderTree)
@@ -239,14 +243,14 @@ int main(int argc, char* argv[])
// Explicitly quit on platforms where EOF is not reliable.
if (!strcmp(testString, "QUIT"))
break;
- runTest(shell, params, testString);
+ runTest(shell, params, testString, dumpAllPixels);
}
} else if (!tests.size())
puts("#EOF");
else {
params.printSeparators = tests.size() > 1;
for (unsigned i = 0; i < tests.size(); i++)
- runTest(shell, params, tests[i]);
+ runTest(shell, params, tests[i], dumpAllPixels);
}
shell.callJSGC();
diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
index 4efeb82d3..a373c3b30 100644
--- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
+++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
@@ -33,6 +33,7 @@
#include "WebUserMediaClientMock.h"
+#include "WebDocument.h"
#include "WebMediaStreamRegistry.h"
#include "WebUserMediaRequest.h"
#include "platform/WebMediaStreamDescriptor.h"
@@ -57,6 +58,11 @@ void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamR
ASSERT(!streamRequest.isNull());
WebUserMediaRequest request = streamRequest;
+ if (request.ownerDocument().isNull() || !request.ownerDocument().frame()) {
+ request.requestFailed();
+ return;
+ }
+
const size_t zero = 0;
const size_t one = 1;
WebVector<WebMediaStreamSource> audioSources(request.audio() ? one : zero);