From 053cb189d46f6e17288d3b917ace0abe9817d6ce Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Sat, 26 Jun 2010 17:23:42 +0000 Subject: [PATCH] 2010-06-26 Sheriff Bot Unreviewed, rolling out r61943. http://trac.webkit.org/changeset/61943 https://bugs.webkit.org/show_bug.cgi?id=41251 Totally breaks webkit_unit_tests on Chromium linux and mac (Requested by mnaganov on #webkit). * WebKit.gyp: * src/WebFrameImpl.cpp: (WebKit::frameContentAsPlainText): * tests/RunAllTests.cpp: (main): * tests/WebFrameTest.cpp: Removed. * tests/data/iframes_test.html: Removed. * tests/data/invisible_iframe.html: Removed. * tests/data/visible_iframe.html: Removed. * tests/data/zero_sized_iframe.html: Removed. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61957 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/chromium/ChangeLog | 20 ++++ WebKit/chromium/WebKit.gyp | 2 - WebKit/chromium/src/WebFrameImpl.cpp | 9 -- WebKit/chromium/tests/RunAllTests.cpp | 17 +-- WebKit/chromium/tests/WebFrameTest.cpp | 112 ------------------ WebKit/chromium/tests/data/iframes_test.html | 10 -- .../chromium/tests/data/invisible_iframe.html | 6 - .../chromium/tests/data/visible_iframe.html | 5 - .../tests/data/zero_sized_iframe.html | 5 - 9 files changed, 30 insertions(+), 156 deletions(-) delete mode 100644 WebKit/chromium/tests/WebFrameTest.cpp delete mode 100644 WebKit/chromium/tests/data/iframes_test.html delete mode 100644 WebKit/chromium/tests/data/invisible_iframe.html delete mode 100644 WebKit/chromium/tests/data/visible_iframe.html delete mode 100644 WebKit/chromium/tests/data/zero_sized_iframe.html diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 556d80730e68..76dfe2b2fe50 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,23 @@ +2010-06-26 Sheriff Bot + + Unreviewed, rolling out r61943. + http://trac.webkit.org/changeset/61943 + https://bugs.webkit.org/show_bug.cgi?id=41251 + + Totally breaks webkit_unit_tests on Chromium linux and mac + (Requested by mnaganov on #webkit). + + * WebKit.gyp: + * src/WebFrameImpl.cpp: + (WebKit::frameContentAsPlainText): + * tests/RunAllTests.cpp: + (main): + * tests/WebFrameTest.cpp: Removed. + * tests/data/iframes_test.html: Removed. + * tests/data/invisible_iframe.html: Removed. + * tests/data/visible_iframe.html: Removed. + * tests/data/zero_sized_iframe.html: Removed. + 2010-06-26 Tony Gentilcore Reviewed by Dimitri Glazkov. diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 507107ae5a1f..d9d16645c4d3 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -559,7 +559,6 @@ '<(chromium_src_dir)/testing/gtest.gyp:gtest', '<(chromium_src_dir)/base/base.gyp:base', '<(chromium_src_dir)/base/base.gyp:base_i18n', - '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', ], 'include_dirs': [ @@ -571,7 +570,6 @@ 'tests/KeyboardTest.cpp', 'tests/KURLTest.cpp', 'tests/RunAllTests.cpp', - 'tests/WebFrameTest.cpp', ], 'conditions': [ ['OS=="win"', { diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index 89188974c3d0..c5fa1fe834f1 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -233,15 +233,6 @@ static void frameContentAsPlainText(size_t maxChars, Frame* frame, // Recursively walk the children. FrameTree* frameTree = frame->tree(); for (Frame* curChild = frameTree->firstChild(); curChild; curChild = curChild->tree()->nextSibling()) { - // Ignore the text of non-visible frames. - RenderView* contentRenderer = curChild->contentRenderer(); - RenderPart* ownerRenderer = curChild->ownerRenderer(); - if (!contentRenderer || !contentRenderer->width() || !contentRenderer->height() - || (contentRenderer->x() + contentRenderer->width() <= 0) || (contentRenderer->y() + contentRenderer->height() <= 0) - || (ownerRenderer && ownerRenderer->style() && ownerRenderer->style()->visibility() != VISIBLE)) { - continue; - } - // Make sure the frame separator won't fill up the buffer, and give up if // it will. The danger is if the separator will make the buffer longer than // maxChars. This will cause the computation above: diff --git a/WebKit/chromium/tests/RunAllTests.cpp b/WebKit/chromium/tests/RunAllTests.cpp index cfcfbeec5769..0f3f82fb7c8b 100644 --- a/WebKit/chromium/tests/RunAllTests.cpp +++ b/WebKit/chromium/tests/RunAllTests.cpp @@ -33,15 +33,18 @@ #include "WebKit.h" #include "WebKitClient.h" -#include + +// WebKitClient has a protected destructor, so we need to subclass. +class DummyWebKitClient : public WebKit::WebKitClient { +}; int main(int argc, char** argv) { - TestSuite testSuite(argc, argv); - // TestSuite must be created before SetUpTestEnvironment so it performs - // initializations needed by WebKit support. - webkit_support::SetUpTestEnvironmentForUnitTests(); - int result = testSuite.Run(); - webkit_support::TearDownTestEnvironment(); + DummyWebKitClient dummyClient; + WebKit::initialize(&dummyClient); + + int result = TestSuite(argc, argv).Run(); + + WebKit::shutdown(); return result; } diff --git a/WebKit/chromium/tests/WebFrameTest.cpp b/WebKit/chromium/tests/WebFrameTest.cpp deleted file mode 100644 index f5821048cee3..000000000000 --- a/WebKit/chromium/tests/WebFrameTest.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include "WebFrame.h" -#include "WebFrameClient.h" -#include "WebString.h" -#include "WebURL.h" -#include "WebURLRequest.h" -#include "WebURLResponse.h" -#include "WebView.h" - -using namespace WebKit; - -namespace { - -class WebFrameTest : public testing::Test { -public: - WebFrameTest() {} - - virtual void TearDown() - { - webkit_support::UnregisterAllMockedURLs(); - } - - void registerMockedURLLoad(const WebURL& url, const WebURLResponse& response, const WebString& fileName) - { - std::string filePath = webkit_support::GetWebKitRootDir().utf8(); - filePath.append("/WebKit/chromium/tests/data/"); - filePath.append(fileName.utf8()); - webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath)); - } - - void serveRequests() - { - webkit_support::ServeAsynchronousMockedRequests(); - } -}; - -class TestWebFrameClient : public WebFrameClient { -}; - -TEST_F(WebFrameTest, ContentText) -{ - // Register our resources. - WebURLResponse response; - response.initialize(); - response.setMIMEType("text/html"); - std::string rootURL = "http://www.test.com/"; - const char* files[] = { "iframes_test.html", "visible_iframe.html", - "invisible_iframe.html", "zero_sized_iframe.html" }; - for (int i = 0; i < (sizeof(files) / sizeof(char*)); ++i) { - WebURL webURL = GURL(rootURL + files[i]); - registerMockedURLLoad(webURL, response, WebString::fromUTF8(files[i])); - } - - // Create and initialize the WebView. - TestWebFrameClient webFrameClient; - WebView* webView = WebView::create(0); - webView->initializeMainFrame(&webFrameClient); - - // Load the main frame URL. - WebURL testURL(GURL(rootURL + files[0])); - WebURLRequest urlRequest; - urlRequest.initialize(); - urlRequest.setURL(testURL); - webView->mainFrame()->loadRequest(urlRequest); - - // Load all pending asynchronous requests. - serveRequests(); - - // Now retrieve the frames text and test it only includes visible elements. - std::string content = webView->mainFrame()->contentAsText(1024).utf8(); - EXPECT_NE(std::string::npos, content.find(" visible paragraph")); - EXPECT_NE(std::string::npos, content.find(" visible iframe")); - EXPECT_EQ(std::string::npos, content.find(" invisible pararaph")); - EXPECT_EQ(std::string::npos, content.find(" invisible iframe")); - EXPECT_EQ(std::string::npos, content.find("iframe with zero size")); - - webView->close(); -} - -} diff --git a/WebKit/chromium/tests/data/iframes_test.html b/WebKit/chromium/tests/data/iframes_test.html deleted file mode 100644 index 85d229a1da71..000000000000 --- a/WebKit/chromium/tests/data/iframes_test.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -

This is a visible paragraph.

-

This is an invisible paragraph.

- - - diff --git a/WebKit/chromium/tests/data/invisible_iframe.html b/WebKit/chromium/tests/data/invisible_iframe.html deleted file mode 100644 index 3304aecc17b2..000000000000 --- a/WebKit/chromium/tests/data/invisible_iframe.html +++ /dev/null @@ -1,6 +0,0 @@ - - - This is an invisible frame. - - - diff --git a/WebKit/chromium/tests/data/visible_iframe.html b/WebKit/chromium/tests/data/visible_iframe.html deleted file mode 100644 index 291af3d1b84f..000000000000 --- a/WebKit/chromium/tests/data/visible_iframe.html +++ /dev/null @@ -1,5 +0,0 @@ - - - This is a visible iframe. - - diff --git a/WebKit/chromium/tests/data/zero_sized_iframe.html b/WebKit/chromium/tests/data/zero_sized_iframe.html deleted file mode 100644 index 6728cab6a605..000000000000 --- a/WebKit/chromium/tests/data/zero_sized_iframe.html +++ /dev/null @@ -1,5 +0,0 @@ - - - This is an iframe with zero size. - - -- 2.36.0