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

Unified Diff: content/shell/renderer/test_runner/web_test_proxy.cc

Issue 550343002: Give the layout test harness better information to determine when to finish. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/web_test_proxy.cc
diff --git a/content/shell/renderer/test_runner/web_test_proxy.cc b/content/shell/renderer/test_runner/web_test_proxy.cc
index d7a33f15f8b2abcdf5efc6ba40718cf7ee32a144..b47c255f0aa88b13ed2bfe586a99f20489e3aa3a 100644
--- a/content/shell/renderer/test_runner/web_test_proxy.cc
+++ b/content/shell/renderer/test_runner/web_test_proxy.cc
@@ -927,7 +927,7 @@ bool WebTestProxyBase::DidFailProvisionalLoad(blink::WebLocalFrame* frame,
PrintFrameDescription(delegate_, frame);
delegate_->printMessage(" - didFailProvisionalLoadWithError\n");
}
- LocationChangeDone(frame);
+ CheckDone(frame, MainResourceLoadFailed);
return !frame->provisionalDataSource();
}
@@ -992,7 +992,7 @@ void WebTestProxyBase::DidFailLoad(blink::WebLocalFrame* frame,
PrintFrameDescription(delegate_, frame);
delegate_->printMessage(" - didFailLoadWithError\n");
}
- LocationChangeDone(frame);
+ CheckDone(frame, MainResourceLoadFailed);
}
void WebTestProxyBase::DidFinishLoad(blink::WebLocalFrame* frame) {
@@ -1000,7 +1000,7 @@ void WebTestProxyBase::DidFinishLoad(blink::WebLocalFrame* frame) {
PrintFrameDescription(delegate_, frame);
delegate_->printMessage(" - didFinishLoadForFrame\n");
}
- LocationChangeDone(frame);
+ CheckDone(frame, LoadFinished);
}
void WebTestProxyBase::DidDetectXSS(blink::WebLocalFrame* frame,
@@ -1160,6 +1160,9 @@ void WebTestProxyBase::DidFinishResourceLoad(blink::WebLocalFrame* frame,
delegate_->printMessage(" - didFinishLoading\n");
}
resource_identifier_map_.erase(identifier);
+#if !defined(ENABLE_LOAD_COMPLETION_HACKS)
+ CheckDone(frame, ResourceLoadCompleted);
+#endif
}
void WebTestProxyBase::DidAddMessageToConsole(
@@ -1204,9 +1207,21 @@ void WebTestProxyBase::DidAddMessageToConsole(
delegate_->printMessage(std::string("\n"));
}
-void WebTestProxyBase::LocationChangeDone(blink::WebFrame* frame) {
+void WebTestProxyBase::CheckDone(blink::WebLocalFrame* frame,
+ CheckDoneReason reason) {
if (frame != test_interfaces_->GetTestRunner()->topLoadingFrame())
return;
+
+#if !defined(ENABLE_LOAD_COMPLETION_HACKS)
+ // Quirk for MHTML prematurely completing on resource load completion.
+ std::string mime_type = frame->dataSource()->response().mimeType().utf8();
+ if (reason == ResourceLoadCompleted && mime_type == "multipart/related")
+ return;
+
+ if (reason != MainResourceLoadFailed &&
+ (frame->isResourceLoadInProgress() || frame->isLoading()))
+ return;
+#endif
test_interfaces_->GetTestRunner()->setTopLoadingFrame(frame, true);
}
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698