Title: [156299] trunk/Tools
Revision
156299
Author
[email protected]
Date
2013-09-23 15:07:49 -0700 (Mon, 23 Sep 2013)

Log 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 <[email protected]> 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.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (156298 => 156299)


--- trunk/Tools/ChangeLog	2013-09-23 21:53:38 UTC (rev 156298)
+++ trunk/Tools/ChangeLog	2013-09-23 22:07:49 UTC (rev 156299)
@@ -1,3 +1,53 @@
+2013-09-23  Benjamin Poulain  <[email protected]>
+
+        Delete TestWebKitAPI domain or some keys before running TestWebKitAPI
+        https://bugs.webkit.org/show_bug.cgi?id=121715 & <rdar://problem/14269434>
+
+        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.
+
+2013-09-23  Benjamin Poulain  <[email protected]>
+
+        Delete TestWebKitAPI domain or some keys before running TestWebKitAPI
+        https://bugs.webkit.org/show_bug.cgi?id=121715 & <rdar://problem/14269434>
+
+        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/ios/mainIOS.mm:
+        (main): Reset the preferences before testing.
+        * TestWebKitAPI/mac/mainMac.mm:
+        (main): Ditto.
+
 2013-09-23  Anders Carlsson  <[email protected]>
 
         ListHashSet should work with move-only types

Modified: trunk/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm (156298 => 156299)


--- trunk/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm	2013-09-23 21:53:38 UTC (rev 156298)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm	2013-09-23 22:07:49 UTC (rev 156299)
@@ -41,7 +41,7 @@
 
     RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
 
-    EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
+    EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
 }
 
 TEST(WebKit1, SetAndUpdateCacheModelStandardPreferenceChange)
@@ -49,7 +49,7 @@
     EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
 
     WebPreferences *standardPreferences = [WebPreferences standardPreferences];
-    EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
+    EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
 
     [standardPreferences setCacheModel:WebCacheModelPrimaryWebBrowser];
     EXPECT_EQ((int)WebCacheModelPrimaryWebBrowser, (int)[WebView _cacheModel]);
@@ -67,7 +67,7 @@
     RetainPtr<WebPreferences> customPreferences = adoptNS([[WebPreferences alloc] initWithIdentifier:@"SetAndUpdateCacheModelPreferencesChangeMix"]);
 
     // 1) The customPreferences is not set on a view.
-    EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
+    EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
 
     [standardPreferences setCacheModel:WebCacheModelPrimaryWebBrowser];
     EXPECT_EQ((int)WebCacheModelPrimaryWebBrowser, (int)[WebView _cacheModel]);

Modified: trunk/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm (156298 => 156299)


--- trunk/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm	2013-09-23 21:53:38 UTC (rev 156298)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm	2013-09-23 22:07:49 UTC (rev 156299)
@@ -248,6 +248,7 @@
     @autoreleasepool {
         RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
         RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+        [[webView.get() preferences] setCacheModel:WebCacheModelDocumentBrowser];
 
         webView.get().frameLoadDelegate = frameLoadDelegate.get();
         WebFrame *mainFrame = webView.get().mainFrame;

Modified: trunk/Tools/TestWebKitAPI/ios/mainIOS.mm (156298 => 156299)


--- trunk/Tools/TestWebKitAPI/ios/mainIOS.mm	2013-09-23 21:53:38 UTC (rev 156298)
+++ trunk/Tools/TestWebKitAPI/ios/mainIOS.mm	2013-09-23 22:07:49 UTC (rev 156299)
@@ -30,6 +30,7 @@
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
+    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"TestWebKitAPI"];
     bool passed = TestWebKitAPI::TestsController::shared().run(argc, argv);
 
     [pool drain];

Modified: trunk/Tools/TestWebKitAPI/mac/mainMac.mm (156298 => 156299)


--- trunk/Tools/TestWebKitAPI/mac/mainMac.mm	2013-09-23 21:53:38 UTC (rev 156298)
+++ trunk/Tools/TestWebKitAPI/mac/mainMac.mm	2013-09-23 22:07:49 UTC (rev 156299)
@@ -30,6 +30,7 @@
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
+    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"TestWebKitAPI"];
     [NSApplication sharedApplication];
 
     bool passed = TestWebKitAPI::TestsController::shared().run(argc, argv);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to