### Aptana Debugger Test Cases (v0.4)

- Basic stepping.
  1. Press suspend button on IDE or using Aptana logo at the right-bottom corner of browser. (On OSX, you may need to "View > Status Bar" to see it)
  2. Then press 'Start test' button.
  3. Follow the instructions in comments
- Suspend on page load.
  1. Open JavaScript Debug Preferences (menu Window\Preferences\Aptana\JavaScript Debug\) or Launch configuration settings (menu Run\Debug...\<launch configuration>\Debug)
  2. Turn on "Suspend at start" option
  3. Launch debugger
  4. Debugger should suspend on line:

         dump("Start message");

  5. Turn off "Suspend at start" option after test completion
- Breakpoints.
  1. Press 'Start test' button.
  2. Follow the instructions in comments
- Console logging.
  1. Press 'Start test' button.
  2. Check messages in IDE console. It should contain:

         Simple dump('message') logging
         Use console.log('message')
         Use aptana.log('message')
         Use aptana.trace('message') with stack trace
         	at testLogging(...) (test/debug_tests.html:91)
         	at onclick(...) (test/debug_tests.html:1)
         ReferenceError: no_such_object is not defined
         	at showExceptionStackTrace() (test/debug_tests.html:104)
         	at testLogging() (test/debug_tests.html:95)
         	at onclick(MouseEvent) (test/debug_tests.html:1)

  3. Debugger will suspend on statement that generated error if configured in Preferences. See 'Suspend on errors'. Checked by default.
- Variables.
  1. Open menu Window\Preferences\Aptana\JavaScript Debug\Detail Formatters in IDE
  2. Create detail formatter for Date type with snippet code

         return this.toTimeString();

  3. Create detail formatter for Object type with snippet code

         var out = ""; for( var i in this ) { out += "object["+i+"]="+this[i]+"\n"; } return out;

  4. Then press 'Start test' button.
  5. Follow the instructions in comments
- Scripts and anonymous functions name resolving.
  1. Then press 'Start test' button.
  2. Check messages in IDE console. It should contain:

         ReferenceError: no_such_object is not defined
         	at showExceptionStackTrace() (test/debug_tests.html:104)
         	at myFunc0() (test/debug_tests.html:160)
         	at myFunc1() (test/debug_tests.html:166)
         	at myFunc2() (test/debug_tests.html:170)
         	at testAnonymousFunctions() (test/debug_tests.html:156)
         	at onclick(MouseEvent) (test/debug_tests.html:1)

  3. Debugger will suspend on statement that generated error if configured in Preferences. See 'Suspend on errors' and 'Suspend on debugger keyword'. Checked by default.
  4. Use Scripts view to navigate in scripts tree
- javascript: URLs handling
  1. Press 'Start test' link. Start test
- Eval debug.
  1. Then press 'Start test' button.
- Exceptions handling.
  1. Open JavaScript Debug Preferences (menu Window\Preferences\Aptana\JavaScript Debug\) or Launch configuration settings (menu Run\Debug...\<launch configuration>\Debug)
  2. Turn off "Suspend on exceptions" and "Suspend on errors" options
  3. Use menu Run\Add JavaScript Exception Breakpoint... to create breakpoints for types: String, Error, SyntaxError*, ReferrenceError*, RangeError*, TypeError*
     Note that types marked with * are also handled as Error type
  4. Then press 'Start test' button.
  5. Debugger will suspend when exception with appropriate type is thrown
  6. exception variable should be shown in Variables view
- Assert API.
  1. Press 'Start test' button.
  2. JavaScript Runtime Assert dialogs (#1-#20) will appear
  3. Use "Continue" button to continue execution, "Suspend" to suspend in debugger or "Stop" to terminate execution
- XMLHttpRequest sniffing.
  1. Place this debug_tests.html file to any web location and use this location in launch configuration
  2. Then press 'Start test' button.
  3. Sniffed XMLHttpRequest should be shown in Ajax Monitor view (Note: Debug target should be selected in Debug view for now)
- Debug in popup windows.
  1. Put a breakpoint in debug_timer.html.
  2. Then press 'Start test' button.
- Firebug Console logging.
  1. Press 'Start test' button.
  2. Check messages in IDE console. It should contain:

         Use console.log('message')
         Use console.debug('message')
         Use console.info('message')
         Use console.warn('message')
         Use console.error('message')
         Stack trace:
         	at testFirebugConsole() (test/debug_tests.html:356)
         	at onclick(event) (test/debug_tests.html:1)

- Simple Timer test.
  - Use Start/Stop buttons to operate timer.