User:Harthur/XBL2/Testplan

From MozillaWiki
Jump to: navigation, search

Overview

The Spec

  • Assumptions: Javascript is the scripting language, bound elements are HTML/XUL.
  • Test format:
    • Most tests for implementation, handlers, binding attachment, etc. will be mochitests, with the binding in the same document as the bound elements (some with separate binding documents to test loading binding documents) and binding will be mostly done with the CSS binding property (or element property of binding).
    • Some tests may need to be reftests or some kind of hacked mochitest to test the shadow tree in particular, as well as styling.

Each element/attribute

  • not that we can test all of these individually
  • Elements in the XBL 2 namespace:
    • xbl
      • will be in every test obviously, but could test xbl in xbl errors
    • binding
      • also will be in every test, but could test context errors
    • implementation
      • getters, setters
      • methods
      • lots of scoping, prototype tests
      • shadowTree, boundElement, external
    • template
    • content
      • lots of final flattened tree verification
    • inherited
    • div
      • will be in many tests, won't test this explicitly
    • handlers
    • handler
    • resources
      • won't test this element explicitly, except in context errors
    • style
      • scoping tests
    • prefetch
    • script
      • scoping tests
  • Attributes
    • xbl:attr
    • xbl:pseudo

Attachment/Detachment

  • attachment methods:
    • 'element' attribute of binding
    • CSS 'binding' property
    • addBinding method of to-be-bound element
  • xblBindingAttached method of implementation
  • xbl-bound event on bound element

Importing binding documents

  • loadBindingDocument
    • synchronous
  • <?xbl?>
    • bindings-are-ready counter

Inheritance

  • extends attribute of binding
  • implicit inheritance

Dynamic Mutation

  • mutation of xbl elements (like mutating the shadow tree) - could be a separate set of tests or scattered among tests for individual elements
  • xblEnteredDocument/xblLeftDocument method of implementation element

Javascript binding

  • prototype
  • external property of internal implementation object
  • boundElement property of
  • shadowTree property of '
  • baseBinding property of '