summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/printing
diff options
context:
space:
mode:
authortasak <tasak@google.com>2015-10-26 20:29:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-27 03:30:35 +0000
commit5d9a5a8c009a722f06051940345dc849612195bc (patch)
tree4344c95438db04f387261efe2b68c1764833a274 /third_party/WebKit/LayoutTests/printing
parent41826031a78af14dc53ab525f01aa0613bef44f9 (diff)
downloadchromium_src-5d9a5a8c009a722f06051940345dc849612195bc.zip
chromium_src-5d9a5a8c009a722f06051940345dc849612195bc.tar.gz
chromium_src-5d9a5a8c009a722f06051940345dc849612195bc.tar.bz2
Should not finish tests while printing.
Reported by cluster-fuzz: https://cluster-fuzz.appspot.com/testcase?key=6475256993153024 While blink::LocalDOMWindow::print, content_shell might finish loading some resource (mainly ImageResource). In this case, - test_runner::WebTestProxyBase::DidFinishResourceLoad will be invoked. - test_runner::WebTestProxyBase::CheckOne will be invoked. - Since all pending resources were loaded, will start CaptureDump. - blink::LocalFrame::setPrinting will be invoked. So we should not do CaptureDump while printing. BUG=539689 TEST=third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash.html Review URL: https://codereview.chromium.org/1411243006 Cr-Commit-Position: refs/heads/master@{#356233}
Diffstat (limited to 'third_party/WebKit/LayoutTests/printing')
-rw-r--r--third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash-expected.html5
-rw-r--r--third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash.html19
2 files changed, 24 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash-expected.html b/third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash-expected.html
new file mode 100644
index 0000000..0e3344e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash-expected.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<dialog
+ <form>
+ <input src="data:image/gif;base64,R0lGODdhAgACAIABAAAAAP///ywAAAAAAgACAAACA0QCBQA7" type="image"/>
+</dialog>
diff --git a/third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash.html b/third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash.html
new file mode 100644
index 0000000..b65a8d8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/printing/finish-loading-while-printing-crash.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<dialog
+ <form>
+ <!-- Any valid image encoded to data URL will do. -->
+ <!-- The important thing is that some valid image is loaded while -->
+ <!-- layout caused by print. -->
+ <!-- This causes test_runner to do WebTestProxyBase::checkDone. -->
+ <!-- If test_runner judges that the test is finished, CaptureDump -->
+ <!-- will be invoked and updateLayout will be invoked. -->
+ <!-- Since layout is running, the updateLayout causes crash. -->
+ <input src="data:image/gif;base64,R0lGODdhAgACAIABAAAAAP///ywAAAAAAgACAAACA0QCBQA7" type="image"/>
+</dialog>
+<!-- test for issue 539689: should not capture dump while printing. -->
+<!-- PASS if no crash occurs. -->
+<script>
+if (window.testRunner)
+ testRunner.setPrinting();
+print();
+</script>