diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-17 12:34:51 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-17 12:34:51 +0000 |
commit | 1717f29fbd361acecd5bf38132d42ed2a00afe47 (patch) | |
tree | 38f663e55b2708d9f43981150fc3af624a8a0aa9 /chrome/test/data | |
parent | c9fa8f31d868cce1592bca5c9989d4872ecfe6fb (diff) | |
download | chromium_src-1717f29fbd361acecd5bf38132d42ed2a00afe47.zip chromium_src-1717f29fbd361acecd5bf38132d42ed2a00afe47.tar.gz chromium_src-1717f29fbd361acecd5bf38132d42ed2a00afe47.tar.bz2 |
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
Diffstat (limited to 'chrome/test/data')
3 files changed, 56 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/webnavigation/history/c.html b/chrome/test/data/extensions/api_test/webnavigation/history/c.html new file mode 100644 index 0000000..dc0b4bf --- /dev/null +++ b/chrome/test/data/extensions/api_test/webnavigation/history/c.html @@ -0,0 +1 @@ +<script src="c.js"></script> diff --git a/chrome/test/data/extensions/api_test/webnavigation/history/c.js b/chrome/test/data/extensions/api_test/webnavigation/history/c.js new file mode 100644 index 0000000..f5bad4a --- /dev/null +++ b/chrome/test/data/extensions/api_test/webnavigation/history/c.js @@ -0,0 +1,5 @@ +// 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'); diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_history.js b/chrome/test/data/extensions/api_test/webnavigation/test_history.js index 409aec03..fedc5f5 100644 --- a/chrome/test/data/extensions/api_test/webnavigation/test_history.js +++ b/chrome/test/data/extensions/api_test/webnavigation/test_history.js @@ -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') }); + }, ]); }); }; |