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

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

Issue 404953003: DevTools: Async call stacks for window.postMessage() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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-post-message.html
diff --git a/LayoutTests/inspector/sources/debugger/async-callstack-post-message.html b/LayoutTests/inspector/sources/debugger/async-callstack-post-message.html
new file mode 100644
index 0000000000000000000000000000000000000000..bc253548cea6ffaf85b9a685ce1327ae02bbfacb
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/async-callstack-post-message.html
@@ -0,0 +1,56 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script>
+
+function testFunction()
+{
+ setTimeout(timeout, 0);
+}
+
+function timeout()
+{
+ window.addEventListener("message", onMessageReceivedInParent, false);
+ postMessageToSelf();
+ postMessageToFrame("start");
+}
+
+function onMessageReceivedInParent(e)
+{
+ debugger;
+ if (/data="start"/.test(e.data || ""))
+ postMessageToFrame("done");
+}
+
+function postMessageToSelf()
+{
+ window.postMessage("message to myself", "*");
+}
+
+function postMessageToFrame(msg)
+{
+ var iframe = document.getElementById("iframe");
+ var win = iframe.contentWindow;
+ win.postMessage(msg, "*");
+}
+
+var test = function()
+{
+ var totalDebuggerStatements = 5;
+ var maxAsyncCallStackDepth = 4;
+ InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallStackDepth);
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests asynchronous call stacks for window.postMessage.
+</p>
+<div><iframe src="resources/post-message-listener.html"
+ id="iframe" width="800" height="100" style="border: 1px solid black;">
+</iframe></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698