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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html

Issue 1780523005: Fix JSON serialization of PerformanceEntry subclasses (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/timing/PerformanceCompositeTiming.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html b/third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html
new file mode 100644
index 0000000000000000000000000000000000000000..9ae14b8f78b9bdb965338f6f6e0d66c87d041fb9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/performance-entry-serializer.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+<script>
+
+test(function() {
+ window.performance.mark('mark1');
+ window.performance.mark('mark2');
+ window.performance.measure('measure1', 'mark1', 'mark2');
+
+ var entries = window.performance.getEntries();
+ for (var i = 0; i < entries.length; i++) {
+ var entry = entries[i];
+ var serialized = JSON.parse(JSON.stringify(entry));
+ for (var attr in entry) {
+ if (typeof entry[attr] != 'function') {
+ assert_equals(serialized[attr], entry[attr], entry.constructor.name + '.' + attr);
+ }
+ }
+ }
+}, 'PerformanceEntry subclasses should serialize all attributes');
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698