Bug 66307

Summary: Support reset in WebCore::Internals
Product: WebKit Reporter: Chang Shu <cshu>
Component: Tools / TestsAssignee: Chang Shu <cshu>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, dglazkov, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 66052    
Attachments:
Description Flags
fix patch
dglazkov: review-
fix patch 2
dglazkov: review+
patch 3: reviewed with minor fix none

Description Chang Shu 2011-08-16 08:24:20 PDT
WebCore settings may have been modified through window.internals and DRT should be able to reset them back to their original values before each test run. The above support provides a framework so that Internals can restore the original values automatically.
Comment 1 Chang Shu 2011-08-16 09:10:03 PDT
Created attachment 104054 [details]
fix patch

The patch works for mac and qt.
Comment 2 WebKit Review Bot 2011-08-16 09:12:54 PDT
Attachment 104054 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/testing/js/WebCoreTestSupport.cpp:59:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dimitri Glazkov (Google) 2011-08-16 09:45:43 PDT
Comment on attachment 104054 [details]
fix patch

This is a great start. We shouldn't land this with partial port support though. Cross-port support is the whole point of window.internals.
Comment 4 Chang Shu 2011-08-16 13:02:01 PDT
Created attachment 104078 [details]
fix patch 2
Comment 5 Dimitri Glazkov (Google) 2011-08-17 10:59:44 PDT
Comment on attachment 104078 [details]
fix patch 2

View in context: https://bugs.webkit.org/attachment.cgi?id=104078&action=review

> Source/WebCore/testing/js/WebCoreTestSupport.cpp:54
> +    Internals * internals = toInternals(globalObject->getDirect(exec->globalData(), Identifier(exec, "internals")));

Now that we're using it in more than one place, the literal should probably be a constant in this file.

> Source/WebCore/testing/v8/WebCoreTestSupport.cpp:53
> +    v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global()->Get(v8::String::New("internals")));

Ditto.
Comment 6 Chang Shu 2011-08-17 11:30:37 PDT
Created attachment 104200 [details]
patch 3: reviewed with minor fix
Comment 7 Chang Shu 2011-08-17 13:05:22 PDT
Manually committed r93235: <http://trac.webkit.org/changeset/93235>
Clearing flags.