Commit 7f56d078 authored by Nate Chapin's avatar Nate Chapin Committed by moz-wptsync-bot
Browse files

Bug 1721305 [wpt PR 29714] - AppHistoryNavigateEvent.navigationType,...

Bug 1721305 [wpt PR 29714] - AppHistoryNavigateEvent.navigationType, AppHistoryDestination.key, and AppHistoryDestination.id, a=testonly

Automatic update from web-platform-tests
AppHistoryNavigateEvent.navigationType, AppHistoryDestination.key, and AppHistoryDestination.id

navigationType is set to one of ("push", "replace", "reload", "traverse"), and
is derived from the WebFrameLoadType of the navigation.

key and id are set on AppHistoryDestination only in the "traverse" case,
because that is the only case where the key and id are known at the time
of the navigate event.

Bug: 1183545
Change-Id: I772418351931c3a74a45410001b51ea737da61a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3040051


Auto-Submit: Nate Chapin <japhet@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Reviewed-by: default avatarDomenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#904539}

--

wpt-commits: 6dd52418972ac71bc97e962d1b4833c1ac01047f
wpt-pr: 29714
parent 764860ef
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
<script>
async_test(t => {
  appHistory.onnavigate = t.step_func_done(e => {
    assert_equals(e.navigationType, "push");
    assert_true(e.cancelable);
    assert_false(e.canRespond);
    assert_false(e.userInitiated);
@@ -12,6 +13,9 @@ async_test(t => {
    assert_equals(e.formData, null);
    assert_equals(e.destination.url, "https://does-not-exist/foo.html");
    assert_false(e.destination.sameDocument);
    assert_equals(e.destination.key, null);
    assert_equals(e.destination.id, null);
    assert_equals(e.destination.index, -1);
    e.preventDefault();
  });
  a.click();
+4 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
<script>
async_test(t => {
  appHistory.onnavigate = t.step_func(e => {
    assert_equals(e.navigationType, "push");
    assert_true(e.cancelable);
    assert_true(e.canRespond);
    assert_false(e.userInitiated);
@@ -12,6 +13,9 @@ async_test(t => {
    assert_equals(e.formData, null);
    assert_equals(new URL(e.destination.url).hash, "#1");
    assert_true(e.destination.sameDocument);
    assert_equals(e.destination.key, null);
    assert_equals(e.destination.id, null);
    assert_equals(e.destination.index, -1);
    e.preventDefault();
    t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
  });
+4 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
<script>
async_test(t => {
  appHistory.onnavigate = t.step_func_done(e => {
    assert_equals(e.navigationType, "push");
    assert_true(e.cancelable);
    assert_true(e.canRespond);
    assert_false(e.userInitiated);
@@ -13,6 +14,9 @@ async_test(t => {
    assert_equals(new URL(e.destination.url).pathname,
                  "/app-history/navigate-event/foo.html");
    assert_false(e.destination.sameDocument);
    assert_equals(e.destination.key, null);
    assert_equals(e.destination.id, null);
    assert_equals(e.destination.index, -1);
    e.preventDefault();
  });
  a.click();
+4 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
<script>
async_test(t => {
  appHistory.onnavigate = t.step_func(e => {
    assert_equals(e.navigationType, "push");
    assert_true(e.cancelable);
    assert_true(e.canRespond);
    assert_true(e.userInitiated);
@@ -15,6 +16,9 @@ async_test(t => {
    assert_equals(e.formData, null);
    assert_equals(new URL(e.destination.url).hash, "#1");
    assert_true(e.destination.sameDocument);
    assert_equals(e.destination.key, null);
    assert_equals(e.destination.id, null);
    assert_equals(e.destination.index, -1);
    e.preventDefault();
    t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
  });
+4 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ async_test(t => {
      assert_unreached("onnavigate should not have fired in source window");
    });
    iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
      assert_equals(e.navigationType, "push");
      assert_true(e.cancelable);
      assert_true(e.canRespond);
      assert_false(e.userInitiated);
@@ -18,6 +19,9 @@ async_test(t => {
      assert_equals(new URL(e.destination.url).pathname,
                    "/app-history/navigate-event/foo.html");
      assert_false(e.destination.sameDocument);
      assert_equals(e.destination.key, null);
      assert_equals(e.destination.id, null);
      assert_equals(e.destination.index, -1);
      e.preventDefault();
    });
    a.click();
Loading