Title: [244868] trunk/LayoutTests
Revision
244868
Author
[email protected]
Date
2019-05-01 23:27:07 -0700 (Wed, 01 May 2019)

Log Message

Unreviewed, fix test failures after r242992.
<rdar://problem/50383600>

* inspector/console/console-screenshot.html:
* inspector/console/console-screenshot-expected.txt:
Don't print the dataURL in the expectation file.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (244867 => 244868)


--- trunk/LayoutTests/ChangeLog	2019-05-02 05:01:07 UTC (rev 244867)
+++ trunk/LayoutTests/ChangeLog	2019-05-02 06:27:07 UTC (rev 244868)
@@ -1,3 +1,12 @@
+2019-05-01  Devin Rousso  <[email protected]>
+
+        Unreviewed, fix test failures after r242992.
+        <rdar://problem/50383600>
+
+        * inspector/console/console-screenshot.html:
+        * inspector/console/console-screenshot-expected.txt:
+        Don't print the dataURL in the expectation file.
+
 2019-05-01  Jiewen Tan  <[email protected]>
 
         [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix()

Modified: trunk/LayoutTests/inspector/console/console-screenshot-expected.txt (244867 => 244868)


--- trunk/LayoutTests/inspector/console/console-screenshot-expected.txt	2019-05-02 05:01:07 UTC (rev 244867)
+++ trunk/LayoutTests/inspector/console/console-screenshot-expected.txt	2019-05-02 06:27:07 UTC (rev 244868)
@@ -7,11 +7,11 @@
 == Running test suite: console.screenshot
 -- Running test case: console.screenshot.SingleNode
 PASS: The added message should be an image.
-PASS: The image should be a 2x2 red square.
+PASS: The image should not be empty.
 
 -- Running test case: console.screenshot.MultipleNodes
 PASS: The added message should be an image.
-PASS: The image should be a 2x2 blue square.
+PASS: The image should not be empty.
 
 -- Running test case: console.screenshot.DetachedNode
 PASS: Could not capture screenshot
@@ -18,6 +18,7 @@
 
 -- Running test case: console.screenshot.NoArguments
 PASS: The added message should be an image.
+PASS: The image should not be empty.
 PASS: The image width should be greater than 2px.
 PASS: The image height should be greater than 2px.
 

Modified: trunk/LayoutTests/inspector/console/console-screenshot.html (244867 => 244868)


--- trunk/LayoutTests/inspector/console/console-screenshot.html	2019-05-02 05:01:07 UTC (rev 244867)
+++ trunk/LayoutTests/inspector/console/console-screenshot.html	2019-05-02 06:27:07 UTC (rev 244868)
@@ -15,15 +15,6 @@
 {
     InspectorTest.debug();
 
-    // 2x2 red square
-    const redSquareDataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABNJREFUCB1j/M/AAEQMDEwgAgQAHxcCAmtAm/sAAAAASUVORK5CYII=";
-
-    // 2x2 blue square
-    const blueSquareDataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABRJREFUCB1jZGD4/58BCJhABAgAAB0ZAgJSPDJ6AAAAAElFTkSuQmCC";
-
-    // 2x2 green square
-    const greenSquareDataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABNJREFUCB1jZGhg+M8ABEwgAgQAFigBgxp1H6oAAAAASUVORK5CYII=";
-
     let suite = InspectorTest.createAsyncSuite("console.screenshot");
 
     function addTest({name, _expression_, imageMessageAddedCallback, shouldError}) {
@@ -59,8 +50,12 @@
     addTest({
         name: "console.screenshot.SingleNode",
         _expression_: `console.screenshot(document.querySelector("#test1"))`,
-        imageMessageAddedCallback(message) {
-            InspectorTest.expectEqual(message.messageText, redSquareDataURL, "The image should be a 2x2 red square.");
+        async imageMessageAddedCallback(message) {
+            InspectorTest.expectNotEqual(message.messageText, "data:", "The image should not be empty.");
+
+            let img = await WI.ImageUtilities.promisifyLoad(message.messageText);
+            InspectorTest.assert(img.width === 2, "The image width should be 2px.");
+            InspectorTest.assert(img.height === 2, "The image height should be 2px.");
         },
     });
 
@@ -67,8 +62,12 @@
     addTest({
         name: "console.screenshot.MultipleNodes", 
         _expression_: `console.screenshot(document.querySelector("#test2"), document.querySelector("#test1"))`,
-        imageMessageAddedCallback(message) {
-            InspectorTest.expectEqual(message.messageText, blueSquareDataURL, "The image should be a 2x2 blue square.");
+        async imageMessageAddedCallback(message) {
+            InspectorTest.expectNotEqual(message.messageText, "data:", "The image should not be empty.");
+
+            let img = await WI.ImageUtilities.promisifyLoad(message.messageText);
+            InspectorTest.assert(img.width === 2, "The image width should be 2px.");
+            InspectorTest.assert(img.height === 2, "The image height should be 2px.");
         },
     });
 
@@ -82,9 +81,7 @@
         name: "console.screenshot.NoArguments", 
         _expression_: `console.screenshot()`,
         async imageMessageAddedCallback(message) {
-            InspectorTest.assert(message.messageText !== redSquareDataURL, "The imag should not be a 2x2 red square.");
-            InspectorTest.assert(message.messageText !== blueSquareDataURL, "The imag should not be a 2x2 blue square.");
-            InspectorTest.assert(message.messageText !== greenSquareDataURL, "The imag should not be a 2x2 green square.");
+            InspectorTest.expectNotEqual(message.messageText, "data:", "The image should not be empty.");
 
             let img = await WI.ImageUtilities.promisifyLoad(message.messageText);
             InspectorTest.expectGreaterThan(img.width, 2, "The image width should be greater than 2px.");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to