summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorLeon Clarke <leonclarke@google.com>2010-07-15 12:03:35 +0100
committerLeon Clarke <leonclarke@google.com>2010-07-20 16:57:23 +0100
commite458d70a0d18538346f41b503114c9ebe6b2ce12 (patch)
tree86f1637deca2c524432a822e5fcedd4bef221091 /LayoutTests
parentf43eabc081f7ce6af24b9df4953498a3cd6ca24d (diff)
downloadexternal_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.zip
external_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.tar.gz
external_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.tar.bz2
Merge WebKit at r63173 : Initial merge by git.
Change-Id: Ife5af0c7c6261fbbc8ae6bc08c390efa9ef10b44
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/xpath/substring-nan-position-expected.txt10
-rw-r--r--LayoutTests/fast/xpath/substring-nan-position.html26
-rw-r--r--LayoutTests/fast/xpath/substring-non-positive-postion-expected.txt10
-rw-r--r--LayoutTests/fast/xpath/substring-non-positive-postion.html23
-rw-r--r--LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt1
-rw-r--r--LayoutTests/http/tests/appcache/progress-counter-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/progress-counter.html62
-rw-r--r--LayoutTests/http/tests/appcache/resources/different-https-origin-resource.html8
-rw-r--r--LayoutTests/http/tests/appcache/resources/progress-counter.manifest3
-rw-r--r--LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt71
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js52
11 files changed, 258 insertions, 10 deletions
diff --git a/LayoutTests/fast/xpath/substring-nan-position-expected.txt b/LayoutTests/fast/xpath/substring-nan-position-expected.txt
new file mode 100644
index 0000000..136cf21
--- /dev/null
+++ b/LayoutTests/fast/xpath/substring-nan-position-expected.txt
@@ -0,0 +1,10 @@
+Test for bug 41862: XPath substring function is broken when passing NaN as the position parameter.
+
+PASS document.evaluate("substring('12345', number('NaN'))", document, null, XPathResult.STRING_TYPE, null).stringValue is ''
+PASS document.evaluate("substring('12345', number('NaN'), 3)", document, null, XPathResult.STRING_TYPE, null).stringValue is ''
+PASS document.evaluate("substring('12345', number('NaN'), -2147483645)", document, null, XPathResult.STRING_TYPE, null).stringValue is ''
+PASS document.evaluate("substring('12345', number('NaN'), number('NaN'))", document, null, XPathResult.STRING_TYPE, null).stringValue is ''
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/xpath/substring-nan-position.html b/LayoutTests/fast/xpath/substring-nan-position.html
new file mode 100644
index 0000000..d1a1813
--- /dev/null
+++ b/LayoutTests/fast/xpath/substring-nan-position.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=41862">bug 41862</a>:
+XPath substring function is broken when passing NaN as the position parameter.</p>
+<div id="console"></div>
+
+<script>
+ shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'))\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
+ shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), 3)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
+
+ <!-- -2147483645 represents MIN_INT-3 which when passed through the original substring function before the fix for 41862 landed caused an overflow and wrap to 2. That meant that this case was effectively calling substring('12345', MIN_INT, 2) and returning 12, rather than the empty string which the NaN should have triggered.. -->
+ shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), -2147483645)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
+
+ shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), number(\'NaN\'))\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
+
+ var successfullyParsed = true;
+
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/xpath/substring-non-positive-postion-expected.txt b/LayoutTests/fast/xpath/substring-non-positive-postion-expected.txt
new file mode 100644
index 0000000..d3683b7
--- /dev/null
+++ b/LayoutTests/fast/xpath/substring-non-positive-postion-expected.txt
@@ -0,0 +1,10 @@
+Test for bug 41913: XPath substring function does not correctly handle non-positive values for the position argument
+
+PASS document.evaluate("substring('abcde', 0)", document, null, XPathResult.STRING_TYPE, null).stringValue is 'abcde'
+PASS document.evaluate("substring('abcde', -2)", document, null, XPathResult.STRING_TYPE, null).stringValue is 'abcde'
+PASS document.evaluate("substring('abcde', 0, 5)", document, null, XPathResult.STRING_TYPE, null).stringValue is 'abcd'
+PASS document.evaluate("substring('abcde', -2, 5)", document, null, XPathResult.STRING_TYPE, null).stringValue is 'ab'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/xpath/substring-non-positive-postion.html b/LayoutTests/fast/xpath/substring-non-positive-postion.html
new file mode 100644
index 0000000..321bf25
--- /dev/null
+++ b/LayoutTests/fast/xpath/substring-non-positive-postion.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=41913">bug 41913</a>:
+XPath substring function does not correctly handle non-positive values for the position argument</p>
+<div id="console"></div>
+
+<script>
+ shouldBe("document.evaluate(\"substring('abcde', 0)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'abcde'");
+ shouldBe("document.evaluate(\"substring('abcde', -2)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'abcde'");
+ shouldBe("document.evaluate(\"substring('abcde', 0, 5)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'abcd'");
+ shouldBe("document.evaluate(\"substring('abcde', -2, 5)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "'ab'");
+
+ var successfullyParsed = true;
+
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt b/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt
index 64d4de2..1661ad3 100644
--- a/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt
+++ b/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt
@@ -5,6 +5,7 @@ downloading
progress
progress
progress
+progress
cached
SUCCESS
diff --git a/LayoutTests/http/tests/appcache/progress-counter-expected.txt b/LayoutTests/http/tests/appcache/progress-counter-expected.txt
new file mode 100644
index 0000000..c9e3db2
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/progress-counter-expected.txt
@@ -0,0 +1,2 @@
+This tests that the lengthComputable / loaded / total properties of the progress event are set correctly.
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/progress-counter.html b/LayoutTests/http/tests/appcache/progress-counter.html
new file mode 100644
index 0000000..0f9d0b6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/progress-counter.html
@@ -0,0 +1,62 @@
+<html manifest="resources/progress-counter.manifest">
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+var expectedTotal = 2
+var eventsReceived = 0;
+
+function done() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function progress(event)
+{
+ if (!event.lengthComputable) {
+ document.getElementById('result').innerHTML = "FAILURE: expected progressEvent.lengthComputable to be true";
+ done();
+ return;
+ }
+ if (event.total != expectedTotal) {
+ document.getElementById('result').innerHTML = "FAILURE: expected progressEvent.total to be " + expectedTotal + " but was " + event.total;
+ done();
+ return;
+ }
+ if (event.loaded != eventsReceived) {
+ document.getElementById('result').innerHTML = "FAILURE: expected progressEvent.loaded to be " + eventsReceived + " but was " + event.loaded;
+ done();
+ return;
+ }
+ eventsReceived++;
+}
+
+function cached()
+{
+ if (eventsReceived != 3) {
+ document.getElementById('result').innerHTML = "FAILURE: expected 3 progress events, but got " + eventsReceived;
+ done();
+ return;
+ }
+
+ document.getElementById('result').innerHTML = "SUCCESS";
+ done();
+}
+
+function noupdate()
+{
+ document.getElementById('result').innerHTML = "FAILURE: unable to conduct test since the appcache already exists, please remove the appcache and try again";
+ done();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+applicationCache.addEventListener('noupdate', noupdate, false);
+applicationCache.addEventListener('progress', progress, false);
+
+</script>
+<div>This tests that the lengthComputable / loaded / total properties of the progress event are set correctly.</div>
+
+<div id="result">FAILURE</div>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/different-https-origin-resource.html b/LayoutTests/http/tests/appcache/resources/different-https-origin-resource.html
index 674706a..7c24b07 100644
--- a/LayoutTests/http/tests/appcache/resources/different-https-origin-resource.html
+++ b/LayoutTests/http/tests/appcache/resources/different-https-origin-resource.html
@@ -20,8 +20,14 @@ function error()
hadError = true;
finish();
}
+function progressHandler(e)
+{
+ // The only resource listed in the manifest file is in a different https origin and should be skipped.
+ if (e.loaded != 0 || e.total != 0)
+ fail();
+}
-applicationCache.onprogress = function() { fail(); }
+applicationCache.onprogress = progressHandler;
applicationCache.onnoupdate = function() { finish(); }
applicationCache.oncached = function() { finish(); }
applicationCache.onerror = function() { error(); }
diff --git a/LayoutTests/http/tests/appcache/resources/progress-counter.manifest b/LayoutTests/http/tests/appcache/resources/progress-counter.manifest
new file mode 100644
index 0000000..7877cd8
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/progress-counter.manifest
@@ -0,0 +1,3 @@
+CACHE MANIFEST
+simple.txt
+empty.txt
diff --git a/LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt b/LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt
index bcf1d63..30bac34 100644
--- a/LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt
+++ b/LayoutTests/storage/indexeddb/idb-objectstore-request-expected.txt
@@ -3,12 +3,14 @@ Test IndexedDB's IDBObjectStoreRequest.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+indexedDB.open('name', 'description')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
+openSuccess():
Success event fired:
PASS 'result' in event is true
PASS 'code' in event is false
@@ -22,12 +24,14 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
db = event.result
+db.createObjectStore('storeName', null)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'abort' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
+createSuccess():
Success event fired:
PASS 'result' in event is true
PASS 'code' in event is false
@@ -42,7 +46,72 @@ PASS event.target.readyState is event.target.DONE
store = event.result
PASS store.name is "storeName"
-PASS store.keyPath is "keyPath"
+PASS store.keyPath is null
+store.add('value', 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+addSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is "key"
+store = event.source
+store.get('key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+getSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is "value"
+store = event.source
+store.remove('key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+removeSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is null
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js b/LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js
index 031ece6..045db12 100644
--- a/LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js
+++ b/LayoutTests/storage/indexeddb/script-tests/idb-objectstore-request.js
@@ -4,7 +4,7 @@ if (window.layoutTestController)
function test()
{
- result = indexedDB.open('name', 'description');
+ result = evalAndLog("indexedDB.open('name', 'description')");
verifyResult(result);
result.onsuccess = openSuccess;
result.onerror = unexpectedErrorCallback;
@@ -12,17 +12,14 @@ function test()
function openSuccess()
{
+ debug("openSuccess():");
verifySuccessEvent(event);
-
var db = evalAndLog("db = event.result");
- createObjectStore(db);
-}
-function createObjectStore(db)
-{
// FIXME: remove any previously created object stores.
// This requires IDBDatabaseRequest::removeObjectStore to be implemented.
- result = db.createObjectStore('storeName', 'keyPath');
+
+ result = evalAndLog("db.createObjectStore('storeName', null)");
verifyResult(result);
result.onsuccess = createSuccess;
result.onerror = unexpectedErrorCallback;
@@ -30,12 +27,51 @@ function createObjectStore(db)
function createSuccess()
{
+ debug("createSuccess():");
verifySuccessEvent(event);
var store = evalAndLog("store = event.result");
+
shouldBeEqualToString("store.name", "storeName");
- shouldBeEqualToString("store.keyPath", "keyPath");
+ shouldBeNull("store.keyPath");
// FIXME: test store.indexNames, as well as all object store's methods.
+ result = evalAndLog("store.add('value', 'key')");
+ verifyResult(result);
+ result.onsuccess = addSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addSuccess()
+{
+ debug("addSuccess():");
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result", "key");
+ var store = evalAndLog("store = event.source");
+
+ result = evalAndLog("store.get('key')");
+ verifyResult(result);
+ result.onsuccess = getSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getSuccess()
+{
+ debug("getSuccess():");
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result", "value");
+ var store = evalAndLog("store = event.source");
+
+ result = evalAndLog("store.remove('key')");
+ verifyResult(result);
+ result.onsuccess = removeSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function removeSuccess()
+{
+ debug("removeSuccess():");
+ verifySuccessEvent(event);
+ shouldBeNull("event.result");
done();
}