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

Unified Diff: LayoutTests/inspector/sources/debugger/resources/framework.js

Issue 210243002: DevTools: [Frameworks] Bugfix: do StepOut in framework code after StepIn limit is up. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/skip-stack-frames-steps.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/sources/debugger/resources/framework.js
diff --git a/LayoutTests/inspector/sources/debugger/resources/framework.js b/LayoutTests/inspector/sources/debugger/resources/framework.js
new file mode 100644
index 0000000000000000000000000000000000000000..c4175bda0295fc2cb6491b6411a36a0a2e5db413
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/resources/framework.js
@@ -0,0 +1,41 @@
+// A framework for testing.
+
+var Framework = {};
+
+Framework.safeRun = function(callback, onSuccess, onException, breakOnUncaught)
+{
+ try {
+ callback();
+ if (onSuccess)
+ Framework.safeRun(onSuccess, undefined, onException, breakOnUncaught);
+ } catch (e) {
+ if (onException)
+ Framework.safeRun(onException, undefined, breakOnUncaught ? Framework.breakInFramework : undefined);
+ else if (breakOnUncaught)
+ Framework.breakInFramework();
+ }
+}
+
+Framework.throwFrameworkException = function(msg)
+{
+ throw Error("FrameworkException" + (msg ? ": " + msg : ""));
+}
+
+Framework.breakInFramework = function()
+{
+ debugger;
+}
+
+Framework.empty = function()
+{
+}
+
+Framework.doSomeWork = function()
+{
+ const numberOfSteps = 50;
+ for (var i = 0; i < numberOfSteps; ++i) {
+ if (window["dummy property should not exist!" + i]) // Prevent optimizations.
+ return i;
+ Framework.safeRun(Framework.empty, Framework.empty, Framework.empty, true);
+ }
+}
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/skip-stack-frames-steps.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698