Changeset 93235 in webkit


Ignore:
Timestamp:
Aug 17, 2011 12:59:57 PM (13 years ago)
Author:
chang.shu@nokia.com
Message:

2011-08-16 Chang Shu <cshu@webkit.org>

Support reset in WebCore::Internals
https://bugs.webkit.org/show_bug.cgi?id=66307

Reviewed by Dimitri Glazkov.

New tests will be added when function reset is implemented.

Added framework code in WebCoreTestSupport. The real implementation of
Internals::reset() depends on the need from the settings that require a reset.

  • testing/Internals.cpp: (WebCore::Internals::reset):
  • testing/Internals.h:
  • testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::resetInternalsObject):
  • testing/js/WebCoreTestSupport.h:
  • testing/v8/WebCoreTestSupport.cpp: (WebCoreTestSupport::resetInternalsObject):
  • testing/v8/WebCoreTestSupport.h:

2011-08-16 Chang Shu <cshu@webkit.org>

Support reset in WebCore::Internals
https://bugs.webkit.org/show_bug.cgi?id=66307

Reviewed by Dimitri Glazkov.

Added framework code in WebKit.

  • public/WebTestingSupport.h:
  • src/WebTestingSupport.cpp: (WebKit::WebTestingSupport::resetInternalsObject):

2011-08-16 Chang Shu <cshu@webkit.org>

Support reset in WebCore::Internals
https://bugs.webkit.org/show_bug.cgi?id=66307

Reviewed by Dimitri Glazkov.

Added framework code in WebKit.

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp: (DumpRenderTreeSupportQt::resetInternalsObject):
  • WebCoreSupport/DumpRenderTreeSupportQt.h:

2011-08-16 Chang Shu <cshu@webkit.org>

Support reset in WebCore::Internals
https://bugs.webkit.org/show_bug.cgi?id=66307

Reviewed by Dimitri Glazkov.

