Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Unified Diff: LayoutTests/inspector/sources/debugger/async-callstack-promises.html

Issue 1153923005: DevTools: shard inspector/debugger tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/sources/debugger/async-callstack-promises.html
diff --git a/LayoutTests/inspector/sources/debugger/async-callstack-promises.html b/LayoutTests/inspector/sources/debugger/async-callstack-promises.html
deleted file mode 100644
index cc0120bd37f21f3fb97cb8bfa95220867f243c7c..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/sources/debugger/async-callstack-promises.html
+++ /dev/null
@@ -1,156 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script>
-
-function timeoutPromise(value, ms)
-{
- return new Promise(function promiseCallback(resolve, reject) {
- function resolvePromise()
- {
- resolve(value);
- }
- function rejectPromise()
- {
- reject(value);
- }
- if (value instanceof Error)
- setTimeout(rejectPromise, ms || 0);
- else
- setTimeout(resolvePromise, ms || 0);
- });
-}
-
-function settledPromise(value)
-{
- function resolveCallback(resolve, reject)
- {
- resolve(value);
- }
- function rejectCallback(resolve, reject)
- {
- reject(value);
- }
- if (value instanceof Error)
- return new Promise(rejectCallback);
- else
- return new Promise(resolveCallback);
-}
-
-function testFunction()
-{
- setTimeout(testFunctionTimeout, 0);
-}
-
-function testFunctionTimeout()
-{
- var functions = [doTestPromiseConstructor, doTestSettledPromises, doTestChainedPromises, doTestPromiseAll, doTestThrowFromChain, doTestPromiseResolveAndReject];
- for (var i = 0; i < functions.length; ++i)
- functions[i]();
-}
-
-function thenCallback(value)
-{
- debugger;
-}
-
-function errorCallback(error)
-{
- debugger;
-}
-
-function doTestPromiseConstructor()
-{
- new Promise(function promiseCallback(resolve, reject) {
- resolve(1);
- debugger;
- });
-}
-
-function doTestSettledPromises()
-{
- settledPromise("resolved").then(thenCallback, errorCallback);
- settledPromise(Error("rejected")).then(thenCallback, errorCallback);
-}
-
-function doTestChainedPromises()
-{
- timeoutPromise(1).then(function chained1() {
- debugger;
- return timeoutPromise(2);
- }).then(function chained2() {
- debugger;
- return 3;
- }).then(function chained3() {
- debugger;
- return settledPromise(4);
- }).then(function chained4() {
- debugger;
- return timeoutPromise(5);
- }).then(thenCallback, errorCallback);
-
- timeoutPromise(1)
- .then(JSON.stringify)
- .then(JSON.parse)
- .then(function afterJSONStringifyAndParse() {
- debugger;
- });
-}
-
-function doTestPromiseAll()
-{
- Promise.all([11, 22, 33, 44, 55].map(timeoutPromise))
- .then(thenCallback, errorCallback);
-}
-
-function doTestThrowFromChain()
-{
- timeoutPromise(1).then(function chained1() {
- return timeoutPromise(2);
- }).then(function chained2() {
- return settledPromise(3);
- }).then(function chained3() {
- throw Error("thrown from chained3");
- }).then(function chained4() {
- return timeoutPromise(5);
- }).catch(function catchCallback() {
- debugger;
- });
-
- timeoutPromise(1).then(function chained1() {
- return timeoutPromise(2);
- }).then(function chained2() {
- return timeoutPromise(3);
- }).then(function chained3() {
- return timeoutPromise(Error(4));
- }).then(function chained4() {
- return timeoutPromise(5);
- }).catch(function catchCallback() {
- debugger;
- });
-}
-
-function doTestPromiseResolveAndReject()
-{
- Promise.resolve(1).then(thenCallback, errorCallback);
- Promise.reject(Error("2")).then(thenCallback, errorCallback);
-}
-
-var test = function()
-{
- var totalDebuggerStatements = 14;
- var maxAsyncCallStackDepth = 4;
- InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallStackDepth);
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Tests asynchronous call stacks for Promises.
-</p>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698