Test steps/cases using http://wiki.webvm.net/wrtc/m5.2/ or the test widget m5.2.wgt
These steps should work on vanilla http://code.google.com/p/chromedevtools/, with Chromium.
0) Steps for setting up the test widget in wrtc debug mode
wget http://wiki.webvm.net/wrtc/m5.2.wgt
adb push m5.2.wgt /root
adb shell wrtc -i m5.2 /root/m5.2.wgt
adb shell wrtc -d <INSTALL ID>
- Install the devtools into your BONDI SDK using http://devtools.webvm.net/
- Open the debug perspective
- Under Debug Configurations create a new Chromium JavaScript configuration
- Enter the IP address of your device and set the port to 9999.
- Click Debug to attach the IDE to your device
Notice the -d switch to launch the widget in debug mode in wrtc.
1) Set breakpoint
- Launch test widget.
- Set breakpoint after label 0 in test.js.
- Click “call simple_0()”.
- Verify that execution stops at the breakpoint.
- Continue from debugger.
2) Remove breakpoint
- Launch test widget.
- Remove breakpoint after label 0 in test.js.
- Click “call simple_0()”.
- Verify that execution does not stop at the breakpoint.
3) Stepping
- Launch test widget.
- Set breakpoint after label 1 in test.js.
- Click “call simple_1()”.
- Verify that execution stops at the breakpoint.
- Step 3 times in debugger.
- Verify that the values of the variables in scope are as expected at each step, by hovering the mouse over the variable.
- Continue from debugger.
- Remove breakpoint at label 1.
4) Local variable scope
- Launch test widget.
- Set breakpoint after label 2 in test.js.
- Click “call simple_2()”.
- Verify that execution stops at the breakpoint.
- Inspect the Variables window and verify
test_1 and test_2 are in scope.
- Verify that
test_2 has the value ‘undefined’.
- Step once in debugger.
- Verify that
test_2 is defined with value 3.
- Continue from debugger.
- Remove breakpoint at label 2.
5) Step over / step into function
- Launch test widget.
- Set breakpoint after label 3 in test.js.
- Click “call call_0()”.
- Verify that execution stops at the breakpoint.
- Step over the call in debugger.
- Verify, by inspection of the value of test_1 (“2 test string”), that the call is executed and execution stops after the call.
- Continue from debugger.
- Click “call call_0()”.
- Verify that execution stops at the breakpoint.
- Step into the call in debugger.
- Verify that execution continues to the first statement of simple_1().
- Continue to step through simple_1() until it returns.
- Verify that the variables in scope and their values are as expected at each step.
- Continue from debugger.
- Remove breakpoint at label 3.
6) Simple stack trace
- Launch test widget.
- Set breakpoint after label 4 in test.js.
- Click “call call_1(7)”.
- Verify that execution stops at the breakpoint.
- Verify that the stack trace shows 7 nested invocations of
call_1() (ie 8 stack levels involving call_1 in total).
- Verify that the indicated value of depth is correct at each stack level.
- Continue from debugger.
- Remove breakpoint at label 4.
7) Conditional breakpoints
- Launch test widget.
- Set breakpoint after label 5 in test.js with the condition (depth == 5).
- Click “call call_1(7)”.
- Verify that execution stops at the breakpoint.
- Verify that the stack trace shows 3 nested invocations of
call_1().
- Continue from debugger.
- Remove breakpoint at label 5.
8) Multiple scopes per stack level
- Launch test widget.
- Set a watch expression for
test_0
- Set breakpoint after label 6 in test.js.
- Click “call scope_0(7)”.
- Verify that execution stops at the breakpoint.
- Examine the
scope_2 stack level.
- Verify that the variables
test_0 (global), scope0 (outer local scope), and y (inner local scope) are in scope. In the case of test_0, being in scope can be confirmed by verifying that the watch expression evaluates without error.
- Examine
scope_0 stack level.
- Verify that the variables scope0 and x are in scope, but not
y.
- Continue debugger.
- Remove breakpoint at label 6.
9) Watch expression evaluation
- In the Expressions window, enter the watch expression
test_0
- Set a breakpoint after label 2
- Verify
test_0 is 0
- Add another watch expression for
test_2
- Step
- Ensure both variables are updated