Commit ae9e77e9 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[devtools] Split long-running test to not accidentally trigger timeout

dom-breakpoints.js usually takes ~70 on some mac bots, but occasionally
exceeds 91s and runs into a timeout.

This CL splits the test into two, which hopefully makes it less likely
to trigger timeouts.

The test and, most importantly, the test expectations are just split;
they did not change.

Bug: chromium:1049444
Change-Id: Ie2288bafa5807726cfd1fddc5d91189bc2ad905a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042105
Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739117}
parent 68386e1a
......@@ -136,44 +136,3 @@ Call stack:
Paused on node removaldiv#elementToRemove
Script execution resumed.
Running: testReload
Test that DOM breakpoints are persisted between page reloads.
Set 'Subtree Modified' DOM breakpoint on rootElement.
Page reloaded.
Append childElement to rootElement.
Script execution paused.
Call stack:
0) appendElement (dom-breakpoints.html:5)
1) (:1)
[setTimeout]
0) (:1)
Paused on subtree modificationsdiv#rootElementChild div#rootElement added
Script execution resumed.
Running: testInsertChildIntoAuthorShadowTree
Test that 'Subtree Modified' breakpoint on author shadow root is hit when appending a child.
Set 'Subtree Modified' DOM breakpoint on author shadow root.
Append childElement to author shadow root.
Script execution paused.
Call stack:
0) appendElementToOpenShadowRoot (dom-breakpoints.html:61)
1) (:1)
[setTimeout]
0) (:1)
Paused on subtree modifications#shadow-root (open)Child #shadow-root (open) added
Script execution resumed.
Running: testReloadWithShadowElementBreakpoint
Test that shadow DOM breakpoints are persisted between page reloads.
Set 'Subtree Modified' DOM breakpoint on outerElement.
Page reloaded.
Append childElement to outerElement.
Script execution paused.
Call stack:
0) appendElementToAuthorShadowTree (dom-breakpoints.html:55)
1) (:1)
[setTimeout]
0) (:1)
Paused on subtree modificationsdiv#outerElementChild div#outerElement added
Script execution resumed.
Tests DOM breakpoints.
Running: testReload
Test that DOM breakpoints are persisted between page reloads.
Set 'Subtree Modified' DOM breakpoint on rootElement.
Page reloaded.
Append childElement to rootElement.
Script execution paused.
Call stack:
0) appendElement (dom-breakpoints.html:5)
1) (:1)
[setTimeout]
0) (:1)
Paused on subtree modificationsdiv#rootElementChild div#rootElement added
Script execution resumed.
Running: testInsertChildIntoAuthorShadowTree
Test that 'Subtree Modified' breakpoint on author shadow root is hit when appending a child.
Set 'Subtree Modified' DOM breakpoint on author shadow root.
Append childElement to author shadow root.
Script execution paused.
Call stack:
0) appendElementToOpenShadowRoot (dom-breakpoints.html:61)
1) (:1)
[setTimeout]
0) (:1)
Paused on subtree modifications#shadow-root (open)Child #shadow-root (open) added
Script execution resumed.
Running: testReloadWithShadowElementBreakpoint
Test that shadow DOM breakpoints are persisted between page reloads.
Set 'Subtree Modified' DOM breakpoint on outerElement.
Page reloaded.
Append childElement to outerElement.
Script execution paused.
Call stack:
0) appendElementToAuthorShadowTree (dom-breakpoints.html:55)
1) (:1)
[setTimeout]
0) (:1)
Paused on subtree modificationsdiv#outerElementChild div#outerElement added
Script execution resumed.
// 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 DOM breakpoints.`);
await TestRunner.loadModule('elements_test_runner');
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.showPanel('elements');
await TestRunner.navigatePromise('resources/dom-breakpoints.html');
var pane =
self.runtime.sharedInstance(BrowserDebugger.DOMBreakpointsSidebarPane);
var rootElement;
var outerElement;
var authorShadowRoot;
SourcesTestRunner.runDebuggerTestSuite([
function testReload(next) {
TestRunner.addResult(
'Test that DOM breakpoints are persisted between page reloads.');
ElementsTestRunner.nodeWithId('rootElement', step2);
function step2(node) {
TestRunner.domDebuggerModel.setDOMBreakpoint(
node, SDK.DOMDebuggerModel.DOMBreakpoint.Type.SubtreeModified);
TestRunner.addResult(
'Set \'Subtree Modified\' DOM breakpoint on rootElement.');
TestRunner.reloadPage(step3);
}
function step3() {
ElementsTestRunner.expandElementsTree(step4);
}
function step4() {
TestRunner.evaluateInPageWithTimeout(
'appendElement(\'rootElement\', \'childElement\')');
TestRunner.addResult('Append childElement to rootElement.');
SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(next);
}
},
function testInsertChildIntoAuthorShadowTree(next) {
ElementsTestRunner.shadowRootByHostId('hostElement', callback);
function callback(node) {
authorShadowRoot = node;
TestRunner.addResult(
'Test that \'Subtree Modified\' breakpoint on author shadow root is hit when appending a child.');
TestRunner.domDebuggerModel.setDOMBreakpoint(
authorShadowRoot,
SDK.DOMDebuggerModel.DOMBreakpoint.Type.SubtreeModified);
TestRunner.addResult(
'Set \'Subtree Modified\' DOM breakpoint on author shadow root.');
TestRunner.evaluateInPageWithTimeout(
'appendElementToOpenShadowRoot(\'childElement\')');
TestRunner.addResult('Append childElement to author shadow root.');
SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(next);
}
},
function testReloadWithShadowElementBreakpoint(next) {
ElementsTestRunner.nodeWithId('outerElement', step1);
function step1(node) {
outerElement = node;
TestRunner.addResult(
'Test that shadow DOM breakpoints are persisted between page reloads.');
TestRunner.domDebuggerModel.setDOMBreakpoint(
outerElement,
SDK.DOMDebuggerModel.DOMBreakpoint.Type.SubtreeModified);
TestRunner.addResult(
'Set \'Subtree Modified\' DOM breakpoint on outerElement.');
TestRunner.reloadPage(step2);
}
function step2() {
ElementsTestRunner.expandElementsTree(step3);
}
function step3() {
TestRunner.evaluateInPageWithTimeout(
'appendElementToAuthorShadowTree(\'outerElement\', \'childElement\')');
TestRunner.addResult('Append childElement to outerElement.');
SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(next);
}
}
]);
})();
......@@ -204,77 +204,5 @@
}
},
function testReload(next) {
TestRunner.addResult(
'Test that DOM breakpoints are persisted between page reloads.');
ElementsTestRunner.nodeWithId('rootElement', step2);
function step2(node) {
TestRunner.domDebuggerModel.setDOMBreakpoint(
node, SDK.DOMDebuggerModel.DOMBreakpoint.Type.SubtreeModified);
TestRunner.addResult(
'Set \'Subtree Modified\' DOM breakpoint on rootElement.');
TestRunner.reloadPage(step3);
}
function step3() {
ElementsTestRunner.expandElementsTree(step4);
}
function step4() {
TestRunner.evaluateInPageWithTimeout(
'appendElement(\'rootElement\', \'childElement\')');
TestRunner.addResult('Append childElement to rootElement.');
SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(next);
}
},
function testInsertChildIntoAuthorShadowTree(next) {
ElementsTestRunner.shadowRootByHostId('hostElement', callback);
function callback(node) {
authorShadowRoot = node;
TestRunner.addResult(
'Test that \'Subtree Modified\' breakpoint on author shadow root is hit when appending a child.');
TestRunner.domDebuggerModel.setDOMBreakpoint(
authorShadowRoot,
SDK.DOMDebuggerModel.DOMBreakpoint.Type.SubtreeModified);
TestRunner.addResult(
'Set \'Subtree Modified\' DOM breakpoint on author shadow root.');
TestRunner.evaluateInPageWithTimeout(
'appendElementToOpenShadowRoot(\'childElement\')');
TestRunner.addResult('Append childElement to author shadow root.');
SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(next);
}
},
function testReloadWithShadowElementBreakpoint(next) {
ElementsTestRunner.nodeWithId('outerElement', step1);
function step1(node) {
outerElement = node;
TestRunner.addResult(
'Test that shadow DOM breakpoints are persisted between page reloads.');
TestRunner.domDebuggerModel.setDOMBreakpoint(
outerElement,
SDK.DOMDebuggerModel.DOMBreakpoint.Type.SubtreeModified);
TestRunner.addResult(
'Set \'Subtree Modified\' DOM breakpoint on outerElement.');
TestRunner.reloadPage(step2);
}
function step2() {
ElementsTestRunner.expandElementsTree(step3);
}
function step3() {
TestRunner.evaluateInPageWithTimeout(
'appendElementToAuthorShadowTree(\'outerElement\', \'childElement\')');
TestRunner.addResult('Append childElement to outerElement.');
SourcesTestRunner.waitUntilPausedAndDumpStackAndResume(next);
}
}
]);
})();
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