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
event_session_oldvalue.html
<!DOCTYPE HTML>
<html>
 <head>
  <title>WebStorage Test: sessionStorage event - oldValue</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
    <h1>event_session_oldValue</h1>
    <div id="log"></div>
    <script>
        async_test(function(t) {
            sessionStorage.clear();
            t.add_cleanup(function() { sessionStorage.clear() });

            self.fail = t.step_func(function(msg) {
                assert_unreached(msg);
                t.done();
            });

            var expected = [null, 'user1', null]
            function onStorageEvent(event) {
                assert_equals(event.oldValue, expected.shift());
                if (!expected.length) {
                    t.done();
                }
            }

            window.addEventListener('storage', t.step_func(onStorageEvent), false);

            var el = document.createElement("iframe");
            el.setAttribute('id', 'ifrm');
            el.setAttribute('src', 'resources/session_change_item_iframe.html');
            document.body.appendChild(el);
        }, "oldvalue property test of session event - Session event is fired due to an invocation of the setItem(), clear() methods.");
    </script>
 </body>
</html>
back to top