Bug 66307 - Support reset in WebCore::Internals
Summary: Support reset in WebCore::Internals
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Chang Shu
URL:
Keywords:
Depends on:
Blocks: 66052
  Show dependency treegraph
 
Reported: 2011-08-16 08:24 PDT by Chang Shu
Modified: 2011-08-17 13:05 PDT (History)
3 users (show)

See Also:


Attachments
fix patch (7.95 KB, patch)
2011-08-16 09:10 PDT, Chang Shu
dglazkov: review-
Details | Formatted Diff | Diff
fix patch 2 (12.04 KB, patch)
2011-08-16 13:02 PDT, Chang Shu
dglazkov: review+
Details | Formatted Diff | Diff
patch 3: reviewed with minor fix (12.89 KB, patch)
2011-08-17 11:30 PDT, Chang Shu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.