Added call to resetInternalsObject in DRT.

  • DumpRenderTree/chromium/TestShell.cpp: (TestShell::resetTestController):
  • DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting):
  • DumpRenderTree/qt/DumpRenderTreeQt.cpp: (WebCore::WebPage::resetSettings):
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93229 r93235  
     12011-08-16  Chang Shu  <cshu@webkit.org>
     2
     3        Support reset in WebCore::Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=66307
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        New tests will be added when function reset is implemented.
     9
     10        Added framework code in WebCoreTestSupport. The real implementation of
     11        Internals::reset() depends on the need from the settings that require a reset.
     12
     13        * testing/Internals.cpp:
     14        (WebCore::Internals::reset):
     15        * testing/Internals.h:
     16        * testing/js/WebCoreTestSupport.cpp:
     17        (WebCoreTestSupport::resetInternalsObject):
     18        * testing/js/WebCoreTestSupport.h:
     19        * testing/v8/WebCoreTestSupport.cpp:
     20        (WebCoreTestSupport::resetInternalsObject):
     21        * testing/v8/WebCoreTestSupport.h:
     22
    1232011-08-17  Tony Chang  <tony@chromium.org>
    224
  • trunk/Source/WebCore/testing/Internals.cpp

    r92697 r93235  
    4343
    4444namespace WebCore {
     45
     46const char* Internals::internalsId = "internals";
    4547
    4648PassRefPtr<Internals> Internals::create()
     
    190192}
    191193
     194void Internals::reset(Document*)
     195{
     196// FIXME: Implement
    192197}
     198
     199}
  • trunk/Source/WebCore/testing/Internals.h

    r92697 r93235  
    4444    static PassRefPtr<Internals> create();
    4545    virtual ~Internals();
    46    
     46
     47    void reset(Document*);
     48
    4749    String elementRenderTreeAsText(Element*, ExceptionCode&);
    4850
     
    6870    void setForceCompositingMode(Document*, bool enabled, ExceptionCode&);
    6971
     72    static const char* internalsId;
    7073private:
    7174    Internals();
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp

    r87948 r93235  
    2929#include "Internals.h"
    3030#include "JSDOMGlobalObject.h"
     31#include "JSDocument.h"
    3132#include "JSInternals.h"
    3233#include <JavaScriptCore/APICast.h>
     
    4344    ExecState* exec = toJS(context);
    4445    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
    45     globalObject->putDirect(exec->globalData(), Identifier(exec, "internals"), toJS(exec, globalObject, Internals::create()));
     46    globalObject->putDirect(exec->globalData(), Identifier(exec, Internals::internalsId), toJS(exec, globalObject, Internals::create()));
     47}
     48
     49void resetInternalsObject(JSContextRef context)
     50{
     51    JSLock lock(SilenceAssertionsOnly);
     52    ExecState* exec = toJS(context);
     53    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
     54    Internals * internals = toInternals(globalObject->getDirect(exec->globalData(), Identifier(exec, Internals::internalsId)));
     55    if (internals) {
     56        ScriptExecutionContext* scriptContext = globalObject->scriptExecutionContext();
     57        if (scriptContext->isDocument())
     58            internals->reset(static_cast<Document*>(scriptContext));
     59    }
    4660}
    4761
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.h

    r87948 r93235  
    3232
    3333void injectInternalsObject(JSContextRef);
     34void resetInternalsObject(JSContextRef);
    3435
    3536} // namespace WebCore
  • trunk/Source/WebCore/testing/v8/WebCoreTestSupport.cpp

    r87948 r93235  
    2727#include "WebCoreTestSupport.h"
    2828
     29#include "Document.h"
    2930#include "Internals.h"
     31#include "ScriptExecutionContext.h"
    3032#include "V8Internals.h"
    3133
     
    4143    v8::HandleScope scope;
    4244
    43     context->Global()->Set(v8::String::New("internals"), toV8(Internals::create()));
     45    context->Global()->Set(v8::String::New(Internals::internalsId), toV8(Internals::create()));
     46}
     47
     48void resetInternalsObject(v8::Local<v8::Context> context)
     49{
     50    v8::Context::Scope contextScope(context);
     51    v8::HandleScope scope;
     52
     53    v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global()->Get(v8::String::New(Internals::internalsId)));
     54    Internals * internals = V8Internals::toNative(object);
     55    if (internals) {
     56        ScriptExecutionContext* scriptContext = getScriptExecutionContext();
     57        if (scriptContext->isDocument())
     58            internals->reset(static_cast<Document*>(scriptContext));
     59    }
    4460}
    4561
  • trunk/Source/WebCore/testing/v8/WebCoreTestSupport.h

    r87948 r93235  
    3535
    3636void injectInternalsObject(v8::Local<v8::Context>);
     37void resetInternalsObject(v8::Local<v8::Context>);
    3738
    3839} // namespace WebCore
  • trunk/Source/WebKit/chromium/ChangeLog

    r93228 r93235  
     12011-08-16  Chang Shu  <cshu@webkit.org>
     2
     3        Support reset in WebCore::Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=66307
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Added framework code in WebKit.
     9
     10        * public/WebTestingSupport.h:
     11        * src/WebTestingSupport.cpp:
     12        (WebKit::WebTestingSupport::resetInternalsObject):
     13
    1142011-08-15  Aaron Boodman  <aa@chromium.org>
    215
  • trunk/Source/WebKit/chromium/public/WebTestingSupport.h

    r92322 r93235  
    3636public:
    3737    WEBKIT_EXPORT static void injectInternalsObject(WebFrame*);
     38    WEBKIT_EXPORT static void resetInternalsObject(WebFrame*);
    3839};
    3940
  • trunk/Source/WebKit/chromium/src/WebTestingSupport.cpp

    r87948 r93235  
    3939}
    4040
     41void WebTestingSupport::resetInternalsObject(WebFrame* frame)
     42{
     43    v8::HandleScope handleScope;
     44    WebCoreTestSupport::resetInternalsObject(frame->mainWorldScriptContext());
    4145}
     46
     47}
  • trunk/Source/WebKit/qt/ChangeLog

    r93093 r93235  
     12011-08-16  Chang Shu  <cshu@webkit.org>
     2
     3        Support reset in WebCore::Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=66307
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Added framework code in WebKit.
     9
     10        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     11        (DumpRenderTreeSupportQt::resetInternalsObject):
     12        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     13
    1142011-08-16  Lindsay Mathieson   <lindsay.mathieson@gmail.com>
    215
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r90341 r93235  
    11661166}
    11671167
     1168void DumpRenderTreeSupportQt::resetInternalsObject(QWebFrame* frame)
     1169{
     1170    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
     1171#if USE(JSC)
     1172    JSC::JSLock lock(JSC::SilenceAssertionsOnly);
     1173
     1174    JSDOMWindow* window = toJSDOMWindow(coreFrame, mainThreadNormalWorld());
     1175    Q_ASSERT(window);
     1176
     1177    JSC::ExecState* exec = window->globalExec();
     1178    Q_ASSERT(exec);
     1179
     1180    JSContextRef context = toRef(exec);
     1181    WebCoreTestSupport::resetInternalsObject(context);
     1182#elif USE(V8)
     1183    WebCoreTestSupport::resetInternalsObject(V8Proxy::mainWorldContext(coreFrame));
     1184#endif
     1185}
     1186
    11681187// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
    11691188
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r90341 r93235  
    214214
    215215    static void injectInternalsObject(QWebFrame*);
     216    static void resetInternalsObject(QWebFrame*);
    216217
    217218    static void setInteractiveFormValidationEnabled(QWebPage*, bool);
  • trunk/Tools/ChangeLog

    r93231 r93235  
     12011-08-16  Chang Shu  <cshu@webkit.org>
     2
     3        Support reset in WebCore::Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=66307
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Added call to resetInternalsObject in DRT.
     9
     10        * DumpRenderTree/chromium/TestShell.cpp:
     11        (TestShell::resetTestController):
     12        * DumpRenderTree/mac/DumpRenderTree.mm:
     13        (resetWebViewToConsistentStateBeforeTesting):
     14        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     15        (WebCore::WebPage::resetSettings):
     16
    1172011-08-17  Alexis Menard  <alexis.menard@openbossa.org>
    218
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r92341 r93235  
    269269    webView()->scalePage(1, WebPoint(0, 0));
    270270    webView()->mainFrame()->clearOpener();
     271    WebTestingSupport::resetInternalsObject(webView()->mainFrame());
    271272}
    272273
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r92785 r93235  
    5252#import "UIDelegate.h"
    5353#import "WebArchiveDumpSupport.h"
     54#import "WebCoreTestSupport.h"
    5455#import "WorkQueue.h"
    5556#import "WorkQueueItem.h"
     
    10571058    resetDefaultsToConsistentValues();
    10581059
     1060    if (gLayoutTestController)
     1061        WebCoreTestSupport::resetInternalsObject([mainFrame globalContext]);
     1062
    10591063    [[mainFrame webView] setSmartInsertDeleteEnabled:YES];
    10601064    [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:NO];
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r90951 r93235  
    212212    DumpRenderTreeSupportQt::setMinimumTimerInterval(this, DumpRenderTreeSupportQt::defaultMinimumTimerInterval());
    213213
     214    DumpRenderTreeSupportQt::resetInternalsObject(mainFrame());
     215
    214216    m_pendingGeolocationRequests.clear();
    215217}
Note: See TracChangeset for help on using the changeset viewer.