Commit 82b85893 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

Revert "DevTools: add tests for extensions on DOM UI pages"

This reverts commit 3c0f2556.

Reason for revert: test is extremely flaky

Per https://analysis.chromium.org/p/chromium/flake-portal/flakes/occurrences?key=ag9zfmZpbmRpdC1mb3ItbWVyUgsSBUZsYWtlIkdjaHJvbWl1bUBicm93c2VyX3Rlc3RzQERldlRvb2xzRXh0ZW5zaW9uVGVzdC5UZXN0RXZhbHVhdGVPbkNocm9tZVNjaGVtZQw this flakily fails about 10 times an hour.

Original change's description:
> DevTools: add tests for extensions on DOM UI pages
> 
> This is the chrome-side counterpart of
> https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2128732
> 
> Bug: 1059577, 795595
> Change-Id: Iec2ee772a42b4c7bc2249627c0839f7506f0cd1d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129344
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#756375}

TBR=dgozman@chromium.org,rdevlin.cronin@chromium.org,caseq@chromium.org,bmeurer@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1059577, 795595
Change-Id: I2919088167b064086b315d8c3a64df569d95c844
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2188512Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766575}
parent 3de250a4
......@@ -246,7 +246,7 @@ class DevToolsSanityTest : public InProcessBrowserTest {
}
void LoadTestPage(const std::string& test_page) {
GURL url(spawned_test_server()->GetURL("").Resolve(test_page));
GURL url = spawned_test_server()->GetURL(test_page);
ui_test_utils::NavigateToURL(browser(), url);
}
......@@ -1502,11 +1502,6 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
RunTest("testConsoleContextNames", kPageWithContentScript);
}
IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, TestEvaluateOnChromeScheme) {
LoadExtension("chrome_scheme");
RunTest("waitForTestResultsAsMessage", std::string());
}
// Tests that scripts are not duplicated after Scripts Panel switch.
IN_PROC_BROWSER_TEST_F(DevToolsSanityTest,
TestNoScriptDuplicatesOnPanelSwitch) {
......
<html>
<head>
<script src="devtools.js"></script>
</head>
</html>
// 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.
function output(msg) {
top.postMessage({testOutput: msg}, '*');
}
async function test() {
const newPageURL = 'chrome://version/';
const inspectedTabId = chrome.devtools.inspectedWindow.tabId;
chrome.tabs.update(inspectedTabId, {url: newPageURL});
await new Promise(resolve => chrome.tabs.onUpdated.addListener(
(tabId, changedProps) => {
if (inspectedTabId !== tabId || changedProps.url !== newPageURL)
return;
resolve();
}
));
// There may be a number of inherent races between the page and the DevTools
// during the navigation. Let's do a number of eval in a hope of catching some
// of them.
const evalCount = 1000;
let callbackCount = 0;
const evaluateCallback = (result, exception) => {
if (!exception || !exception.isError) {
output(`FAIL: ${result || exception.value}`);
return;
}
if (exception.code !== 'E_FAILED') {
output(`FAIL: ${exception.code}`);
return;
}
if (++callbackCount === evalCount)
output('PASS');
};
for (let i = 0; i < evalCount; ++i) {
chrome.devtools.inspectedWindow.eval('location.href', {}, evaluateCallback);
}
}
test();
{
"description": "Devtools Test extension",
"name": "Devtools Test extension",
"version": "0.1",
"manifest_version": 2,
"devtools_page": "devtools.html",
"permissions": ["tabs"]
}
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