Changeset 156299 in webkit


Ignore:
Timestamp:
Sep 23, 2013 3:07:49 PM (11 years ago)
Author:
ap@apple.com
Message:

Delete TestWebKitAPI domain or some keys before running TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=121715 & <rdar://problem/14269434>

Patch by Benjamin Poulain <benjamin@webkit.org> on 2013-09-23
Reviewed by Alexey Proskuryakov.

Previously, initalizing a WebPreference would change the cache model
to WebCacheModelDocumentBrowser. That behavior was due to a stale
preference file on disk.

This patch fixes the tests by resetting the default, and using the proper
default values after initializing WebPreference.

  • TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:

(TestWebKitAPI::TEST): Use the proper initial value, unrelated
to the previous runs.

  • TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:

(TestWebKitAPI::TEST): This test needs b/f cache to be enabled, so change
cache model to the one required.

  • TestWebKitAPI/ios/mainIOS.mm:

(main): Reset the preferences before testing.

  • TestWebKitAPI/mac/mainMac.mm:

(main): Ditto.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r156294 r156299  
     12013-09-23  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Delete TestWebKitAPI domain or some keys before running TestWebKitAPI
     4        https://bugs.webkit.org/show_bug.cgi?id=121715 & <rdar://problem/14269434>
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Previously, initalizing a WebPreference would change the cache model
     9        to WebCacheModelDocumentBrowser. That behavior was due to a stale
     10        preference file on disk.
     11
     12        This patch fixes the tests by resetting the default, and using the proper
     13        default values after initializing WebPreference.
     14
     15        * TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:
     16        (TestWebKitAPI::TEST): Use the proper initial value, unrelated
     17        to the previous runs.
     18
     19        * TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:
     20        (TestWebKitAPI::TEST): This test needs b/f cache to be enabled, so change
     21        cache model to the one required.
     22
     23        * TestWebKitAPI/ios/mainIOS.mm:
     24        (main): Reset the preferences before testing.
     25        * TestWebKitAPI/mac/mainMac.mm:
     26        (main): Ditto.
     27
     282013-09-23  Benjamin Poulain  <benjamin@webkit.org>
     29
     30        Delete TestWebKitAPI domain or some keys before running TestWebKitAPI
     31        https://bugs.webkit.org/show_bug.cgi?id=121715 & <rdar://problem/14269434>
     32
     33        Reviewed by Alexey Proskuryakov.
     34
     35        Previously, initalizing a WebPreference would change the cache model
     36        to WebCacheModelDocumentBrowser. That behavior was due to a stale
     37        preference file on disk.
     38
     39        This patch fixes the tests by resetting the default, and using the proper
     40        default values after initializing WebPreference.
     41
     42        * TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:
     43        (TestWebKitAPI::TEST): Use the proper initial value, unrelated
     44        to the previous runs.
     45
     46        * TestWebKitAPI/ios/mainIOS.mm:
     47        (main): Reset the preferences before testing.
     48        * TestWebKitAPI/mac/mainMac.mm:
     49        (main): Ditto.
     50
    1512013-09-23  Anders Carlsson  <andersca@apple.com>
    252
  • trunk/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm

    r149716 r156299  
    4242    RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
    4343
    44     EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
     44    EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
    4545}
    4646
     
    5050
    5151    WebPreferences *standardPreferences = [WebPreferences standardPreferences];
    52     EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
     52    EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
    5353
    5454    [standardPreferences setCacheModel:WebCacheModelPrimaryWebBrowser];
     
    6868
    6969    // 1) The customPreferences is not set on a view.
    70     EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
     70    EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
    7171
    7272    [standardPreferences setCacheModel:WebCacheModelPrimaryWebBrowser];
  • trunk/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm

    r143637 r156299  
    249249        RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
    250250        RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
     251        [[webView.get() preferences] setCacheModel:WebCacheModelDocumentBrowser];
    251252
    252253        webView.get().frameLoadDelegate = frameLoadDelegate.get();
  • trunk/Tools/TestWebKitAPI/ios/mainIOS.mm

    r142381 r156299  
    3131    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    3232
     33    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"TestWebKitAPI"];
    3334    bool passed = TestWebKitAPI::TestsController::shared().run(argc, argv);
    3435
  • trunk/Tools/TestWebKitAPI/mac/mainMac.mm

    r142381 r156299  
    3131    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    3232
     33    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"TestWebKitAPI"];
    3334    [NSApplication sharedApplication];
    3435
Note: See TracChangeset for help on using the changeset viewer.