Commit 0a06353e authored by Findit's avatar Findit

Revert "DevTools: add Page.frameRequestedNavigation, deprecate...

Revert "DevTools: add Page.frameRequestedNavigation, deprecate Page.frameScheduledNavigation and frameClearedScheduledNavigation"

This reverts commit a8016f0c.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 642246 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtL2E4MDE2ZjBjYmE0MmQzNWUwNDdkMDUwMDJjNDZjMDNiZTM4MGExNmEM

Sample Failed Build: https://ci.chromium.org/buildbot/chromium.win/Win7%20Tests%20%281%29/89416

Sample Failed Step: webkit_layout_tests

Original change's description:
> DevTools: add Page.frameRequestedNavigation, deprecate Page.frameScheduledNavigation and frameClearedScheduledNavigation
> 
> - add FrameRequestedNavigation probe that gets dispatched whenever client-initiated navigation request is sent to browser and carries reason for navigation;
> - expose the above as Page.frameRequestedNavigation
> - deprecate Page.frameScheduledNavigation and Page.frameClearedScheduledNavigation;
> 
> 
> Change-Id: Ia652b5381c22b68962a6f568e7cb18456dc0269a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524706
> Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#642246}

Change-Id: Ibb40f45320d12e3196136265078316358150897c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531713
Cr-Commit-Position: refs/heads/master@{#642306}
parent c7d191f4
......@@ -536,10 +536,9 @@ void LocalFrame::Reload(WebFrameLoadType load_type) {
request.SetInputStartTime(input_event->TimeStamp());
probe::FrameScheduledNavigation(this, request.GetResourceRequest().Url(), 0.0,
ClientNavigationReason::kReload);
probe::FrameRequestedNavigation(this, request.GetResourceRequest().Url(),
ClientNavigationReason::kReload);
loader_.StartNavigation(request, load_type);
probe::FrameClearedScheduledNavigation(this);
loader_.StartNavigation(request, load_type);
}
LocalWindowProxy* LocalFrame::WindowProxy(DOMWrapperWorld& world) {
......
......@@ -5054,16 +5054,6 @@ domain Page
# Default fixed font size.
optional integer fixed
experimental type ClientNavigationReason extends string
enum
formSubmissionGet
formSubmissionPost
httpHeaderRefresh
scriptInitiated
metaTagRefresh
pageBlockInterstitial
reload
# Deprecated, please use addScriptToEvaluateOnNewDocument instead.
experimental deprecated command addScriptToEvaluateOnLoad
parameters
......@@ -5547,7 +5537,7 @@ domain Page
optional Runtime.StackTrace stack
# Fired when frame no longer has a scheduled navigation.
deprecated event frameClearedScheduledNavigation
experimental event frameClearedScheduledNavigation
parameters
# Id of the frame that has cleared its scheduled navigation.
FrameId frameId
......@@ -5566,19 +5556,8 @@ domain Page
experimental event frameResized
# Fired when a renderer-initiated navigation is requested.
# Navigation may still be cancelled after the event is issued.
experimental event frameRequestedNavigation
parameters
# Id of the frame that has scheduled a navigation.
FrameId frameId
# The reason for the navigation.
ClientNavigationReason reason
# The destination URL for the requested navigation.
string url
# Fired when frame schedules a potential navigation.
deprecated event frameScheduledNavigation
experimental event frameScheduledNavigation
parameters
# Id of the frame that has scheduled a navigation.
FrameId frameId
......
......@@ -935,15 +935,6 @@ void InspectorPageAgent::FrameStoppedLoading(LocalFrame* frame) {
GetFrontend()->frameStoppedLoading(IdentifiersFactory::FrameId(frame));
}
void InspectorPageAgent::FrameRequestedNavigation(
LocalFrame* frame,
const KURL& url,
ClientNavigationReason reason) {
GetFrontend()->frameRequestedNavigation(
IdentifiersFactory::FrameId(frame),
ClientNavigationReasonToProtocol(reason), url.GetString());
}
void InspectorPageAgent::FrameScheduledNavigation(
LocalFrame* frame,
const KURL& url,
......
......@@ -184,9 +184,6 @@ class CORE_EXPORT InspectorPageAgent final
void FrameDetachedFromParent(LocalFrame*);
void FrameStartedLoading(LocalFrame*);
void FrameStoppedLoading(LocalFrame*);
void FrameRequestedNavigation(LocalFrame*,
const KURL&,
ClientNavigationReason);
void FrameScheduledNavigation(LocalFrame*,
const KURL&,
double delay,
......
......@@ -379,8 +379,6 @@ void NavigationScheduler::NavigateTask() {
}
ScheduledNavigation* redirect(redirect_.Release());
probe::FrameRequestedNavigation(frame_, redirect->Url(),
redirect->GetReason());
redirect->Fire(frame_);
probe::FrameClearedScheduledNavigation(frame_);
}
......
......@@ -164,7 +164,6 @@
"FrameAttachedToParent",
"FrameClearedScheduledNavigation",
"FrameDetachedFromParent",
"FrameRequestedNavigation",
"FrameScheduledNavigation",
"FrameStartedLoading",
"FrameStoppedLoading",
......
......@@ -121,7 +121,6 @@ interface CoreProbes {
void FrameOwnerContentUpdated([Keep] LocalFrame*, HTMLFrameOwnerElement*);
void FrameStartedLoading([Keep] LocalFrame*);
void FrameStoppedLoading([Keep] LocalFrame*);
void FrameRequestedNavigation([Keep] LocalFrame*, const KURL& url, ClientNavigationReason reason);
void FrameScheduledNavigation([Keep] LocalFrame*, const KURL& url, double delay, ClientNavigationReason reason);
void FrameClearedScheduledNavigation([Keep] LocalFrame*);
void DidCreateWebSocket([Keep] ExecutionContext*, uint64_t identifier, const KURL& request_url, const String& protocol);
......
......@@ -868,13 +868,6 @@ SDK.PageDispatcher = class {
frameStoppedLoading(frameId) {
}
/**
* @override
* @param {!Protocol.Page.FrameId} frameId
*/
frameRequestedNavigation(frameId) {
}
/**
* @override
* @param {!Protocol.Page.FrameId} frameId
......
......@@ -158,14 +158,6 @@ SDK.ScreenCaptureModel = class extends SDK.SDKModel {
frameStoppedLoading(frameId) {
}
/**
* @override
* @param {!Protocol.Page.FrameId} frameId
*/
frameRequestedNavigation(frameId) {
}
/**
* @override
* @param {!Protocol.Page.FrameId} frameId
......
Tests loading and navigation events when submitting a form in an onload handler.
FrameStartedLoading
FrameScheduledNavigation
FrameStoppedLoading
FrameStartedLoading
FrameClearedScheduledNavigation
FrameStoppedLoading
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank('Tests loading and navigation events when submitting a form in an onload handler.');
dp.Page.onFrameStartedLoading(() => testRunner.log('FrameStartedLoading'));
dp.Page.onFrameStoppedLoading(() => { testRunner.log('FrameStoppedLoading'); });
dp.Page.onFrameScheduledNavigation(() => testRunner.log('FrameScheduledNavigation'));
dp.Page.onFrameClearedScheduledNavigation(() => testRunner.log('FrameClearedScheduledNavigation'));
await dp.Page.enable();
dp.Page.navigate({url: testRunner.url('resources/post-in-onload.html')});
await dp.Page.onceFrameStartedLoading();
await dp.Page.onceFrameStoppedLoading();
await dp.Page.onceFrameStartedLoading();
await dp.Page.onceFrameStoppedLoading();
testRunner.completeTest();
})
Tests reasons for client-requested navigation are properly reported.
Frame requested navigation to http://127.0.0.1:8000/inspector-protocol/page/resources/frame-requested-navigation-2.html: metaTagRefresh
Frame requested navigation to http://127.0.0.1:8000/inspector-protocol/page/resources/frame-requested-navigation-2?step=1: scriptInitiated
Frame requested navigation to http://127.0.0.1:8000/inspector-protocol/page/resources/frame-requested-navigation-2.html?step=2: formSubmissionPost
Frame requested navigation to http://127.0.0.1:8000/inspector-protocol/page/resources/frame-requested-navigation-2.html?step=3: formSubmissionGet
Frame requested navigation to http://127.0.0.1:8000/inspector-protocol/page/resources/frame-requested-navigation-2.html?step=3: reload
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank('Tests reasons for client-requested navigation are properly reported.');
dp.Page.enable();
dp.Page.navigate({url: testRunner.url('resources/frame-requested-navigation-1.html')});
for (let i = 0; i < 5; ++i) {
const params = (await dp.Page.onceFrameRequestedNavigation()).params;
testRunner.log(`Frame requested navigation to ${params.url}: ${params.reason}`);
}
testRunner.completeTest();
})
<html>
<head>
<meta http-equiv="refresh" content="0; url=frame-requested-navigation-2.html">
</head>
</html>
\ No newline at end of file
<html>
<head>
<script>
function nextStep() {
const step = new URLSearchParams(window.location.search).get("step");
switch (step) {
case "1":
document.forms[0].submit();
break;
case "2":
document.forms[1].submit();
break;
case "3":
window.location.reload();
break;
default:
window.location.href = "frame-requested-navigation-2?step=1"
}
}
</script>
</head>
<body onload="nextStep();">
<form method="POST" action="frame-requested-navigation-2.html?step=2">
<input type="hidden" name="step">
</form>
<form method="GET" action="frame-requested-navigation-2.html">
<input type="hidden" name="step" value="3">
</form>
</body>
</html>
<html>
<body onload="document.forms[0].submit();">
<form method="POST" action="form">
<input type="hidden" name="step" value="2">
</form>
</body>
</html>
\ No newline at end of file
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