Title: [235619] trunk
Revision
235619
Author
pvol...@apple.com
Date
2018-09-04 11:03:10 -0700 (Tue, 04 Sep 2018)

Log Message

Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
https://bugs.webkit.org/show_bug.cgi?id=187925

Reviewed by Simon Fraser.

This will test that the function primaryScreenDisplayID() returns a valid display ID.

Source/WebCore:

Test: fast/misc/valid-primary-screen-displayID.html

* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::primaryScreenDisplayID):
* testing/Internals.cpp:
(WebCore::Internals::primaryScreenDisplayID):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* TestExpectations:
* fast/misc/valid-primary-screen-displayID-expected.txt: Added.
* fast/misc/valid-primary-screen-displayID.html: Added.
* platform/mac-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (235618 => 235619)


--- trunk/LayoutTests/ChangeLog	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/LayoutTests/ChangeLog	2018-09-04 18:03:10 UTC (rev 235619)
@@ -1,3 +1,17 @@
+2018-09-04  Per Arne Vollan  <pvol...@apple.com>
+
+        Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
+        https://bugs.webkit.org/show_bug.cgi?id=187925
+
+        Reviewed by Simon Fraser.
+
+        This will test that the function primaryScreenDisplayID() returns a valid display ID.
+
+        * TestExpectations:
+        * fast/misc/valid-primary-screen-displayID-expected.txt: Added.
+        * fast/misc/valid-primary-screen-displayID.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2018-09-04  Daniel Bates  <daba...@apple.com>
 
         Remove redundant inline text boxes for empty combined text

Modified: trunk/LayoutTests/TestExpectations (235618 => 235619)


--- trunk/LayoutTests/TestExpectations	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/LayoutTests/TestExpectations	2018-09-04 18:03:10 UTC (rev 235619)
@@ -399,6 +399,11 @@
 # testRunner.terminateNetworkProcess() only works in WebKit2
 fast/files/blob-network-process-crash.html [ Skip ]
 
+# This test is currently only relevant on mac-wk2
+fast/canvas/webgl/context-update-on-display-configuration.html [ Skip ]
+
+fast/misc/valid-primary-screen-displayID.html [ Skip ]
+
 #//////////////////////////////////////////////////////////////////////////////////////////
 # End platform-specific tests.
 #//////////////////////////////////////////////////////////////////////////////////////////
@@ -2235,6 +2240,3 @@
 webkit.org/b/187269 [ Debug ] imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_abort.html [ Skip ]
 
 webkit.org/b/185308 legacy-animation-engine/animations/combo-transform-translate+scale.html [ Pass Failure ]
-
-# This test is currently only relevant on mac-wk2
-fast/canvas/webgl/context-update-on-display-configuration.html [ Skip ]

Added: trunk/LayoutTests/fast/misc/valid-primary-screen-displayID-expected.txt (0 => 235619)


--- trunk/LayoutTests/fast/misc/valid-primary-screen-displayID-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/misc/valid-primary-screen-displayID-expected.txt	2018-09-04 18:03:10 UTC (rev 235619)
@@ -0,0 +1,2 @@
+PASS: Valid primary screen display ID.
+

Added: trunk/LayoutTests/fast/misc/valid-primary-screen-displayID.html (0 => 235619)


--- trunk/LayoutTests/fast/misc/valid-primary-screen-displayID.html	                        (rev 0)
+++ trunk/LayoutTests/fast/misc/valid-primary-screen-displayID.html	2018-09-04 18:03:10 UTC (rev 235619)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that the display ID of the primary screen is valid.</title>
+<script>
+function log(msg)
+{
+    document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
+}
+
+function onload()
+{
+    if (window.testRunner)
+        testRunner.dumpAsText();
+    if (window.internals.primaryScreenDisplayID())
+        log("PASS: Valid primary screen display ID.");
+    else
+        log("FAIL: Invalid primary screen display ID.");
+}
+</script>
+</head>
+<body _onLoad_="onload()">
+<pre id="console"></pre>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (235618 => 235619)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2018-09-04 18:03:10 UTC (rev 235619)
@@ -53,6 +53,10 @@
 
 webkit.org/b/187183 http/tests/security/pasteboard-file-url.html [ Pass ]
 
