diff options
-rw-r--r-- | chrome/browser/debugger/devtools_sanity_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/test/data/devtools/pause_on_exception.html | 18 | ||||
-rw-r--r-- | webkit/glue/devtools/js/tests.js | 31 |
3 files changed, 56 insertions, 0 deletions
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 6172860..63e00cb 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -49,6 +49,8 @@ const wchar_t kConsoleTestPage[] = L"files/devtools/console_test_page.html"; const wchar_t kDebuggerTestPage[] = L"files/devtools/debugger_test_page.html"; const wchar_t kEvalTestPage[] = L"files/devtools/eval_test_page.html"; const wchar_t kJsPage[] = L"files/devtools/js_page.html"; +const wchar_t kPauseOnExceptionTestPage[] = + L"files/devtools/pause_on_exception.html"; const wchar_t kResourceContentLengthTestPage[] = L"files/devtools/image.html"; const wchar_t kResourceTestPage[] = L"files/devtools/resource_test_page.html"; const wchar_t kSimplePage[] = L"files/devtools/simple_page.html"; @@ -325,6 +327,11 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestSetBreakpoint) { RunTest("testSetBreakpoint", kDebuggerTestPage); } +// Tests pause on exception. +IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestPauseOnException) { + RunTest("testPauseOnException", kPauseOnExceptionTestPage); +} + // Tests eval on call frame. IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestEvalOnCallFrame) { RunTest("testEvalOnCallFrame", kDebuggerTestPage); diff --git a/chrome/test/data/devtools/pause_on_exception.html b/chrome/test/data/devtools/pause_on_exception.html new file mode 100644 index 0000000..6810e9e5 --- /dev/null +++ b/chrome/test/data/devtools/pause_on_exception.html @@ -0,0 +1,18 @@ +<html> +<head> +<script> + +function throwAnException() { + return unknown_var; +} + +function handleClick() { + throwAnException(); +} + +</script> +</head> +<body> +<input id='btn' type='button' onclick='handleClick()' value='Test'/> +</body> +</html>
\ No newline at end of file diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index 798dcca..e65ea9d 100644 --- a/webkit/glue/devtools/js/tests.js +++ b/webkit/glue/devtools/js/tests.js @@ -607,6 +607,37 @@ TestSuite.prototype.testSetBreakpoint = function() { /** + * Tests that pause on exception works. + */ +TestSuite.prototype.testPauseOnException = function() { + this.showPanel('scripts'); + var test = this; + + // Make sure pause on exceptions is on. + if (!WebInspector.currentPanel.pauseOnExceptionButton.toggled) { + WebInspector.currentPanel.pauseOnExceptionButton.element.click(); + } + + this._executeCodeWhenScriptsAreParsed( + 'handleClick()', + ['pause_on_exception.html$']); + + this._waitForScriptPause( + { + functionsOnStack: ['throwAnException', 'handleClick', + '(anonymous function)'], + lineNumber: 6, + lineText: ' return unknown_var;' + }, + function() { + test.releaseControl(); + }); + + this.takeControl(); +}; + + +/** * Serializes options collection to string. * @param {HTMLOptionsCollection} options * @return {string} |