2011-04-05 Chang Shu <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.numberOfPages
        https://bugs.webkit.org/show_bug.cgi?id=42694

        Unskip passed tests.

        * platform/mac-wk2/Skipped:
        * platform/qt-wk2/Skipped:
2011-04-05  Chang Shu  <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.numberOfPages
        https://bugs.webkit.org/show_bug.cgi?id=42694

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleNumberOfPages):
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::numberOfPages):
        * WebProcess/InjectedBundle/InjectedBundle.h:
2011-04-05  Chang Shu  <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.numberOfPages
        https://bugs.webkit.org/show_bug.cgi?id=42694

        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
        (WTR::LayoutTestController::numberOfPages):
        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:

git-svn-id: svn://svn.chromium.org/blink/trunk@83010 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5c55b029
2011-04-05 Chang Shu <cshu@webkit.org>
Reviewed by Darin Adler.
WebKitTestRunner needs layoutTestController.numberOfPages
https://bugs.webkit.org/show_bug.cgi?id=42694
Unskip passed tests.
* platform/mac-wk2/Skipped:
* platform/qt-wk2/Skipped:
2011-04-05 Adrienne Walker <enne@google.com>
Unreviewed, temporarily mark two tests as more generally failing.
......@@ -1447,11 +1447,6 @@ printing/page-rule-in-media-query.html
printing/setPrinting.html
printing/simultaneous-position-float-change.html
# WebKitTestRunner needs layoutTestController.numberOfPages
# <https://bugs.webkit.org/show_bug.cgi?id=42694>
printing/numberOfPages.html
printing/stretch-to-view-height.html
# WebKitTestRunner needs layoutTestController.isPageBoxVisible
# <https://bugs.webkit.org/show_bug.cgi?id=42695>
printing/page-format-data.html
......
......@@ -1834,11 +1834,6 @@ printing/media-queries-print.html
printing/page-rule-in-media-query.html
printing/setPrinting.html
# WebKitTestRunner needs layoutTestController.numberOfPages
# <https://bugs.webkit.org/show_bug.cgi?id=42694>
printing/numberOfPages.html
printing/stretch-to-view-height.html
# WebKitTestRunner needs layoutTestController.isPageBoxVisible
# <https://bugs.webkit.org/show_bug.cgi?id=42695>
printing/page-format-data.html
......
2011-04-05 Chang Shu <cshu@webkit.org>
Reviewed by Darin Adler.
WebKitTestRunner needs layoutTestController.numberOfPages
https://bugs.webkit.org/show_bug.cgi?id=42694
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleNumberOfPages):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::numberOfPages):
* WebProcess/InjectedBundle/InjectedBundle.h:
2011-04-05 Darin Adler <darin@apple.com>
Reviewed by Alexey Proskuryakov.
......
......@@ -152,3 +152,8 @@ void WKBundleSetDatabaseQuota(WKBundleRef bundleRef, uint64_t quota)
{
toImpl(bundleRef)->setDatabaseQuota(quota);
}
int WKBundleNumberOfPages(WKBundleRef bundleRef, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels)
{
return toImpl(bundleRef)->numberOfPages(toImpl(frameRef), pageWidthInPixels, pageHeightInPixels);
}
......@@ -69,6 +69,7 @@ WK_EXPORT void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKB
WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
WK_EXPORT int WKBundleNumberOfPages(WKBundleRef bundle, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels);
#ifdef __cplusplus
}
......
......@@ -36,15 +36,19 @@
#include "WebContextMessageKinds.h"
#include "WebCoreArgumentCoders.h"
#include "WebDatabaseManager.h"
#include "WebFrame.h"
#include "WebPage.h"
#include "WebPreferencesStore.h"
#include "WebProcess.h"
#include <JavaScriptCore/APICast.h>
#include <JavaScriptCore/JSLock.h>
#include <WebCore/Frame.h>
#include <WebCore/FrameView.h>
#include <WebCore/GCController.h>
#include <WebCore/JSDOMWindow.h>
#include <WebCore/Page.h>
#include <WebCore/PageGroup.h>
#include <WebCore/PrintContext.h>
#include <WebCore/Settings.h>
#include <wtf/OwnArrayPtr.h>
#include <wtf/PassOwnArrayPtr.h>
......@@ -141,6 +145,19 @@ void InjectedBundle::setDatabaseQuota(uint64_t quota)
WebDatabaseManager::shared().setQuotaForOrigin("file:///", quota);
}
int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels)
{
Frame* coreFrame = frame ? frame->coreFrame() : 0;
if (!coreFrame)
return -1;
if (!pageWidthInPixels)
pageWidthInPixels = coreFrame->view()->width();
if (!pageHeightInPixels)
pageHeightInPixels = coreFrame->view()->height();
return PrintContext::numberOfPages(coreFrame, FloatSize(pageWidthInPixels, pageHeightInPixels));
}
static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
{
if (!patterns)
......
......@@ -60,6 +60,7 @@ typedef void* PlatformBundle;
class ImmutableArray;
class InjectedBundleScriptWorld;
class WebCertificateInfo;
class WebFrame;
class WebPage;
class WebPageGroupProxy;
......@@ -92,6 +93,7 @@ public:
void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled);
void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool);
void setAllowFileAccessFromFileURLs(WebPageGroupProxy*, bool);
int numberOfPages(WebFrame*, double, double);
// UserContent API
void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames);
......
2011-04-05 Chang Shu <cshu@webkit.org>
Reviewed by Darin Adler.
WebKitTestRunner needs layoutTestController.numberOfPages
https://bugs.webkit.org/show_bug.cgi?id=42694
* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::numberOfPages):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
2011-04-05 Tony Chang <tony@chromium.org>
Reviewed by Mihai Parparita.
......
......@@ -64,6 +64,9 @@ module WTR {
void repaintSweepHorizontally();
void display();
// Printing
int numberOfPages(in double pageWidthInPixels, in double pageHeightInPixels);
// Animation testing.
int numberOfActiveAnimations();
boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);
......
......@@ -29,7 +29,9 @@
#include "InjectedBundle.h"
#include "InjectedBundlePage.h"
#include "JSLayoutTestController.h"
#include "PlatformWebView.h"
#include "StringFunctions.h"
#include "TestController.h"
#include <WebKit2/WKBundleBackForwardList.h>
#include <WebKit2/WKBundleFrame.h>
#include <WebKit2/WKBundleFramePrivate.h>
......@@ -323,6 +325,12 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
WKBundleSetAllowFileAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
}
int LayoutTestController::numberOfPages(double pageWidthInPixels, double pageHeightInPixels)
{
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
return WKBundleNumberOfPages(InjectedBundle::shared().bundle(), mainFrame, pageWidthInPixels, pageHeightInPixels);
}
unsigned LayoutTestController::windowCount()
{
return InjectedBundle::shared().pageCount();
......
......@@ -112,6 +112,9 @@ public:
void clearAllDatabases();
void setDatabaseQuota(uint64_t);
// Printing
int numberOfPages(double pageWidthInPixels, double pageHeightInPixels);
enum WhatToDump { RenderTree, MainFrameText, AllFramesText };
WhatToDump whatToDump() const { return m_whatToDump; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment