Test for Bug 27514 - add support for watched expression.
To begin test, open web inspector, go the scripts panel (enabling script debugging if necccessary), and then click this link: [begin test].
Perform the following steps, and note the expected results:
After clicking the link above, you should now be paused in the body of
the test method, thanks to the debugger
statement.
Add the following expressions to the "Watch Expressions" section of the
Scripts panel sidebar pane: "this
", "a
",
"b
", "c
" and "d
". Do NOT enter the quotes.
The values of the expressions as shown in the window should a
DOMWindow
for this
, undefined
for
the a
, b
, and c
variables, and a
value of ReferenceError: Can't find variable: d
for the d
variable.
Note that the value for d
should not change for the life of
the test, as the variable d
is never introduced in the program.
Step through the code, and you'll see the values of a
,
b
, and c
change, as the variables are assigned.
Also note that as the scope changes due to the function invocation, values
will be changed to refer to their current scope. The this
expression will change when the method is invoked on the object constructed by
the test.
Click different stack frames in the Call Stack section to ensure the expressions change value appropriately as the current stack frame changes.
Drive the debugger through the end of the outermost function, so that
the debugger is no longer in paused state. The values of
a
, b
, and c
should all be a
ReferenceError like d
, since these variables are defined in the
runTest()
function, and the expressions are being evaluated against
the global object.
From the console, execute the statement "a = 1
". The
watch expressions do not currently refresh, so the value for a
should still be ReferenceError.
Click the "Refresh" button in the Watch Expressions section and the
value for "a
" should now be "1
".
Close down the browser, start it back up, traverse to a web site, bring up web inspector, go to the Scripts panel. You should see the same set of Watch Expressions in the list as you had when you last used web inspector.
Delete an expression by moving the mouse into the Watch Expression section, and clicking the X icon which appears to the right of an expression (on hover).
Delete an expression by double-clicking anywhere on a top-level line of a watch expression, and changing the expression to an empty string or nothing but white-space.
Modify an entry by double-clicking anywhere on a top-level line of a watch expression, and changing the expression.
Enter a new expression, "new Date()
". The value should be
a toString() version of the date. Repeatedly press the Refresh button to see
the value updated with the current time.