WebVM

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

  1. wget http://wiki.webvm.net/wrtc/m5.2.wgt
  2. adb push m5.2.wgt /root
  3. adb shell wrtc -i m5.2 /root/m5.2.wgt
  4. adb shell wrtc -d <INSTALL ID>
  5. Install the devtools into your BONDI SDK using http://devtools.webvm.net/
  6. Open the debug perspective
  7. Under Debug Configurations create a new Chromium JavaScript configuration
  8. Enter the IP address of your device and set the port to 9999.
  9. 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

  1. Launch test widget.
  2. Set breakpoint after label 0 in test.js.
  3. Click “call simple_0()”.
  4. Verify that execution stops at the breakpoint.
  5. Continue from debugger.

2) Remove breakpoint

  1. Launch test widget.
  2. Remove breakpoint after label 0 in test.js.
  3. Click “call simple_0()”.
  4. Verify that execution does not stop at the breakpoint.

3) Stepping

  1. Launch test widget.
  2. Set breakpoint after label 1 in test.js.
  3. Click “call simple_1()”.
  4. Verify that execution stops at the breakpoint.
  5. Step 3 times in debugger.
  6. Verify that the values of the variables in scope are as expected at each step, by hovering the mouse over the variable.
  7. Continue from debugger.
  8. Remove breakpoint at label 1.

4) Local variable scope

  1. Launch test widget.
  2. Set breakpoint after label 2 in test.js.
  3. Click “call simple_2()”.
  4. Verify that execution stops at the breakpoint.
  5. Inspect the Variables window and verify test_1 and test_2 are in scope.
  6. Verify that test_2 has the value ‘undefined’.
  7. Step once in debugger.
  8. Verify that test_2 is defined with value 3.
  9. Continue from debugger.
  10. Remove breakpoint at label 2.

5) Step over / step into function

  1. Launch test widget.
  2. Set breakpoint after label 3 in test.js.
  3. Click “call call_0()”.
  4. Verify that execution stops at the breakpoint.
  5. Step over the call in debugger.
  6. Verify, by inspection of the value of test_1 (“2 test string”), that the call is executed and execution stops after the call.
  7. Continue from debugger.
  8. Click “call call_0()”.
  9. Verify that execution stops at the breakpoint.
  10. Step into the call in debugger.
  11. Verify that execution continues to the first statement of simple_1().
  12. Continue to step through simple_1() until it returns.
  13. Verify that the variables in scope and their values are as expected at each step.
  14. Continue from debugger.
  15. Remove breakpoint at label 3.

6) Simple stack trace

  1. Launch test widget.
  2. Set breakpoint after label 4 in test.js.
  3. Click “call call_1(7)”.
  4. Verify that execution stops at the breakpoint.
  5. Verify that the stack trace shows 7 nested invocations of call_1() (ie 8 stack levels involving call_1 in total).
  6. Verify that the indicated value of depth is correct at each stack level.
  7. Continue from debugger.
  8. Remove breakpoint at label 4.

7) Conditional breakpoints

  1. Launch test widget.
  2. Set breakpoint after label 5 in test.js with the condition (depth == 5).
  3. Click “call call_1(7)”.
  4. Verify that execution stops at the breakpoint.
  5. Verify that the stack trace shows 3 nested invocations of call_1().
  6. Continue from debugger.
  7. Remove breakpoint at label 5.

8) Multiple scopes per stack level

  1. Launch test widget.
  2. Set a watch expression for test_0
  3. Set breakpoint after label 6 in test.js.
  4. Click “call scope_0(7)”.
  5. Verify that execution stops at the breakpoint.
  6. Examine the scope_2 stack level.
  7. 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.
  8. Examine scope_0 stack level.
  9. Verify that the variables scope0 and x are in scope, but not y.
  10. Continue debugger.
  11. Remove breakpoint at label 6.

9) Watch expression evaluation

  1. In the Expressions window, enter the watch expression test_0
  2. Set a breakpoint after label 2
  3. Verify test_0 is 0
  4. Add another watch expression for test_2
  5. Step
  6. Ensure both variables are updated