Commit 20decfe2 authored by Eugene Ostroukhov's avatar Eugene Ostroukhov Committed by Commit Bot

DevTools: Port next portion of the network tests

Bug: 667560
Change-Id: Ib684737981db2d50aba7031a26d4e48cfc3fb1bf
Reviewed-on: https://chromium-review.googlesource.com/792263
Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org>
Reviewed-by: default avatarWill Chen <chenwilliam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519762}
parent fbf94922
...@@ -155,8 +155,8 @@ crbug.com/451577 [ Mac ] http/tests/devtools/extensions/extensions-resources.htm ...@@ -155,8 +155,8 @@ crbug.com/451577 [ Mac ] http/tests/devtools/extensions/extensions-resources.htm
crbug.com/451577 [ Win10 ] http/tests/devtools/extensions/extensions-sidebar.html [ Slow ] crbug.com/451577 [ Win10 ] http/tests/devtools/extensions/extensions-sidebar.html [ Slow ]
crbug.com/451577 [ Mac ] http/tests/devtools/layers/layer-canvas-log.js [ Slow ] crbug.com/451577 [ Mac ] http/tests/devtools/layers/layer-canvas-log.js [ Slow ]
crbug.com/667560 [ Mac ] virtual/mojo-loading/http/tests/devtools/layers/layer-canvas-log.js [ Slow ] crbug.com/667560 [ Mac ] virtual/mojo-loading/http/tests/devtools/layers/layer-canvas-log.js [ Slow ]
crbug.com/451577 [ Mac ] http/tests/devtools/network/network-domain-filter.html [ Slow ] crbug.com/451577 [ Mac ] http/tests/devtools/network/network-domain-filter.js [ Slow ]
crbug.com/667560 [ Mac ] virtual/mojo-loading/http/tests/devtools/network/network-domain-filter.html [ Slow ] crbug.com/667560 [ Mac ] virtual/mojo-loading/http/tests/devtools/network/network-domain-filter.js [ Slow ]
# Random slow tests # Random slow tests
crbug.com/763197 [ Linux Mac ] virtual/gpu-rasterization/images/color-profile-border-radius.html [ Slow ] crbug.com/763197 [ Linux Mac ] virtual/gpu-rasterization/images/color-profile-border-radius.html [ Slow ]
......
CONSOLE MESSAGE: line 5: XHR loaded: 1
CONSOLE MESSAGE: line 5: XHR loaded: 2
CONSOLE MESSAGE: line 5: XHR loaded: 3
Tests disabling cache from inspector. Tests disabling cache from inspector.
http://127.0.0.1:8000/devtools/network/resources/resource.php?random=1&cached=1 http://127.0.0.1:8000/devtools/network/resources/resource.php?random=1&cached=1
......
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/network-test.js"></script>
<script> (async function() {
function test() { TestRunner.addResult(`Tests disabling cache from inspector.\n`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
NetworkTestRunner.recordNetwork(); NetworkTestRunner.recordNetwork();
NetworkTestRunner.makeSimpleXHR('GET', 'resources/resource.php?random=1&cached=1', true, firstXHRLoaded); NetworkTestRunner.makeSimpleXHR('GET', 'resources/resource.php?random=1&cached=1', true, firstXHRLoaded);
...@@ -42,11 +45,4 @@ function test() { ...@@ -42,11 +45,4 @@ function test() {
function step5() { function step5() {
TestRunner.completeTest(); TestRunner.completeTest();
} }
} })();
</script>
</head>
<body onload="runTest()">
<p>Tests disabling cache from inspector.</p>
</body>
</html>
CONSOLE MESSAGE: line 5: XHR loaded: 1 Tests that after disabling network domain, content saved on backend is removed. https://bugs.webkit.org/show_bug.cgi?id=67995
Tests that after disabling network domain, content saved on backend is removed. Bug 67995
resource.content after disabling network domain: null resource.content after disabling network domain: null
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/network-test.js"></script>
<script> (async function() {
function test() { TestRunner.addResult(
`Tests that after disabling network domain, content saved on backend is removed. https://bugs.webkit.org/show_bug.cgi?id=67995`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
await TestRunner.loadHTML(`
<p>
Tests that after disabling network domain, content saved on backend is removed.
<a href="https://bugs.webkit.org/show_bug.cgi?id=67995">Bug 67995</a>
</p>
`);
NetworkTestRunner.recordNetwork(); NetworkTestRunner.recordNetwork();
NetworkTestRunner.makeSimpleXHR('GET', 'resources/resource.php', true, step2); NetworkTestRunner.makeSimpleXHR('GET', 'resources/resource.php', true, step2);
...@@ -21,13 +31,4 @@ function test() { ...@@ -21,13 +31,4 @@ function test() {
function step5() { function step5() {
TestRunner.completeTest(); TestRunner.completeTest();
} }
} })();
</script>
</head>
<body onload="runTest()">
<p>
Tests that after disabling network domain, content saved on backend is removed.
<a href="https://bugs.webkit.org/show_bug.cgi?id=67995">Bug 67995</a>
</p>
</body>
</html>
Tests that page navigation initiated by JS is correctly reported. Tests that page navigation initiated by JS is correctly reported.
Page reloaded. Page reloaded.
http://127.0.0.1:8000/devtools/network/network-document-initiator.html?foo: script http://127.0.0.1:8000/devtools/network/resources/initiator.html?foo: script
navigateFromScript http://127.0.0.1:8000/devtools/network/network-document-initiator.html 8 navigateFromScript http://127.0.0.1:8000/devtools/network/resources/initiator.html 7
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<link href="resources/initiator.css" rel="stylesheet" type="text/css"> // found in the LICENSE file.
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/network-test.js"></script>
<script>
function navigateFromScript()
{
window.location.href = "?foo";
}
var test = function() { (async function() {
TestRunner.evaluateInPage('navigateFromScript()'); TestRunner.addResult(`Tests that page navigation initiated by JS is correctly reported.\n`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
await TestRunner.navigatePromise('resources/initiator.html');
TestRunner.runWhenPageLoads(step1); TestRunner.runWhenPageLoads(step1);
TestRunner.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, TestRunner.pageLoaded);
await TestRunner.evaluateInPage('navigateFromScript()');
function dumpInitiator(request) { function dumpInitiator(request) {
var initiator = request.initiator(); var initiator = request.initiator();
...@@ -32,15 +30,8 @@ var test = function() { ...@@ -32,15 +30,8 @@ var test = function() {
function step1() { function step1() {
var results = NetworkTestRunner.findRequestsByURLPattern(/\?foo/); var results = NetworkTestRunner.findRequestsByURLPattern(/\?foo/);
TestRunner.assertTrue(results.length !== 0); TestRunner.assertEquals(1, results.length);
dumpInitiator(results[0]); dumpInitiator(results[0]);
TestRunner.completeTest(); TestRunner.completeTest();
} }
}; })();
</script>
</head>
<body onload="runTest()">
<p>Tests that page navigation initiated by JS is correctly reported.</p>
</body>
</html>
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/network-test.js"></script>
<script> (async function() {
function test() { TestRunner.addResult(`Tests doamin filter.\n`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
function checkSubdomains(domain) { function checkSubdomains(domain) {
TestRunner.addResult(''); TestRunner.addResult('');
TestRunner.addResult('Domain: ' + domain); TestRunner.addResult('Domain: ' + domain);
...@@ -26,11 +29,4 @@ function test() { ...@@ -26,11 +29,4 @@ function test() {
checkFilter('*.bar.*', ['foo.bar.com', 'baz.bar.org', 'bar.foo.net']); checkFilter('*.bar.*', ['foo.bar.com', 'baz.bar.org', 'bar.foo.net']);
TestRunner.completeTest(); TestRunner.completeTest();
} })();
</script>
</head>
<body onload="runTest()">
<p>Tests doamin filter.</p>
</body>
</html>
CONSOLE WARNING: line 31: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. Tests empty xhr content is correctly loaded in inspector. https://bugs.webkit.org/show_bug.cgi?id=79026
CONSOLE MESSAGE: line 5: XHR loaded: 1
CONSOLE MESSAGE: line 5: XHR loaded: 2
Tests empty xhr content is correctly loaded in inspector.
Bug 79026
http://127.0.0.1:8000/devtools/network/resources/empty.html?sync http://127.0.0.1:8000/devtools/network/resources/empty.html?sync
resource.content: resource.content:
http://127.0.0.1:8000/devtools/network/resources/empty.html?async http://127.0.0.1:8000/devtools/network/resources/empty.html?async
......
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/network-test.js"></script>
<script> (async function() {
function test() { TestRunner.addResult(
`Tests empty xhr content is correctly loaded in inspector. https://bugs.webkit.org/show_bug.cgi?id=79026`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
await TestRunner.loadHTML(`
<p> Tests empty xhr content is correctly loaded in inspector.</p>
<a href="https://bugs.webkit.org/show_bug.cgi?id=79026">Bug 79026</a>
`);
function dumpRequest(request, callback) { function dumpRequest(request, callback) {
if (!request) if (!request)
return callback(); return callback();
...@@ -39,12 +47,4 @@ function test() { ...@@ -39,12 +47,4 @@ function test() {
function step4() { function step4() {
TestRunner.completeTest(); TestRunner.completeTest();
} }
} })();
</script>
</head>
<body onload="runTest()">
<p> Tests empty xhr content is correctly loaded in inspector.</p>
<a href="https://bugs.webkit.org/show_bug.cgi?id=79026">Bug 79026</a>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="initiator.css">
<script type="text/javascript">
function navigateFromScript()
{
window.location.href = '?foo';
}
</script>
</head>
<body>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment