WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-86927-20120717104528.patch (text/plain), 16.30 KB, created by
Xianzhu Wang
on 2012-07-17 10:45:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Xianzhu Wang
Created:
2012-07-17 10:45:29 PDT
Size:
16.30 KB
patch
obsolete
>Subversion Revision: 122782 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 55f89583903623f7cdfa2a4e14ce2839f3cde106..b0c38179add004d3bcc93787373db47fc7b7721e 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,36 @@ >+2012-07-17 Xianzhu Wang <wangxianzhu@chromium.org> >+ >+ [chromium] remove --test-shell support from DRT >+ https://bugs.webkit.org/show_bug.cgi?id=86927 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Now no one use --test-shell. All of us use the standard DRT mode. >+ >+ * DumpRenderTree/chromium/DumpRenderTree.cpp: Removed support of --test-shell and --pixel-tests=filename options. (--pixel-tests without '=' is kept for DRT mode.) >+ (runTest): >+ (main): >+ * DumpRenderTree/chromium/TestEventPrinter.cpp: >+ (TestEventPrinter::TestEventPrinter): >+ (TestEventPrinter::~TestEventPrinter): >+ (TestEventPrinter::handleTestHeader): >+ (TestEventPrinter::handleTimedOut): >+ (TestEventPrinter::handleTextHeader): >+ (TestEventPrinter::handleTextFooter): >+ (TestEventPrinter::handleAudioHeader): >+ (TestEventPrinter::handleAudioFooter): >+ (TestEventPrinter::handleImage): Removed the unused filename parameter. >+ (TestEventPrinter::handleTestFooter): >+ * DumpRenderTree/chromium/TestEventPrinter.h: >+ (TestEventPrinter): Made it a concrete class because we have only one implementation. >+ * DumpRenderTree/chromium/TestShell.cpp: >+ (TestShell::TestShell): >+ (TestShell::initialize): >+ (TestShell::dumpImage): >+ * DumpRenderTree/chromium/TestShell.h: >+ (TestParams): Removed pixelFileName field. >+ (TestShell): >+ > 2012-07-16 Xianzhu Wang <wangxianzhu@chromium.org> > > [Chromium-android] Don't use test_shell mode of DRT >diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp >index 7b1284d31d91b0bbe9520f5ec5721e4864e5762d..0a1faa36440acdf9977be81d9fac09e32d67d062 100644 >--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp >+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp >@@ -47,8 +47,6 @@ static const char optionThreaded[] = "--threaded"; > static const char optionDebugRenderTree[] = "--debug-render-tree"; > static const char optionDebugLayerTree[] = "--debug-layer-tree"; > >-static const char optionPixelTestsWithName[] = "--pixel-tests="; >-static const char optionTestShell[] = "--test-shell"; > static const char optionAllowExternalPages[] = "--allow-external-pages"; > static const char optionStartupDialog[] = "--testshell-startup-dialog"; > static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-deps"; >@@ -81,30 +79,15 @@ public: > } > }; > >-static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode) >+static void runTest(TestShell& shell, TestParams& params, const string& testName) > { > 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); >- } >+ 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); >@@ -136,7 +119,6 @@ int main(int argc, char* argv[]) > TestParams params; > Vector<string> tests; > bool serverMode = false; >- bool testShellMode = false; > bool allowExternalPages = false; > bool startupDialog = false; > bool acceleratedCompositingForVideoEnabled = false; >@@ -159,17 +141,11 @@ int main(int argc, char* argv[]) > params.dumpTree = false; > else if (argument == optionPixelTests) > params.dumpPixels = true; >- else if (!argument.find(optionPixelTestsWithName)) { >- params.dumpPixels = true; >- params.pixelFileName = argument.substr(strlen(optionPixelTestsWithName)); >- } else if (argument == optionDebugRenderTree) >+ else if (argument == optionDebugRenderTree) > params.debugRenderTree = true; > else if (argument == optionDebugLayerTree) > params.debugLayerTree = true; >- else if (argument == optionTestShell) { >- testShellMode = true; >- serverMode = true; >- } else if (argument == optionAllowExternalPages) >+ else if (argument == optionAllowExternalPages) > allowExternalPages = true; > else if (argument == optionStartupDialog) > startupDialog = true; >@@ -215,10 +191,6 @@ int main(int argc, char* argv[]) > else > tests.append(argument); > } >- if (testShellMode && params.dumpPixels && params.pixelFileName.empty()) { >- fprintf(stderr, "--pixel-tests with --test-shell requires a file name.\n"); >- return EXIT_FAILURE; >- } > if (stressOpt && stressDeopt) { > fprintf(stderr, "--stress-opt and --stress-deopt are mutually exclusive.\n"); > return EXIT_FAILURE; >@@ -231,7 +203,6 @@ int main(int argc, char* argv[]) > > { // Explicit scope for the TestShell instance. > TestShell shell; >- shell.setTestShellMode(testShellMode); > shell.setAllowExternalPages(allowExternalPages); > shell.setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); > shell.setThreadedCompositingEnabled(threadedCompositingEnabled); >@@ -265,14 +236,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, testShellMode); >+ runTest(shell, params, testString); > } > } 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], testShellMode); >+ runTest(shell, params, tests[i]); > } > > shell.callJSGC(); >diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp >index bb46506a8562c9f24658feac7f18752458ce1e88..9942dc208371e34c28b4f786de5eb9afdd7625b6 100644 >--- a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp >+++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp >@@ -36,83 +36,49 @@ > #include <wtf/Assertions.h> > #include <wtf/text/Base64.h> > >-class DRTPrinter : public TestEventPrinter { >-public: >- DRTPrinter() { } >- void handleTestHeader(const char* url) const; >- void handleTimedOut() const; >- void handleTextHeader() const; >- void handleTextFooter() const; >- void handleAudioHeader() const; >- void handleAudioFooter() const; >- void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const; >- void handleImageFooter() const; >- void handleTestFooter(bool dumpedAnything) const; >-}; >- >-class TestShellPrinter : public TestEventPrinter { >-public: >- TestShellPrinter() { } >- void handleTestHeader(const char* url) const; >- void handleTimedOut() const; >- void handleTextHeader() const; >- void handleTextFooter() const; >- void handleAudioHeader() const; >- void handleAudioFooter() const; >- void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const; >- void handleImageFooter() const; >- void handleTestFooter(bool dumpedAnything) const; >-}; >- >-TestEventPrinter::~TestEventPrinter() >-{ >-} >- >-PassOwnPtr<TestEventPrinter> TestEventPrinter::createDRTPrinter() >+TestEventPrinter::TestEventPrinter() > { >- return adoptPtr(new DRTPrinter); > } > >-PassOwnPtr<TestEventPrinter> TestEventPrinter::createTestShellPrinter() >+TestEventPrinter::~TestEventPrinter() > { >- return adoptPtr(new TestShellPrinter); > } > > // ---------------------------------------------------------------- > >-void DRTPrinter::handleTestHeader(const char*) const >+void TestEventPrinter::handleTestHeader(const char*) const > { > } > >-void DRTPrinter::handleTimedOut() const >+void TestEventPrinter::handleTimedOut() const > { > fprintf(stderr, "FAIL: Timed out waiting for notifyDone to be called\n"); > fprintf(stdout, "FAIL: Timed out waiting for notifyDone to be called\n"); > } > >-void DRTPrinter::handleTextHeader() const >+void TestEventPrinter::handleTextHeader() const > { > printf("Content-Type: text/plain\n"); > } > >-void DRTPrinter::handleTextFooter() const >+void TestEventPrinter::handleTextFooter() const > { > printf("#EOF\n"); > fprintf(stderr, "#EOF\n"); > } > >-void DRTPrinter::handleAudioHeader() const >+void TestEventPrinter::handleAudioHeader() const > { > printf("Content-Type: audio/wav\n"); > } > >-void DRTPrinter::handleAudioFooter() const >+void TestEventPrinter::handleAudioFooter() const > { > printf("#EOF\n"); > fprintf(stderr, "#EOF\n"); > } > >-void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char*) const >+void TestEventPrinter::handleImage(const char* actualHash, const char* expectedHash, const void* imageData, size_t imageSize) const > { > ASSERT(actualHash); > printf("\nActualHash: %s\n", actualHash); >@@ -139,63 +105,7 @@ void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, c > } > } > >-void DRTPrinter::handleTestFooter(bool) const >+void TestEventPrinter::handleTestFooter(bool) const > { > printf("#EOF\n"); > } >- >-// ---------------------------------------------------------------- >- >-void TestShellPrinter::handleTestHeader(const char* url) const >-{ >- printf("#URL:%s\n", url); >-} >- >-void TestShellPrinter::handleTimedOut() const >-{ >- puts("#TEST_TIMED_OUT\n"); >-} >- >-void TestShellPrinter::handleTextHeader() const >-{ >-} >- >-void TestShellPrinter::handleTextFooter() const >-{ >-} >- >-void TestShellPrinter::handleAudioHeader() const >-{ >- printf("Content-Type: audio/wav\n"); >-} >- >-void TestShellPrinter::handleAudioFooter() const >-{ >- printf("\n"); >-} >- >-void TestShellPrinter::handleImage(const char* actualHash, const char*, const unsigned char* imageData, size_t imageSize, const char* fileName) const >-{ >- ASSERT(actualHash); >- if (imageData && imageSize) { >- ASSERT(fileName); >- FILE* fp = fopen(fileName, "wb"); >- if (!fp) { >- perror(fileName); >- exit(EXIT_FAILURE); >- } >- if (fwrite(imageData, 1, imageSize, fp) != imageSize) { >- perror(fileName); >- fclose(fp); >- exit(EXIT_FAILURE); >- } >- fclose(fp); >- } >- printf("#MD5:%s\n", actualHash); >-} >- >-void TestShellPrinter::handleTestFooter(bool dumpedAnything) const >-{ >- if (dumpedAnything) >- printf("#EOF\n"); >-} >diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.h b/Tools/DumpRenderTree/chromium/TestEventPrinter.h >index 374827e189ca9ab1589d6ba36f79fc4895263842..cb88cd259391369e25efed518760b4c02e3ae5c4 100644 >--- a/Tools/DumpRenderTree/chromium/TestEventPrinter.h >+++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.h >@@ -35,18 +35,16 @@ > > class TestEventPrinter { > public: >- static PassOwnPtr<TestEventPrinter> createDRTPrinter(); >- static PassOwnPtr<TestEventPrinter> createTestShellPrinter(); >- >- virtual ~TestEventPrinter(); >- virtual void handleTestHeader(const char* url) const = 0; >- virtual void handleTimedOut() const = 0; >- virtual void handleTextHeader() const = 0; >- virtual void handleTextFooter() const = 0; >- virtual void handleAudioHeader() const = 0; >- virtual void handleAudioFooter() const = 0; >- virtual void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const = 0; >- virtual void handleTestFooter(bool dumpedAnything) const = 0; >+ TestEventPrinter(); >+ ~TestEventPrinter(); >+ void handleTestHeader(const char* url) const; >+ void handleTimedOut() const; >+ void handleTextHeader() const; >+ void handleTextFooter() const; >+ void handleAudioHeader() const; >+ void handleAudioFooter() const; >+ void handleImage(const char* actualHash, const char* expectedHash, const void* imageData, size_t imageSize) const; >+ void handleTestFooter(bool dumpedAnything) const; > }; > > #endif // TestEventPrinter_h >diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp >index 46bde2a9052417cf27e65a2bbfd26b82e0f16b9e..8165793d8ef524d47731489517e59f95b61ff5dd 100644 >--- a/Tools/DumpRenderTree/chromium/TestShell.cpp >+++ b/Tools/DumpRenderTree/chromium/TestShell.cpp >@@ -105,7 +105,6 @@ TestShell::TestShell() > : m_testIsPending(false) > , m_testIsPreparing(false) > , m_focusedWidget(0) >- , m_testShellMode(false) > , m_devTools(0) > , m_allowExternalPages(false) > , m_acceleratedCompositingForVideoEnabled(false) >@@ -155,7 +154,7 @@ void TestShell::initialize() > #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) > m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); > #endif >- m_printer = m_testShellMode ? TestEventPrinter::createTestShellPrinter() : TestEventPrinter::createDRTPrinter(); >+ m_printer = adoptPtr(new TestEventPrinter()); > #if ENABLE(LINK_PRERENDER) > m_prerenderingSupport = adoptPtr(new MockWebPrerenderingSupport()); > #endif >@@ -721,9 +720,9 @@ void TestShell::dumpImage(SkCanvas* canvas) const > sourceBitmap.height(), static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, md5hash, &png); > #endif > >- m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), &png[0], png.size(), m_params.pixelFileName.c_str()); >+ m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), &png[0], png.size()); > } else >- m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), 0, 0, m_params.pixelFileName.c_str()); >+ m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), 0, 0); > } > > void TestShell::bindJSObjectsToWindow(WebFrame* frame) >diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h >index 8ae0c2421884ea05b02d119597f2289dafc5b590..2a872e614257cd58e9cec60a055c8049f0ead342 100644 >--- a/Tools/DumpRenderTree/chromium/TestShell.h >+++ b/Tools/DumpRenderTree/chromium/TestShell.h >@@ -69,8 +69,6 @@ struct TestParams { > bool debugLayerTree; > bool printSeparators; > WebKit::WebURL testUrl; >- // Resultant image file name. Required only if the test_shell mode. >- std::string pixelFileName; > std::string pixelHash; > > TestParams() >@@ -135,7 +133,6 @@ public: > bool allowExternalPages() const { return m_allowExternalPages; } > void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } > >- void setTestShellMode(bool testShellMode) { m_testShellMode = testShellMode; } > void setAcceleratedCompositingForVideoEnabled(bool enabled) { m_acceleratedCompositingForVideoEnabled = enabled; } > void setThreadedCompositingEnabled(bool enabled) { m_threadedCompositingEnabled = enabled; } > void setForceCompositingMode(bool enabled) { m_forceCompositingMode = enabled; } >@@ -207,7 +204,6 @@ private: > bool m_isLoading; > WebKit::WebView* m_webView; > WebKit::WebWidget* m_focusedWidget; >- bool m_testShellMode; > WebViewHost* m_devTools; > > // Be careful of the destruction order of the following objects.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 86927
: 152782