Commit 1717f29f authored by jochen@chromium.org's avatar jochen@chromium.org

Don't send the oncompleted signal twice in the webnavigation API

We shouldn't preemptivly mark a navigation as completed if it's a
history or reference fragment navigation, as such a navigation might
happen in parallel to an ongoing navigation

BUG=279483
R=marja@chromium.org

Review URL: https://chromiumcodereview.appspot.com/24197002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223596 0039d316-1c4b-4281-b951-d872f2087c98
parent c9fa8f31
......@@ -447,9 +447,6 @@ void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame(
navigation_state_.UpdateFrame(frame_id, url);
navigation_state_.SetNavigationCommitted(frame_id);
if (is_reference_fragment_navigation || is_history_state_modification)
navigation_state_.SetNavigationCompleted(frame_id);
if (!navigation_state_.CanSendEvents(frame_id))
return;
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
history.pushState({}, 'foo', 'd.html');
......@@ -54,6 +54,56 @@ onload = function() {
[ navigationOrder("a-") ]);
chrome.tabs.update(tabId, { url: getURL('history/a.html') });
},
// Manipulating history before parsing completed.
function historyBeforeParsing() {
expect([
{ label: "a-onBeforeNavigate",
event: "onBeforeNavigate",
details: { frameId: 0,
parentFrameId: -1,
processId: 0,
tabId: 0,
timeStamp: 0,
url: getURL('history/c.html') }},
{ label: "a-onCommitted",
event: "onCommitted",
details: { frameId: 0,
processId: 0,
tabId: 0,
timeStamp: 0,
transitionQualifiers: [],
transitionType: "link",
url: getURL('history/c.html') }},
{ label: "a-onHistoryStateUpdated",
event: "onHistoryStateUpdated",
details: { frameId: 0,
processId: 0,
tabId: 0,
timeStamp: 0,
transitionQualifiers: [],
transitionType: "link",
url: getURL('history/d.html') }},
{ label: "a-onDOMContentLoaded",
event: "onDOMContentLoaded",
details: { frameId: 0,
processId: 0,
tabId: 0,
timeStamp: 0,
url: getURL('history/d.html') }},
{ label: "a-onCompleted",
event: "onCompleted",
details: { frameId: 0,
processId: 0,
tabId: 0,
timeStamp: 0,
url: getURL('history/d.html') }}],
[ navigationOrder("a-"),
[ 'a-onCommitted',
'a-onHistoryStateUpdated',
'a-onDOMContentLoaded']]);
chrome.tabs.update(tabId, { url: getURL('history/c.html') });
},
]);
});
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment