Bug 67451 - Add a test for going back to a cached page after changing the device scale factor
Summary: Add a test for going back to a cached page after changing the device scale fa...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-01 16:07 PDT by Beth Dakin
Modified: 2011-09-02 11:54 PDT (History)
1 user (show)

See Also:


Attachments
Patch (13.22 KB, patch)
2011-09-01 16:15 PDT, Beth Dakin
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2011-09-01 16:07:25 PDT
https://bugs.webkit.org/show_bug.cgi?id=66244 should have a corresponding TestWebKitAPI test. Patch forthcoming.
Comment 1 Beth Dakin 2011-09-01 16:15:38 PDT
Created attachment 106057 [details]
Patch
Comment 2 Adam Roben (:aroben) 2011-09-02 05:44:42 PDT
Comment on attachment 106057 [details]
Patch

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

Yay tests! (Bug 67150 is next!)

> Tools/ChangeLog:21
> +        Added new functions to WebKitAgnosticTest to goBack and goForward. Separated 
> +        waitForLoadToFinish() into its own function (instead of being a part of 
> +        loadAndWaitUntilFinished()) so that it can be called from goBack and goForward as 
> +        well. Also added initializeView() so we can set the cache model.

Since you never use goForward, maybe we shouldn't add it?

> Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm:64
> +void DeviceScaleFactorOnBack::initializeView(WebView *view)
> +{
> +    [[view preferences] setCacheModel:WebCacheModelDocumentBrowser];
> +}
> +
> +void DeviceScaleFactorOnBack::initializeView(WKView *view)
> +{
> +    WKContextSetCacheModel(WKPageGetContext([view pageRef]), kWKCacheModelDocumentBrowser);
> +}

It's probably worth adding a comment here explaining why we do this.
Comment 3 Beth Dakin 2011-09-02 11:54:44 PDT
I removed goForward and added comments to both implementations of initializeWebView, and I committed the test with revision 94437.

Thanks Adam!!!