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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html

Issue 1913993004: [Devtools] Fix to XMLView in Network Preview panel broken (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/LayoutTests/http/tests/inspector/network/network-choose-preview-view-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html
new file mode 100644
index 0000000000000000000000000000000000000000..907186d643e819e37726cce46d7dd5071318d315
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html
@@ -0,0 +1,87 @@
+<html>
+<head>
+<script src="../inspector-test.js"></script>
+<script src="../network-test.js"></script>
+<script>
+function test()
+{
+ function createNetworkRequest(mimeType, content, statusCode)
+ {
+ InspectorTest.addResult("Creating a NetworkRequest with mimeType: " + mimeType);
+ var request = new WebInspector.NetworkRequest(WebInspector.mainTarget, 0, 'http://localhost');
+ request.mimeType = mimeType;
+ request._content = content;
+ if (statusCode !== undefined)
+ request.statusCode = statusCode;
+ return request;
+ }
+
+ function getViewName(previewer)
+ {
+ if (!previewer)
+ return "** NONE **";
+ if (previewer instanceof WebInspector.SearchableView)
+ return "SearchableView > " + getViewName(previewer._searchProvider);
+ return previewer.contentElement.className;
+ }
+
+ function testPreviewer(request, callback)
+ {
+ var previewView = new WebInspector.RequestPreviewView(request, new WebInspector.RequestResponseView(request));
+
+ previewView._createPreviewView(function(previewer) {
+ InspectorTest.addResult("Its previewer type: " + getViewName(previewer));
+ callback();
+ });
+ }
+
+ function testType(contentType, content, statusCode, callback)
+ {
+ var request = createNetworkRequest(contentType, content, statusCode);
+ testPreviewer(request, callback);
+ }
+ InspectorTest.runTestSuite([
+ function testSimpleJSON(next)
+ {
+ testType("application/json", "[533,3223]", 200, next);
+ },
+ function testMimeJSON(next)
+ {
+ testType("application/vnd.document+json", "{foo0foo: 123}", 200, next);
+ },
+ function testSimpleXML(next)
+ {
+ testType("text/xml", "<bar><foo/></bar>", 200, next);
+ },
+ function testXMLMimeButJSON(next)
+ {
+ testType("text/xml", "{foo0: 'barr', 'barr': 'fooo'}", 200, next);
+ },
+ function testXMLWithUnknownMime(next)
+ {
+ testType("text/foobar", "<bar><foo/></bar>", 200, next);
+ },
+ function testXMLWithError500(next)
+ {
+ testType("text/xml", "<bar><foo/></bar>", 500, next);
+ },
+ function testUnknownMimeTextWithError500(next)
+ {
+ testType("text/foobar", "Foo Bar", 500, next);
+ },
+ function testBinaryImageFile(next)
+ {
+ testType("image/png", "Bin\0ary\1 File\0\0", 200, next);
+ },
+ function testBinaryBlankImageFile(next)
+ {
+ testType("image/png", "", 200, next);
+ },
+ ]);
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests to make sure the proper view is used for the data that is received in network panel.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698