Index: third_party/WebKit/LayoutTests/inspector-protocol/page/frameScheduledNavigation.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/frameScheduledNavigation.js b/third_party/WebKit/LayoutTests/inspector-protocol/page/frameScheduledNavigation.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ce7b7b2a971a44d27695f70091ef127a2471aac6 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/frameScheduledNavigation.js |
@@ -0,0 +1,21 @@ |
+(async function(testRunner) { |
+ let {page, session, dp} = await testRunner.startBlank(''); |
+ |
+ dp.Page.enable(); |
+ session.evaluate(` |
+ var frame = document.createElement('iframe'); |
+ document.body.appendChild(frame); |
+ frame.src = '${testRunner.url('../resources/blank.html')}'; |
+ `); |
+ |
+ var msg = await dp.Page.onceFrameScheduledNavigation(); |
+ testRunner.log('Scheduled navigation with delay ' + msg.params.delay); |
+ |
+ await dp.Page.onceFrameStartedLoading(); |
+ // This event should be received before the scheduled navigation is cleared. |
+ testRunner.log('Started loading'); |
+ |
+ await dp.Page.onceFrameClearedScheduledNavigation(); |
+ testRunner.log('Cleared scheduled navigation'); |
+ testRunner.completeTest(); |
+}) |