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

Unified Diff: LayoutTests/http/tests/misc/webtiming-buffer-full-no-event.html

Issue 18916003: Performance.onwebkitresourcetimingbufferfull should be a Function (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
Index: LayoutTests/http/tests/misc/webtiming-buffer-full-no-event.html
diff --git a/LayoutTests/http/tests/misc/webtiming-buffer-full-no-event.html b/LayoutTests/http/tests/misc/webtiming-buffer-full-no-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..04effd8357ef163358a131887b4fb1e86f8d2650
--- /dev/null
+++ b/LayoutTests/http/tests/misc/webtiming-buffer-full-no-event.html
@@ -0,0 +1,35 @@
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+<script>
+description("This test validates the functionality of onresourcetimingbufferfull in resource timing.");
+jsTestIsAsync = true;
+var bufferFullCount = 0;
+var parameter;
+
+function onBufferFull(event) {
+ parameter = event;
+ // No parameter should be given as this is not an event.
+ shouldBeUndefined("parameter");
+ bufferFullCount++;
arv (Not doing code reviews) 2013/07/09 18:19:58 Can you also assert that this === window.performan
+}
+
+performance.webkitSetResourceTimingBufferSize(2);
+shouldBeNull('performance.onwebkitresourcetimingbufferfull');
+performance.onwebkitresourcetimingbufferfull = onBufferFull;
+shouldBe('performance.onwebkitresourcetimingbufferfull', 'onBufferFull');
+</script>
+</head>
+<body onload="test()">
+<script>
+function test() {
+ // Make sure the onBufferFull callback was called exactly 1 time.
+ shouldBe('bufferFullCount', '1');
+ performance.onwebkitresourcetimingbufferfull = null;
+ shouldBeNull('performance.onwebkitresourcetimingbufferfull');
+ finishJSTest();
+}
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698