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
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/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/667560 [ Mac ] virtual/mojo-loading/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.js [ Slow ]
# Random slow tests
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.
http://127.0.0.1:8000/devtools/network/resources/resource.php?random=1&cached=1
......
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/network-test.js"></script>
<script>
function test() {
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests disabling cache from inspector.\n`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
NetworkTestRunner.recordNetwork();
NetworkTestRunner.makeSimpleXHR('GET', 'resources/resource.php?random=1&cached=1', true, firstXHRLoaded);
......@@ -42,11 +45,4 @@ function test() {
function step5() {
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. Bug 67995
Tests that after disabling network domain, content saved on backend is removed. https://bugs.webkit.org/show_bug.cgi?id=67995
resource.content after disabling network domain: null
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/network-test.js"></script>
<script>
function test() {
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
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.makeSimpleXHR('GET', 'resources/resource.php', true, step2);
......@@ -21,13 +31,4 @@ function test() {
function step5() {
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.
Page reloaded.
http://127.0.0.1:8000/devtools/network/network-document-initiator.html?foo: script
navigateFromScript http://127.0.0.1:8000/devtools/network/network-document-initiator.html 8
http://127.0.0.1:8000/devtools/network/resources/initiator.html?foo: script
navigateFromScript http://127.0.0.1:8000/devtools/network/resources/initiator.html 7
<html>
<head>
<link href="resources/initiator.css" rel="stylesheet" type="text/css">
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/network-test.js"></script>
<script>
function navigateFromScript()
{
window.location.href = "?foo";
}
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var test = function() {
TestRunner.evaluateInPage('navigateFromScript()');
(async function() {
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.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, TestRunner.pageLoaded);
await TestRunner.evaluateInPage('navigateFromScript()');
function dumpInitiator(request) {
var initiator = request.initiator();
......@@ -32,15 +30,8 @@ var test = function() {
function step1() {
var results = NetworkTestRunner.findRequestsByURLPattern(/\?foo/);
TestRunner.assertTrue(results.length !== 0);
TestRunner.assertEquals(1, results.length);
dumpInitiator(results[0]);
TestRunner.completeTest();
}
};
</script>
</head>
<body onload="runTest()">
<p>Tests that page navigation initiated by JS is correctly reported.</p>
</body>
</html>
})();
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/network-test.js"></script>
<script>
function test() {
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests doamin filter.\n`);
await TestRunner.loadModule('network_test_runner');
await TestRunner.showPanel('network');
function checkSubdomains(domain) {
TestRunner.addResult('');
TestRunner.addResult('Domain: ' + domain);
......@@ -26,11 +29,4 @@ function test() {
checkFilter('*.bar.*', ['foo.bar.com', 'baz.bar.org', 'bar.foo.net']);
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/.
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
Tests empty xhr content is correctly loaded in inspector. https://bugs.webkit.org/show_bug.cgi?id=79026
http://127.0.0.1:8000/devtools/network/resources/empty.html?sync
resource.content:
http://127.0.0.1:8000/devtools/network/resources/empty.html?async
......
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/network-test.js"></script>
<script>
function test() {
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
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) {
if (!request)
return callback();
......@@ -39,12 +47,4 @@ function test() {
function step4() {
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