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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-allowance-limit.html

Issue 2751953002: sendBeacon(): once transmission allowance has been reached, always fail. (Closed)
Patch Set: fix test description imprecision Created 3 years, 9 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/loader/PingLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-allowance-limit.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-allowance-limit.html b/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-allowance-limit.html
new file mode 100644
index 0000000000000000000000000000000000000000..095c322cab053cbf738b0953a83522dedd5c0852
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-allowance-limit.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<script src="/js-test-resources/testharness.js"></script>
+<script src="/js-test-resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ // Note: the limit used must be same as Settings#maxBeaconTransmission.
+ // First beacon request should go through, but with a zero allowance for
+ // any subsequent requests. Which must fail.
+ let payload = new Uint8Array(64 * 1024);
+ let result = navigator.sendBeacon("resources/blank.txt", payload);
+ assert_true(result);
+ result = navigator.sendBeacon("resources/blank.txt", payload);
+ assert_false(result);
+}, "navigator.sendBeacon() with a payload size greater than " +
+ "remaining transfer allowance should fail.");
+</script>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/PingLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698