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

Unified Diff: third_party/WebKit/Source/devtools/front_end/Tests.js

Issue 1828203005: Expose SPDY pushes in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated wording on push_end comment Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/Tests.js
diff --git a/third_party/WebKit/Source/devtools/front_end/Tests.js b/third_party/WebKit/Source/devtools/front_end/Tests.js
index c2bddb498112e1856d20017790716fb1b4a44f81..df304856e7c8db9f9dc760ca06f39a904b2ec83d 100644
--- a/third_party/WebKit/Source/devtools/front_end/Tests.js
+++ b/third_party/WebKit/Source/devtools/front_end/Tests.js
@@ -526,6 +526,35 @@ TestSuite.prototype.testNetworkTiming = function()
};
+TestSuite.prototype.testPushTimes = function(url)
+{
+ var test = this;
+ var pendingResourceCount = 2;
+
+ function finishResource(resource, finishTime)
+ {
+ test.assertTrue(typeof resource.timing.pushStart === "number" && resource.timing.pushStart > 0, `pushStart is invalid: ${resource.timing.pushStart}`);
+ test.assertTrue(typeof resource.timing.pushEnd === "number", `pushEnd is invalid: ${resource.timing.pushEnd}`);
+ test.assertTrue(resource.timing.pushStart < resource.startTime, "pushStart should be before startTime");
+ if (resource.url.endsWith("?pushUseNullEndTime")) {
+ test.assertTrue(resource.timing.pushEnd === 0, `pushEnd should be 0 but is ${resource.timing.pushEnd}`);
+ } else {
+ test.assertTrue(resource.timing.pushStart < resource.timing.pushEnd, `pushStart should be before pushEnd (${resource.timing.pushStart} >= ${resource.timing.pushEnd})`);
+ test.assertTrue(resource.timing.pushEnd < resource.endTime, "pushEnd should be before endTime");
+ test.assertTrue(resource.startTime < resource.timing.pushEnd, "pushEnd should be after startTime");
dgozman 2016/04/15 21:13:16 Let's comment this is not true generally, but we m
+ }
+ if (!--pendingResourceCount)
+ test.releaseControl();
+ }
+
+ this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishNetworkRequest", finishResource, true);
+
+ test.evaluateInConsole_("addImage('" + url + "')", function(resultText) {});
+ test.evaluateInConsole_("addImage('" + url + "?pushUseNullEndTime')", function(resultText) {});
+ this.takeControl();
+};
+
+
TestSuite.prototype.testConsoleOnNavigateBack = function()
{
if (WebInspector.multitargetConsoleModel.messages().length === 1)

Powered by Google App Engine
This is Rietveld 408576698