anchor.diff:  // Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
   // for details. All rights reserved. Use of this source code is governed by a
   // BSD-style license that can be found in the LICENSE file.
  -
  -// TODO: This is temporary addition to BOT util
  -// DARTBUG: http://code.google.com/p/dart/issues/detail?id=8335
  -// is fixed.
   
   /**
    * A simple unit test library for running tests in a browser.
  
positive.code:  */
  library unittest_html_enhanced_config;
  
  import 'dart:collection' show LinkedHashMap;
  import 'dart:html';
  import 'package:unittest/unittest.dart';
  
  class HtmlEnhancedConfiguration extends Configuration {
    /** Whether this is run within dartium layout tests. */
    final bool _isLayoutTest;
    HtmlEnhancedConfiguration(this._isLayoutTest);
  
    // TODO(rnystrom): Get rid of this if we get canonical closures for methods.
    EventListener _onErrorClosure;
    EventListener _onMessageClosure;
  
    void _installHandlers() {
      if (_onErrorClosure == null) {
        _onErrorClosure =
            (e) => handleExternalError(e, '(DOM callback has errors)');
        // Listen for uncaught errors.
        window.onError.listen(_onErrorClosure);
      }
      if (_onMessageClosure == null) {
        _onMessageClosure = (e) => processMessage(e);
        // Listen for errors from JS.
        window.onMessage.listen(_onMessageClosure);
      }
    }
  
    void _uninstallHandlers() {
      if (_onErrorClosure != null) {
        window.on.error.remove(_onErrorClosure);
        _onErrorClosure = null;
      }
      if (_onMessageClosure != null) {
        window.on.message.remove(_onMessageClosure);
        _onMessageClosure = null;
      }
    }
  
  
negative.code:   ''';
  }
  
  /**
   * This will be removed when the SDK that includes http://code.google.com/p/dart/source/detail?r=18294 is released.
   */
  @deprecated
  void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) {
    if (config != null) return;
    configure(new _HtmlEnhancedConfiguration(isLayoutTest));
  }
  