Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception.html

Issue 2667303004: Move tests for DOMParser and XMLSerializer to dom/domparsing/. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception.html b/third_party/WebKit/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception.html
deleted file mode 100644
index 34675f9117a31a76fa9e7b28058386c8c6aea1e4..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<html>
-<head>
-<style>
-.failed {
- color: red;
- font-weight: bold;
-}
-
-.passed {
- color: green;
- font-weight: bold;
-}
-</style>
-<script>
-if (window.testRunner)
- window.testRunner.dumpAsText();
-var count = 0;
-
-function shouldThrowException(node)
-{
- document.body.appendChild(document.createElement("br"));
- var header = document.createElement("div");
- header.textContent = ++count + ". Verifying XMLSerializer.serializeToString() should THROW exception with " + (arguments.length ? "argument " + node : "no argument");
- document.body.appendChild(header);
-
- var xs = new XMLSerializer();
- try {
- var str = xs.serializeToString.apply(xs, arguments);
-
- var result = document.createElement("div");
- result.className = "failed"
- result.textContent = "FAIL";
- document.body.appendChild(result);
- } catch (exception) {
- var err = "Exception thrown = [" + exception.name + ": " + exception.message + "]";
- var content = document.createElement("div");
- content.textContent = err;
- document.body.appendChild(content);
-
- var result = document.createElement("div");
- result.className = "passed"
- result.textContent = "PASS";
- document.body.appendChild(result);
- }
-}
-
-function shouldNOTThrowException(node)
-{
- document.body.appendChild(document.createElement("br"));
- var header = document.createElement("div");
- header.textContent = ++count + ". Verifying XMLSerializer.serializeToString() should NOT-THROW exception with argument " + node;
- document.body.appendChild(header);
-
- var xs = new XMLSerializer();
- try {
- var str = xs.serializeToString(node);
-
- var result = document.createElement("div");
- result.className = "passed"
- result.textContent = "PASS";
- document.body.appendChild(result);
- } catch (exception) {
- var err = "Exception thrown = [" + exception.name + ": " + exception.message + "]";
- var content = document.createElement("div");
- content.textContent = err;
- document.body.appendChild(content);
-
- var result = document.createElement("div");
- result.className = "failed"
- result.textContent = "FAIL";
- document.body.appendChild(result);
- }
-}
-
-function runTest()
-{
- shouldThrowException();
- shouldThrowException(null);
- shouldThrowException(undefined);
- shouldThrowException("<html><title>Hello World</title></html>");
- shouldThrowException(document.children);
-
- shouldNOTThrowException(document);
- shouldNOTThrowException(document.documentElement);
- shouldNOTThrowException(document.firstChild);
- shouldNOTThrowException(document.createElement("div"));
- shouldNOTThrowException(document.getElementById("heading"));
- shouldNOTThrowException(document.createElement("custom"));
-
- var domParser = new DOMParser();
-
- var htmlDoc = domParser.parseFromString("<html/>", "text/html");
- shouldNOTThrowException(htmlDoc);
- shouldNOTThrowException(htmlDoc.firstChild);
-
- var xmlDoc = domParser.parseFromString("<root/>", "text/xml");
- shouldNOTThrowException(xmlDoc);
- shouldNOTThrowException(xmlDoc.lastChild);
-}
-</script>
-</head>
-<body onload="runTest();">
-This tests XMLSerializer.serializeToString() throwing exception when node value is invalid and passing otherwise.
-<h1 id="heading"/>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698