Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js

Issue 2396883005: DevTools: add test for for page reload with screenshots not stopping recording (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, this ); 98 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, this );
99 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.Load, this._load, this); 99 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.Load, this._load, this);
100 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Req uestSelected, this._onRequestSelected, this); 100 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Req uestSelected, this._onRequestSelected, this);
101 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea rchCountUpdated, this._onSearchCountUpdated, this); 101 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea rchCountUpdated, this._onSearchCountUpdated, this);
102 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea rchIndexUpdated, this._onSearchIndexUpdated, this); 102 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Sea rchIndexUpdated, this._onSearchIndexUpdated, this);
103 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Upd ateRequest, this._onUpdateRequest, this); 103 this._networkLogView.addEventListener(WebInspector.NetworkLogView.Events.Upd ateRequest, this._onUpdateRequest, this);
104 104
105 WebInspector.DataSaverInfobar.maybeShowInPanel(this); 105 WebInspector.DataSaverInfobar.maybeShowInPanel(this);
106 } 106 }
107 107
108 WebInspector.NetworkPanel.displayScreenshotDelay = 1000;
109
108 WebInspector.NetworkPanel.prototype = { 110 WebInspector.NetworkPanel.prototype = {
109 /** 111 /**
110 * @param {!WebInspector.Event} event 112 * @param {!WebInspector.Event} event
111 */ 113 */
112 _onWindowChanged: function(event) 114 _onWindowChanged: function(event)
113 { 115 {
114 var startTime = Math.max(this._calculator.minimumBoundary(), event.data. startTime / 1000); 116 var startTime = Math.max(this._calculator.minimumBoundary(), event.data. startTime / 1000);
115 var endTime = Math.min(this._calculator.maximumBoundary(), event.data.en dTime / 1000); 117 var endTime = Math.min(this._calculator.maximumBoundary(), event.data.en dTime / 1000);
116 this._networkLogView.setWindow(startTime, endTime); 118 this._networkLogView.setWindow(startTime, endTime);
117 }, 119 },
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (this.isShowing() && this._filmStripRecorder) 268 if (this.isShowing() && this._filmStripRecorder)
267 this._filmStripRecorder.startRecording(); 269 this._filmStripRecorder.startRecording();
268 }, 270 },
269 271
270 /** 272 /**
271 * @param {!WebInspector.Event} event 273 * @param {!WebInspector.Event} event
272 */ 274 */
273 _load: function(event) 275 _load: function(event)
274 { 276 {
275 if (this._filmStripRecorder && this._filmStripRecorder.isRecording()) 277 if (this._filmStripRecorder && this._filmStripRecorder.isRecording())
276 this._pendingStopTimer = setTimeout(this._stopFilmStripRecording.bin d(this), 1000); 278 this._pendingStopTimer = setTimeout(this._stopFilmStripRecording.bin d(this), WebInspector.NetworkPanel.displayScreenshotDelay);
277 }, 279 },
278 280
279 _stopFilmStripRecording: function() 281 _stopFilmStripRecording: function()
280 { 282 {
281 this._filmStripRecorder.stopRecording(this._filmStripAvailable.bind(this )); 283 this._filmStripRecorder.stopRecording(this._filmStripAvailable.bind(this ));
282 delete this._pendingStopTimer; 284 delete this._pendingStopTimer;
283 }, 285 },
284 286
285 _toggleLargerRequests: function() 287 _toggleLargerRequests: function()
286 { 288 {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 * @return {boolean} 777 * @return {boolean}
776 */ 778 */
777 handleAction: function(context, actionId) 779 handleAction: function(context, actionId)
778 { 780 {
779 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); 781 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel);
780 console.assert(panel && panel instanceof WebInspector.NetworkPanel); 782 console.assert(panel && panel instanceof WebInspector.NetworkPanel);
781 panel._toggleRecording(); 783 panel._toggleRecording();
782 return true; 784 return true;
783 } 785 }
784 } 786 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/network-recording-after-reload-with-screenshots-enabled.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698