summaryrefslogtreecommitdiffstats
path: root/WebCore/manual-tests/inspector/console-log-formatting.html
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-06 11:45:16 +0100
committerSteve Block <steveblock@google.com>2011-05-12 13:44:10 +0100
commitcad810f21b803229eb11403f9209855525a25d57 (patch)
tree29a6fd0279be608e0fe9ffe9841f722f0f4e4269 /WebCore/manual-tests/inspector/console-log-formatting.html
parent121b0cf4517156d0ac5111caf9830c51b69bae8f (diff)
downloadexternal_webkit-cad810f21b803229eb11403f9209855525a25d57.zip
external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.gz
external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.bz2
Merge WebKit at r75315: Initial merge by git.
Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
Diffstat (limited to 'WebCore/manual-tests/inspector/console-log-formatting.html')
-rw-r--r--WebCore/manual-tests/inspector/console-log-formatting.html68
1 files changed, 0 insertions, 68 deletions
diff --git a/WebCore/manual-tests/inspector/console-log-formatting.html b/WebCore/manual-tests/inspector/console-log-formatting.html
deleted file mode 100644
index d59ebc9..0000000
--- a/WebCore/manual-tests/inspector/console-log-formatting.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<script>
- var s = "this is a string";
- var i = 5;
- var ni = -5;
- var f = 3.14159;
- var o = { prop1: 1, prop2: 2 };
- var specifiers = {
- s: "string",
- i: "integer",
- d: "integer",
- f: "float",
- "0.3f": "float with precision",
- o: "object",
- z: "unsupported",
- };
-
- function test(args) {
- var functions = ["log", "debug"];
- for (var i = 0; i < functions.length; ++i) {
- console.info("console." + functions[i] + "(%s)", args);
- try {
- eval("console." + functions[i] + "(" + args + ")");
- } catch (e) {
- console.error(e);
- }
- }
- }
-
- function testAllSpecifiers(value, description) {
- for (var specifier in specifiers)
- test("'Format " + description + " as " + specifiers[specifier] + ": %" + specifier + "', " + value + "");
- }
-
- function runTests() {
- var values = [
- { value: "window.noSuchVariable", description: "undefined" },
- { value: "s", description: "string" },
- { value: "i", description: "positive integer" },
- { value: "ni", description: "negative integer" },
- { value: "f", description: "float" },
- { value: "o", description: "object" },
- { value: "document.body", description: "body" },
- { value: "/test/", description: "RegExp" },
- { value: "true", description: "boolean" },
- { value: "null", description: "null" },
- ];
-
- for (var i = 0; i < values.length; ++i)
- testAllSpecifiers(values[i].value, values[i].description);
-
- var tests = [
- "'simple test'",
- "'multiple', 'parameters', 'should', 'be', 'concatenated'",
- "document",
- "document, document.body, window, window.location",
- "document, document.body, 'hello', 'goodbye', window.location",
- "'Format string with fewer specifiers than parameters: %o %i %f', document.body, i, f, ni, o",
- "'Format string with more specifiers than parameters: %o %i %f %i %o', document.body, i, f",
- ];
-
- for (var i = 0; i < tests.length; ++i)
- test(tests[i]);
-
- }
-</script>
-<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=17228">Bug 17228: console.{log,warn,info,error} should support format strings, variable arguments</a>.</p>
-<p>Open the Inspector (right-click and choose "Inspect Element"), then click the "Run Tests" button.</p>
-<button onclick="runTests()">Run Tests</button>