Commit f39dc09c authored by valih's avatar valih Committed by Commit bot

DevTools: add test for for page reload with screenshots not stopping recording

BUG=569557

Review-Url: https://codereview.chromium.org/2396883005
Cr-Commit-Position: refs/heads/master@{#423784}
parent ea009531
Tests if page keeps recording after refresh with Screenshot enabled. Bug 569557
Page reloaded.
Still recording
<html>
<head>
<script src="../inspector-test.js"></script>
<script src="../network-test.js"></script>
<script>
function test()
{
WebInspector.panels.network._networkRecordFilmStripSetting.set(true);
WebInspector.NetworkPanel._displayScreenshotDelay = 0;
InspectorTest.resourceTreeModel.reloadPage();
InspectorTest.runWhenPageLoads(() => setTimeout(checkRecording, 50));
function checkRecording()
{
InspectorTest.addResult(WebInspector.panels.network._networkLogView._recording ? "Still recording" : "Not recording");
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p id="test"></p>
<p>
Tests if page keeps recording after refresh with Screenshot enabled.
<a>Bug 569557</a>
</p>
</body>
</html>
...@@ -105,6 +105,8 @@ WebInspector.NetworkPanel = function() ...@@ -105,6 +105,8 @@ WebInspector.NetworkPanel = function()
WebInspector.DataSaverInfobar.maybeShowInPanel(this); WebInspector.DataSaverInfobar.maybeShowInPanel(this);
} }
WebInspector.NetworkPanel.displayScreenshotDelay = 1000;
WebInspector.NetworkPanel.prototype = { WebInspector.NetworkPanel.prototype = {
/** /**
* @param {!WebInspector.Event} event * @param {!WebInspector.Event} event
...@@ -273,7 +275,7 @@ WebInspector.NetworkPanel.prototype = { ...@@ -273,7 +275,7 @@ WebInspector.NetworkPanel.prototype = {
_load: function(event) _load: function(event)
{ {
if (this._filmStripRecorder && this._filmStripRecorder.isRecording()) if (this._filmStripRecorder && this._filmStripRecorder.isRecording())
this._pendingStopTimer = setTimeout(this._stopFilmStripRecording.bind(this), 1000); this._pendingStopTimer = setTimeout(this._stopFilmStripRecording.bind(this), WebInspector.NetworkPanel.displayScreenshotDelay);
}, },
_stopFilmStripRecording: function() _stopFilmStripRecording: function()
......
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