summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 16:46:34 +0000
committeryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 16:46:34 +0000
commitc28d7d66e345f8e87660200231998daaf4653622 (patch)
tree327c39ffaa526c11da2e95d2a9f4342eae270e63 /chrome
parentc49085c7704d4a3544756b2387608ee2c12531e0 (diff)
downloadchromium_src-c28d7d66e345f8e87660200231998daaf4653622.zip
chromium_src-c28d7d66e345f8e87660200231998daaf4653622.tar.gz
chromium_src-c28d7d66e345f8e87660200231998daaf4653622.tar.bz2
DevTools: test that scopes can be epxanded
Review URL: http://codereview.chromium.org/258016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/debugger/devtools_sanity_unittest.cc7
-rw-r--r--chrome/test/data/devtools/debugger_closure.html22
2 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc
index 971b4d2..77852b7 100644
--- a/chrome/browser/debugger/devtools_sanity_unittest.cc
+++ b/chrome/browser/debugger/devtools_sanity_unittest.cc
@@ -52,6 +52,8 @@ const wchar_t kSyntaxErrorTestPage[] =
L"files/devtools/script_syntax_error.html";
const wchar_t kDebuggerStepTestPage[] =
L"files/devtools/debugger_step.html";
+const wchar_t kDebuggerClosurePage[] =
+ L"files/devtools/debugger_closure.html";
class DevToolsSanityTest : public InProcessBrowserTest {
@@ -190,6 +192,11 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestStepIn) {
RunTest("testStepIn", kDebuggerStepTestPage);
}
+// Tests that scope can be expanded and contains expected variables.
+IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestExpandScope) {
+ RunTest("testExpandScope", kDebuggerClosurePage);
+}
+
// Tests that execution continues automatically when there is a syntax error in
// script and DevTools are open.
IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestAutoContinueOnSyntaxError) {
diff --git a/chrome/test/data/devtools/debugger_closure.html b/chrome/test/data/devtools/debugger_closure.html
new file mode 100644
index 0000000..92a92d7
--- /dev/null
+++ b/chrome/test/data/devtools/debugger_closure.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<script>
+function makeClosure(n) {
+ var makeClosureLocalVar = 'local.' + n;
+ return function innerFunction(x) {
+ var innerFunctionLocalVar = x + 2;
+ debugger;
+ return n + makeClosureLocalVar + x + innerFunctionLocalVar;
+ }
+}
+
+function handleClick() {
+ var f = makeClosure('TextParam');
+ f(2009);
+}
+</script>
+</head>
+<body>
+<input type='button' onclick='handleClick()' value='Test'/>
+</body>
+</html> \ No newline at end of file