From ed03dd0f9998db6e8e516bbcf6d748f34d990cc8 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 21 Aug 2023 22:07:27 +1200 Subject: [PATCH] LibWeb/Tests: Port two DOM cloneNode() test cases to text tests --- Base/res/html/tests/Attr-cloneNode.html | 38 ------------------- .../ProcessingInstruction-cloneNode.html | 31 --------------- Tests/LibWeb/Text/expected/Attr-cloneNode.txt | 19 ++++++++++ .../ProcessingInstruction-cloneNode.txt | 11 ++++++ Tests/LibWeb/Text/input/Attr-cloneNode.html | 30 +++++++++++++++ .../ProcessingInstruction-cloneNode.html | 23 +++++++++++ 6 files changed, 83 insertions(+), 69 deletions(-) delete mode 100644 Base/res/html/tests/Attr-cloneNode.html delete mode 100644 Base/res/html/tests/ProcessingInstruction-cloneNode.html create mode 100644 Tests/LibWeb/Text/expected/Attr-cloneNode.txt create mode 100644 Tests/LibWeb/Text/expected/ProcessingInstruction-cloneNode.txt create mode 100644 Tests/LibWeb/Text/input/Attr-cloneNode.html create mode 100644 Tests/LibWeb/Text/input/ProcessingInstruction-cloneNode.html diff --git a/Base/res/html/tests/Attr-cloneNode.html b/Base/res/html/tests/Attr-cloneNode.html deleted file mode 100644 index 26d6de7ef7..0000000000 --- a/Base/res/html/tests/Attr-cloneNode.html +++ /dev/null @@ -1,38 +0,0 @@ - - -

-  
-
-
diff --git a/Base/res/html/tests/ProcessingInstruction-cloneNode.html b/Base/res/html/tests/ProcessingInstruction-cloneNode.html
deleted file mode 100644
index 8fbb539ee8..0000000000
--- a/Base/res/html/tests/ProcessingInstruction-cloneNode.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-  

-  
-
-
diff --git a/Tests/LibWeb/Text/expected/Attr-cloneNode.txt b/Tests/LibWeb/Text/expected/Attr-cloneNode.txt
new file mode 100644
index 0000000000..8ed0e532ee
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/Attr-cloneNode.txt
@@ -0,0 +1,19 @@
+attr: [object Attr]
+attr.ownerElement: [object HTMLDivElement]
+attr.namespaceURI: null
+attr.localName: foo
+attr.name: foo
+attr.value: bar
+attr.specified: true
+
+clone: [object Attr]
+clone.ownerElement: null
+clone.namespaceURI: null
+clone.localName: foo
+clone.name: foo
+clone.value: bar
+clone.specified: true
+
+attr === clone -> false
+attr.isEqualNode(clone) -> true
+attr.isEqualNode(other) -> false
diff --git a/Tests/LibWeb/Text/expected/ProcessingInstruction-cloneNode.txt b/Tests/LibWeb/Text/expected/ProcessingInstruction-cloneNode.txt
new file mode 100644
index 0000000000..4ebf454894
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/ProcessingInstruction-cloneNode.txt
@@ -0,0 +1,11 @@
+pi: [object ProcessingInstruction]
+pi.target: someTarget
+pi.data: someData
+
+clone: [object ProcessingInstruction]
+clone.target: someTarget
+clone.data: someData
+
+pi === clone -> false
+pi.isEqualNode(clone) -> true
+pi.isEqualNode(other) -> false
diff --git a/Tests/LibWeb/Text/input/Attr-cloneNode.html b/Tests/LibWeb/Text/input/Attr-cloneNode.html
new file mode 100644
index 0000000000..b66935671b
--- /dev/null
+++ b/Tests/LibWeb/Text/input/Attr-cloneNode.html
@@ -0,0 +1,30 @@
+
+
diff --git a/Tests/LibWeb/Text/input/ProcessingInstruction-cloneNode.html b/Tests/LibWeb/Text/input/ProcessingInstruction-cloneNode.html
new file mode 100644
index 0000000000..63fd7bfd68
--- /dev/null
+++ b/Tests/LibWeb/Text/input/ProcessingInstruction-cloneNode.html
@@ -0,0 +1,23 @@
+
+