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

Unified Diff: third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html

Issue 2972073002: Mitigate the pushState IPC storm DoS. (Closed)
Patch Set: Make the test work (thanks dcheng!), move the flooding test per kinuko. Created 3 years, 5 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 | « no previous file | third_party/WebKit/Source/core/frame/History.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html
diff --git a/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html b/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html
new file mode 100644
index 0000000000000000000000000000000000000000..2805f86d57252faa95a653adb5022edc57ef793b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/loader/stateobjects/spam-pushstate-then-throttled.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+'use strict';
+
+// This value must match that in Source/core/frame/History.cpp.
+const kStateUpdateLimit = 50;
+for (let i = 0; i < kStateUpdateLimit; ++i) {
+ history.pushState("SpammyHistoryItem", "" + i);
+}
+assert_equals(kStateUpdateLimit, history.length);
+
+history.pushState("DiscardedSpamItem", "51");
kinuko 2017/07/11 00:38:04 I wanted to say this discarsion is impl-specific b
+assert_equals(kStateUpdateLimit, history.length);
+
+done();
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/History.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698