Commit 3ee579a6 authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

DevTools: add tests for extensions after reload of a page with OOPIF

This is a test for http://crrev.com/c/devtools/devtools-frontend/+/2200666

Bug: 10781354, 1081270
Change-Id: I63a1e77a1ac76184d664b4a29e67ba519c74a4ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2200430
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Reviewed-by: default avatarTim van der Lippe <tvanderlippe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771266}
parent 26834d87
Tests that extension does not get disconnected after a page with OOPIFs is reloaded
Started extension.
Running tests...
RUNNING TEST: extension_testRequestNotification
Request finished: .../extensions/resources/abe.png
Request finished: .../extensions/resources/abe.png
All tests done.
// Copyright 2020 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 extension does not get disconnected after a page with OOPIFs is reloaded\n`);
await TestRunner.loadModule('extensions_test_runner');
await TestRunner.navigatePromise('http://localhost:8000/devtools/extensions/resources/page-with-oopif.html');
await ExtensionsTestRunner.runExtensionTests([
function extension_testRequestNotification(nextTest) {
let count = 0;
function onRequestFinished(request) {
if (!request.request.url.endsWith("abe.png"))
return;
output("Request finished: " + request.request.url.replace(/.*((\/[^/]*){3}$)/,"...$1"));
if (++count === 2) {
nextTest();
return;
}
webInspector.inspectedWindow.reload();
}
webInspector.network.onRequestFinished.addListener(onRequestFinished);
webInspector.inspectedWindow.reload();
}
]);
})();
<html>
<body>
<iframe id="iframe" src="http://subframe.oopif.test:8000/devtools/extensions/resources/subframe.html"></iframe>
</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