+[ Mojave+ ] fast/canvas/webgl/context-update-on-display-configuration.html [ Pass ]
+
+fast/misc/valid-primary-screen-displayID.html [ Pass ]
+
 #//////////////////////////////////////////////////////////////////////////////////////////
 # End platform-specific directories.
 #//////////////////////////////////////////////////////////////////////////////////////////
@@ -833,8 +837,6 @@
 
 webkit.org/b/186425 [ Debug ] inspector/console/webcore-logging.html [ Pass Failure ]
 
-[ Mojave+ ] fast/canvas/webgl/context-update-on-display-configuration.html [ Pass ]
-
 # skip manual payment-request tests
 imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html [ Skip ]
 imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (235618 => 235619)


--- trunk/Source/WebCore/ChangeLog	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/Source/WebCore/ChangeLog	2018-09-04 18:03:10 UTC (rev 235619)
@@ -1,3 +1,22 @@
+2018-09-04  Per Arne Vollan  <pvol...@apple.com>
+
+        Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
+        https://bugs.webkit.org/show_bug.cgi?id=187925
+
+        Reviewed by Simon Fraser.
+
+        This will test that the function primaryScreenDisplayID() returns a valid display ID.
+
+        Test: fast/misc/valid-primary-screen-displayID.html
+
+        * platform/PlatformScreen.h:
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::primaryScreenDisplayID):
+        * testing/Internals.cpp:
+        (WebCore::Internals::primaryScreenDisplayID):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2018-09-04  Daniel Bates  <daba...@apple.com>
 
         Add helper function to create a potential CORS request

Modified: trunk/Source/WebCore/platform/PlatformScreen.h (235618 => 235619)


--- trunk/Source/WebCore/platform/PlatformScreen.h	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/Source/WebCore/platform/PlatformScreen.h	2018-09-04 18:03:10 UTC (rev 235619)
@@ -99,6 +99,8 @@
 WEBCORE_EXPORT ScreenProperties collectScreenProperties();
 WEBCORE_EXPORT void setScreenProperties(const ScreenProperties&);
 
+WEBCORE_EXPORT PlatformDisplayID primaryScreenDisplayID();
+
 uint32_t primaryOpenGLDisplayMask();
 uint32_t displayMaskForDisplay(PlatformDisplayID);
 

Modified: trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm (235618 => 235619)


--- trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm	2018-09-04 18:03:10 UTC (rev 235619)
@@ -102,7 +102,7 @@
     return screenProperties;
 }
 
-static PlatformDisplayID& primaryScreenDisplayID()
+PlatformDisplayID primaryScreenDisplayID()
 {
     return screenProperties().primaryDisplayID;
 }

Modified: trunk/Source/WebCore/testing/Internals.cpp (235618 => 235619)


--- trunk/Source/WebCore/testing/Internals.cpp	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/Source/WebCore/testing/Internals.cpp	2018-09-04 18:03:10 UTC (rev 235619)
@@ -120,6 +120,7 @@
 #include "PageOverlay.h"
 #include "PathUtilities.h"
 #include "PlatformMediaSessionManager.h"
+#include "PlatformScreen.h"
 #include "PlatformStrategies.h"
 #include "PluginData.h"
 #include "PrintContext.h"
@@ -4720,4 +4721,13 @@
     ResourceLoadObserver::shared().notifyObserver();
 }
 
+unsigned long Internals::primaryScreenDisplayID()
+{
+#if PLATFORM(MAC)
+    return WebCore::primaryScreenDisplayID();
+#else
+    return 0;
+#endif
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/testing/Internals.h (235618 => 235619)


--- trunk/Source/WebCore/testing/Internals.h	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/Source/WebCore/testing/Internals.h	2018-09-04 18:03:10 UTC (rev 235619)
@@ -735,6 +735,8 @@
 
     void notifyResourceLoadObserver();
 
+    unsigned long primaryScreenDisplayID();
+        
 private:
     explicit Internals(Document&);
     Document* contextDocument() const;

Modified: trunk/Source/WebCore/testing/Internals.idl (235618 => 235619)


--- trunk/Source/WebCore/testing/Internals.idl	2018-09-04 17:28:28 UTC (rev 235618)
+++ trunk/Source/WebCore/testing/Internals.idl	2018-09-04 18:03:10 UTC (rev 235619)
@@ -669,4 +669,6 @@
     unsigned long pluginCount();
 
     void notifyResourceLoadObserver();
+
+    unsigned long primaryScreenDisplayID();
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to