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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html

Issue 2570733002: [Devtools] Fixed devtools altering srcset image after close (Closed)
Patch Set: changes Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-scale-not-persistant.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
index 88cdff7ffb10e8b6e9e004d7076f45c7d98cd613..bc93957aee3d03044e32a749c5a5baac195fdc41 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
@@ -373,6 +373,60 @@ InspectorTest.pageReloaded = function()
callback();
}
+InspectorTest.reloadProtocolTest = function(ignoreCache, callback)
+{
+ InspectorTest._pageLoadedCallback = afterReload;
+ // This will ensure we maintain logs after navigate.
+
+ getLogs(getOldLogsCallback);
+
+ function getLogs(getLogsCallback)
+ {
+ InspectorTest.evaluateInPage("outputElement.innerHTML", data => getLogsCallback(data.split("<br>")));
+ }
+
+ function clearLogs(clearLogsCallback)
+ {
+ InspectorTest.evaluateInPage("outputElement.textContent = \"\"", clearLogsCallback);
+ }
+
+ var oldLogs;
+
+ function getOldLogsCallback(data)
+ {
+ oldLogs = data;
+ prepareForReload();
+ }
+
+ function prepareForReload()
+ {
+ InspectorTest.evaluateInPage("prepareForReload()", reload);
+ }
+
+ function reload()
+ {
+ InspectorTest.sendCommand("Page.reload", { "ignoreCache": ignoreCache });
+ }
+
+ function afterReload()
+ {
+ var currentLogs;
+ getLogs(data => {
+ currentLogs = data;
+ clearLogs(addLogsBack);
+ });
+
+ function addLogsBack()
+ {
+ for (var log of oldLogs)
+ InspectorTest.log(log);
+ for (var log of currentLogs)
+ InspectorTest.log(log);
+ callback();
+ }
+ }
+}
+
window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false);
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-scale-not-persistant.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698