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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling-1.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>Support page for beforeunload-canceling.html</title>
4
5 <h1>If this goes away, it navigated</h1>
6
7 <script>
8 "use strict";
9
10 window.runTest = (t, { valueToReturn, expectCancelation, setReturnValue, expecte dReturnValue }) => {
11 window.onbeforeunload = t.step_func(e => {
12 if (setReturnValue !== undefined) {
13 e.returnValue = setReturnValue;
14 }
15
16 return valueToReturn;
17 });
18
19 const listener = t.step_func(e => {
20 top.assert_equals(e.defaultPrevented, expectCancelation, "canceled");
21 top.assert_equals(e.returnValue, expectedReturnValue, "returnValue");
22 window.onbeforeunload = null;
23
24 t.done();
25 });
26
27 window.addEventListener("beforeunload", listener);
28
29 window.location.href = "about:blank";
30 };
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698