Title: [249564] trunk
Revision
249564
Author
[email protected]
Date
2019-09-05 22:57:23 -0700 (Thu, 05 Sep 2019)

Log Message

Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in imported/w3c/IndexedDB-private-browsing
https://bugs.webkit.org/show_bug.cgi?id=201519

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Drop Webkit-specific changes to WPT tests.

* IndexedDB-private-browsing/support.js:

Tools:

Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in imported/w3c/IndexedDB-private-browsing
as it does not truly enable private browsing for WebKit2. Instead, have WKTR / DRT set the
TestOption::useEphemeralSession flag based on the test folder.

* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldUseEphemeralSession):
(runTest):
* WebKitTestRunner/TestOptions.cpp:
(WTR::shouldUseEphemeralSession):
(WTR::TestOptions::TestOptions):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (249563 => 249564)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-09-06 05:06:35 UTC (rev 249563)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-09-06 05:57:23 UTC (rev 249564)
@@ -1,5 +1,16 @@
 2019-09-05  Chris Dumez  <[email protected]>
 
+        Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in imported/w3c/IndexedDB-private-browsing
+        https://bugs.webkit.org/show_bug.cgi?id=201519
+
+        Reviewed by Alex Christensen.
+
+        Drop Webkit-specific changes to WPT tests.
+
+        * IndexedDB-private-browsing/support.js:
+
+2019-09-05  Chris Dumez  <[email protected]>
+
         [WK2] Add proper layout test support for ephemeral sessions
         https://bugs.webkit.org/show_bug.cgi?id=201475
 

Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/support.js (249563 => 249564)


--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/support.js	2019-09-06 05:06:35 UTC (rev 249563)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/support.js	2019-09-06 05:57:23 UTC (rev 249564)
@@ -1,10 +1,3 @@
-// WebKit changes: this file is the same as "IndexedDB/support.js" found in W3C web-platform-tests repo,
-// except for the following lines that activate private browsing
-// FIXME: Update WKTR / DRT to enable private browsing for this folder instead.
-if (window.testRunner)
-    testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
-//End of WebKit changes
-
 var databaseName = "database";
 var databaseVersion = 1;
 

Modified: trunk/Tools/ChangeLog (249563 => 249564)


--- trunk/Tools/ChangeLog	2019-09-06 05:06:35 UTC (rev 249563)
+++ trunk/Tools/ChangeLog	2019-09-06 05:57:23 UTC (rev 249564)
@@ -1,3 +1,21 @@
+2019-09-05  Chris Dumez  <[email protected]>
+
+        Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in imported/w3c/IndexedDB-private-browsing
+        https://bugs.webkit.org/show_bug.cgi?id=201519
+
+        Reviewed by Alex Christensen.
+
+        Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in imported/w3c/IndexedDB-private-browsing
+        as it does not truly enable private browsing for WebKit2. Instead, have WKTR / DRT set the
+        TestOption::useEphemeralSession flag based on the test folder.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (shouldUseEphemeralSession):
+        (runTest):
+        * WebKitTestRunner/TestOptions.cpp:
+        (WTR::shouldUseEphemeralSession):
+        (WTR::TestOptions::TestOptions):
+
 2019-09-05  Fujii Hironori  <[email protected]>
 
         [Win] Support Per-Monitor (V2) DPI Awareness

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (249563 => 249564)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-09-06 05:06:35 UTC (rev 249563)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-09-06 05:57:23 UTC (rev 249564)
@@ -1834,6 +1834,11 @@
 }
 #endif
 
+static bool shouldUseEphemeralSession(const char* pathOrURL)
+{
+    return strstr(pathOrURL, "w3c/IndexedDB-private-browsing");
+}
+
 static void setJSCOptions(const TestOptions& options)
 {
     static WTF::StringBuilder savedOptions;
@@ -2065,6 +2070,9 @@
         adjustWebDocumentForFlexibleViewport(gWebBrowserView, gWebScrollView);
 #endif
 
+    if (shouldUseEphemeralSession(pathOrURL.c_str()))
+        [[[mainFrame webView] preferences] setPrivateBrowsingEnabled:YES];
+
     if ([WebHistory optionalSharedHistory])
         [WebHistory setOptionalSharedHistory:nil];
 

Modified: trunk/Tools/WebKitTestRunner/TestOptions.cpp (249563 => 249564)


--- trunk/Tools/WebKitTestRunner/TestOptions.cpp	2019-09-06 05:06:35 UTC (rev 249563)
+++ trunk/Tools/WebKitTestRunner/TestOptions.cpp	2019-09-06 05:57:23 UTC (rev 249564)
@@ -56,6 +56,11 @@
     return pathContains(pathOrURL, "svg/W3C-SVG-1.1") || pathContains(pathOrURL, "svg\\W3C-SVG-1.1");
 }
 
+static bool shouldUseEphemeralSession(const std::string& pathOrURL)
+{
+    return pathContains(pathOrURL, "w3c/IndexedDB-private-browsing") || pathContains(pathOrURL, "w3c\\IndexedDB-private-browsing");
+}
+
 static float deviceScaleFactorForTest(const std::string& pathOrURL)
 {
     if (pathContains(pathOrURL, "/hidpi-3x-"))
@@ -69,6 +74,7 @@
     : useFlexibleViewport(shouldMakeViewportFlexible(pathOrURL))
     , useFixedLayout(shouldUseFixedLayout(pathOrURL))
     , isSVGTest(isSVGTestPath(pathOrURL))
+    , useEphemeralSession(shouldUseEphemeralSession(pathOrURL))
     , deviceScaleFactor(deviceScaleFactorForTest(pathOrURL))
 {
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to