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

Unified Diff: chrome/test/data/webui/net_internals/log_view_painter.js

Issue 17333003: Pretty-print QUIC CONNECTION_CLOSE and RST_STREAM error codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix enum/int conversion problems. Created 7 years, 6 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 | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | net/quic/quic_connection_logger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/net_internals/log_view_painter.js
diff --git a/chrome/test/data/webui/net_internals/log_view_painter.js b/chrome/test/data/webui/net_internals/log_view_painter.js
index 93bcfe1df953c9177abfe2c31a4f16e72152baea..8834c24994d407bba14f0dfef899e5e85d85342f 100644
--- a/chrome/test/data/webui/net_internals/log_view_painter.js
+++ b/chrome/test/data/webui/net_internals/log_view_painter.js
@@ -150,6 +150,7 @@ TEST_F('NetInternalsTest', 'netInternalsLogViewPainterPrintAsText', function() {
runTestCase(painterTestURLRequestIncompleteFromLoadedLog());
runTestCase(painterTestURLRequestIncompleteFromLoadedLogSingleEvent());
runTestCase(painterTestNetError());
+ runTestCase(painterTestQuicError());
runTestCase(painterTestHexEncodedBytes());
runTestCase(painterTestCertVerifierJob());
runTestCase(painterTestProxyConfigOneProxyAllSchemes());
@@ -1082,6 +1083,87 @@ function painterTestNetError() {
}
/**
+ * Tests the custom formatting of QUIC errors across several different event
+ * types.
+ */
+function painterTestQuicError() {
+ var testCase = {};
+ testCase.tickOffset = '1337911098446';
+
+ testCase.logEntries = [
+ {
+ 'params': {
+ "host": "www.example.com"
+ },
+ 'phase': EventPhase.PHASE_BEGIN,
+ 'source': {
+ 'id': 318,
+ 'type': EventSourceType.URL_REQUEST
+ },
+ 'time': '953675448',
+ 'type': EventType.QUIC_SESSION
+ },
+ {
+ 'params': {
+ 'details': "invalid headers",
+ 'quic_rst_stream_error':
+ QuicRstStreamError.QUIC_BAD_APPLICATION_PAYLOAD,
+ 'stream_id': 1
+ },
+ 'phase': EventPhase.PHASE_NONE,
+ 'source': {
+ 'id': 318,
+ 'type': EventSourceType.URL_REQUEST
+ },
+ 'time': '953675460',
+ 'type': EventType.QUIC_SESSION_RST_STREAM_FRAME_RECEIVED
+ },
+ {
+ 'params': {
+ 'quic_error': QuicError.QUIC_CONNECTION_TIMED_OUT,
+ },
+ 'phase': EventPhase.PHASE_NONE,
+ 'source': {
+ 'id': 318,
+ 'type': EventSourceType.URL_REQUEST
+ },
+ 'time': '953675705',
+ 'type': EventType.QUIC_SESSION_CONNECTION_CLOSE_FRAME_RECEIVED
+ },
+ {
+ 'params': {
+ 'quic_error': QuicError.QUIC_CONNECTION_TIMED_OUT
+ },
+ 'phase': EventPhase.PHASE_END,
+ 'source': {
+ 'id': 318,
+ 'type': EventSourceType.URL_REQUEST
+ },
+ 'time': '953675923',
+ 'type': EventType.QUIC_SESSION
+ }
+ ];
+
+ testCase.expectedText =
+'t=1338864773894 [st= 0] +QUIC_SESSION [dt=475]\n' +
+' --> host = "www.example.com"\n' +
+'t=1338864773906 [st= 12] QUIC_SESSION_RST_STREAM_FRAME_RECEIVED\n' +
+' --> details = "invalid headers"\n' +
+' --> quic_rst_stream_error = ' +
+ QuicRstStreamError.QUIC_BAD_APPLICATION_PAYLOAD + ' (' +
+ 'QUIC_BAD_APPLICATION_PAYLOAD)\n' +
+' --> stream_id = 1\n' +
+'t=1338864774151 [st=257] QUIC_SESSION_CONNECTION_CLOSE_FRAME_RECEIVED\n' +
+' --> quic_error = ' +
+ QuicError.QUIC_CONNECTION_TIMED_OUT + ' (QUIC_CONNECTION_TIMED_OUT)\n' +
+'t=1338864774369 [st=475] -QUIC_SESSION\n' +
+' --> quic_error = ' +
+ QuicError.QUIC_CONNECTION_TIMED_OUT + ' (QUIC_CONNECTION_TIMED_OUT)';
+
+ return testCase;
+}
+
+/**
* Tests the formatting of bytes sent/received as hex + ASCII. Note that the
* test data was truncated which is why the byte_count doesn't quite match the
* hex_encoded_bytes.
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | net/quic/quic_connection_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698