https://github.com/web-platform-tests/wpt
Revision 9c167f6b27d42431d4c91ca181dcbe83e7fd7759 authored by Han Leon on 23 April 2018, 07:28:33 UTC, committed by Chromium WPT Sync on 23 April 2018, 07:28:33 UTC
This CL sets Client.url as the creation url (document_url_) of
corresponding ServiceWorkerProviderHost, instead of the
last_committed_url of corresponding render frame host, which may be a
result of history.pushState() and should not be considered as Client.url
according to the spec:
https://w3c.github.io/ServiceWorker/#dom-client-url
https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url

Bug: 658997
TEST=blink_tests
external/wpt/service-workers/service-worker/clients-matchall-client-types.https.html

Change-Id: Id7060b7d1292654fc8f23dd72eef629f6a874ef0
1 parent a8a8377
Raw File
Tip revision: 9c167f6b27d42431d4c91ca181dcbe83e7fd7759 authored by Han Leon on 23 April 2018, 07:28:33 UTC
[ServiceWorker] Let Client.url be the creation url of the window client
Tip revision: 9c167f6
storage_getitem.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>WebStorage Test: Storage - getItem(key) and named getter</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
["localStorage", "sessionStorage"].forEach(function(name) {
    test(function() {
        var storage = window[name];
        storage.clear();
        storage.setItem("name", "x");
        storage.setItem("undefined", "foo");
        storage.setItem("null", "bar");
        storage.setItem("", "baz");

        test(function() {
            assert_equals(storage.length, 4);
        }, "All items should be added to " + name + ".");

        test(function() {
            assert_equals(storage["unknown"], undefined, "storage['unknown']")
            assert_equals(storage["name"], "x", "storage['name']")
            assert_equals(storage["undefined"], "foo", "storage['undefined']")
            assert_equals(storage["null"], "bar", "storage['null']")
            assert_equals(storage[undefined], "foo", "storage[undefined]")
            assert_equals(storage[null], "bar", "storage[null]")
            assert_equals(storage[""], "baz", "storage['']")
        }, "Named access to " + name + " should be correct");

        test(function() {
            assert_equals(storage.getItem("unknown"), null, "storage.getItem('unknown')")
            assert_equals(storage.getItem("name"), "x", "storage.getItem('name')")
            assert_equals(storage.getItem("undefined"), "foo", "storage.getItem('undefined')")
            assert_equals(storage.getItem("null"), "bar", "storage.getItem('null')")
            assert_equals(storage.getItem(undefined), "foo", "storage.getItem(undefined)")
            assert_equals(storage.getItem(null), "bar", "storage.getItem(null)")
            assert_equals(storage.getItem(""), "baz", "storage.getItem('')")
        }, name + ".getItem should be correct")
    }, "Get value by getIten(key) and named access in " + name + ".");
});
</script>
back to top