Merge last green mozilla-central changeset to mozilla-inbound
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 28 Jul 2011 14:53:21 -0700
changeset 73522 524a9852f99ff258b965a0bc29391dd32923629a
parent 73521 ac34cb0bb08561094a713ec75f23fa11b510b82f (current diff)
parent 73493 83129d0d4abeb704dd1f8261f082273c4040c710 (diff)
child 73523 567a0c458ae00e8002368e0ea8eace49141924d6
child 105015 74b2b46fca7d4e5e36c1e396045975889351ee24
push id20884
push usermak77@bonardo.net
push dateFri, 29 Jul 2011 09:49:02 +0000
treeherdermozilla-central@f5f1e3822540 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge last green mozilla-central changeset to mozilla-inbound
security/coreconf/Linux2.1.mk
security/coreconf/Linux2.2.mk
security/coreconf/Linux2.4.mk
security/coreconf/Linux2.5.mk
security/coreconf/Linux2.6.mk
security/coreconf/LinuxELF1.2.mk
security/coreconf/LinuxELF2.0.mk
security/patches/bug-662557-nss-debug-sec-error-no-memory.patch
toolkit/components/console/hudservice/AutocompletePopup.jsm
toolkit/components/console/hudservice/HUDService.jsm
toolkit/components/console/hudservice/Makefile.in
toolkit/components/console/hudservice/NetworkHelper.jsm
toolkit/components/console/hudservice/NetworkPanel.xhtml
toolkit/components/console/hudservice/PropertyPanel.jsm
toolkit/components/console/hudservice/tests/Makefile.in
toolkit/components/console/hudservice/tests/browser/Makefile.in
toolkit/components/console/hudservice/tests/browser/browser_warn_user_about_replaced_api.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_abbreviate_source_url.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_basic_net_logging.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_578437_page_reload.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_579412_input_focus.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580001_closing_after_completion.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580400_groups.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580454_timestamp_l10n.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_581231_close_button.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_582201_duplicate_errors.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_583816_tab_focus.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585237_line_limit.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585956_console_trace.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585991_autocomplete_keys.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585991_autocomplete_popup.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_586388_select_all.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_587617_output_copy.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588342_document_focus.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588730_text_node_insertion.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588967_input_expansion.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_589162_css_filter.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_592442_closing_brackets.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_594477_clickable_output.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_594497_history_arrow_keys.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595223_file_uri.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597136_external_script_errors.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597136_network_requests_from_chrome.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597460_filter_scroll.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_598357_jsterm_output.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_599725_response_headers.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_600183_charset.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601177_log_levels.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601352_scroll.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601667_filter_buttons.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601909_remember_height.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_602572_log_bodies_checkbox.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_603750_websocket.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_611795.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613013_console_api_iframe.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613280_jsterm_copy.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613642_maintain_scroll.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613642_prune_scroll.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_614793_jsterm_scroll.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618078_network_exceptions.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618311_close_panels.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618311_private_browsing.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_621644_jsterm_dollar.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_626484_output_copy_order.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_630733_response_redirect_headers.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632275_getters_document_width.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632817.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642108_pruneTest.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642615_autocomplete.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_644419_log_limits.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_646025_console_file_location.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_651501_document_body_autocomplete.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_660806_history_nav.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_663443_panel_title.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_chrome.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_completion.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_console_extras.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_console_logging_api.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_consoleonpage.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_execution_scope.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_history.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_hud_getters.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_js_input_and_output_styling.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_js_input_expansion.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_live_filtering_of_message_types.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_live_filtering_on_search_strings.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_log_node_classes.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_message_node_id.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_netlogging.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_network_panel.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_notifications.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_null_and_undefined_output.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_output_order.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_position_ui.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_property_panel.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_property_provider.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_registries.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_create_display.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_iteration.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_record_entry.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_record_many_entries.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_view_source.js
toolkit/components/console/hudservice/tests/browser/head.js
toolkit/components/console/hudservice/tests/browser/test-bug-585956-console-trace.html
toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud-iframe.html
toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas-css.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas-css.js
toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas.js
toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-loader.css
toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-loader.css^headers^
toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-loader.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-parser.css
toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-parser.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external2.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external2.js
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-html-external.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-html-external.js
toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-html.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-empty-getelementbyid.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-empty-getelementbyid.js
toolkit/components/console/hudservice/tests/browser/test-bug-595934-html.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-image.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-image.jpg
toolkit/components/console/hudservice/tests/browser/test-bug-595934-imagemap.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-malformedxml-external.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-malformedxml-external.xml
toolkit/components/console/hudservice/tests/browser/test-bug-595934-malformedxml.xhtml
toolkit/components/console/hudservice/tests/browser/test-bug-595934-svg.xhtml
toolkit/components/console/hudservice/tests/browser/test-bug-595934-workers.html
toolkit/components/console/hudservice/tests/browser/test-bug-595934-workers.js
toolkit/components/console/hudservice/tests/browser/test-bug-597136-external-script-errors.html
toolkit/components/console/hudservice/tests/browser/test-bug-597136-external-script-errors.js
toolkit/components/console/hudservice/tests/browser/test-bug-597756-reopen-closed-tab.html
toolkit/components/console/hudservice/tests/browser/test-bug-599725-response-headers.sjs
toolkit/components/console/hudservice/tests/browser/test-bug-600183-charset.html
toolkit/components/console/hudservice/tests/browser/test-bug-600183-charset.html^headers^
toolkit/components/console/hudservice/tests/browser/test-bug-601177-log-levels.html
toolkit/components/console/hudservice/tests/browser/test-bug-601177-log-levels.js
toolkit/components/console/hudservice/tests/browser/test-bug-603750-websocket.html
toolkit/components/console/hudservice/tests/browser/test-bug-603750-websocket.js
toolkit/components/console/hudservice/tests/browser/test-bug-613013-console-api-iframe.html
toolkit/components/console/hudservice/tests/browser/test-bug-618078-network-exceptions.html
toolkit/components/console/hudservice/tests/browser/test-bug-621644-jsterm-dollar.html
toolkit/components/console/hudservice/tests/browser/test-bug-630733-response-redirect-headers.sjs
toolkit/components/console/hudservice/tests/browser/test-bug-632275-getters.html
toolkit/components/console/hudservice/tests/browser/test-bug-632347-iterators-generators.html
toolkit/components/console/hudservice/tests/browser/test-bug-644419-log-limits.html
toolkit/components/console/hudservice/tests/browser/test-bug-646025-console-file-location.html
toolkit/components/console/hudservice/tests/browser/test-console-extras.html
toolkit/components/console/hudservice/tests/browser/test-console-replaced-api.html
toolkit/components/console/hudservice/tests/browser/test-console.html
toolkit/components/console/hudservice/tests/browser/test-data.json
toolkit/components/console/hudservice/tests/browser/test-duplicate-error.html
toolkit/components/console/hudservice/tests/browser/test-encoding-ISO-8859-1.html
toolkit/components/console/hudservice/tests/browser/test-error.html
toolkit/components/console/hudservice/tests/browser/test-file-location.js
toolkit/components/console/hudservice/tests/browser/test-filter.html
toolkit/components/console/hudservice/tests/browser/test-image.png
toolkit/components/console/hudservice/tests/browser/test-mutation.html
toolkit/components/console/hudservice/tests/browser/test-network-request.html
toolkit/components/console/hudservice/tests/browser/test-network.html
toolkit/components/console/hudservice/tests/browser/test-observe-http-ajax.html
toolkit/components/console/hudservice/tests/browser/test-own-console.html
toolkit/components/console/hudservice/tests/browser/test-property-provider.html
toolkit/components/console/hudservice/tests/browser/testscript.js
--- a/browser/Makefile.in
+++ b/browser/Makefile.in
@@ -40,16 +40,17 @@ topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(topsrcdir)/config/config.mk
 
 PARALLEL_DIRS = \
   base \
   components \
+  devtools \
   fuel \
   locales \
   themes \
   $(NULL)
 
 DIRS = \
   app \
   $(NULL)
--- a/browser/base/content/inspector.js
+++ b/browser/base/content/inspector.js
@@ -523,16 +523,17 @@ Highlighter.prototype = {
 ///////////////////////////////////////////////////////////////////////////
 //// InspectorUI
 
 /**
  * Main controller class for the Inspector.
  */
 var InspectorUI = {
   browser: null,
+  tools: {},
   showTextNodesWithWhitespace: false,
   inspecting: false,
   treeLoaded: false,
   prefEnabledName: "devtools.inspector.enabled",
 
   /**
    * Toggle the inspector interface elements on or off.
    *
@@ -854,16 +855,23 @@ var InspectorUI = {
 
     if (this.domplate) {
       this.domplateUtils.setDOM(null);
       delete this.domplate;
       delete this.HTMLTemplates;
       delete this.domplateUtils;
     }
 
+    this.saveToolState(this.winID);
+    this.toolsDo(function IUI_toolsHide(aTool) {
+      if (aTool.panel) {
+        aTool.panel.hidePopup();
+      }
+    });
+
     this.inspectCmd.setAttribute("checked", false);
     this.browser = this.win = null; // null out references to browser and window
     this.winID = null;
     this.selection = null;
     this.treeLoaded = false;
 
     this.treePanel.addEventListener("popuphidden", function treePanelHidden() {
       InspectorUI.closing = false;
@@ -875,31 +883,33 @@ var InspectorUI = {
   },
 
   /**
    * Begin inspecting webpage, attach page event listeners, activate
    * highlighter event listeners.
    */
   startInspecting: function IUI_startInspecting()
   {
+    document.getElementById("inspector-inspect-toolbutton").checked = true;
     this.attachPageListeners();
     this.inspecting = true;
     this.highlighter.veilTransparentBox.removeAttribute("locked");
   },
 
   /**
    * Stop inspecting webpage, detach page listeners, disable highlighter
    * event listeners.
    */
   stopInspecting: function IUI_stopInspecting()
   {
     if (!this.inspecting) {
       return;
     }
 
+    document.getElementById("inspector-inspect-toolbutton").checked = false;
     this.detachPageListeners();
     this.inspecting = false;
     if (this.highlighter.node) {
       this.select(this.highlighter.node, true, true);
     } else {
       this.select(null, true, true);
     }
     this.highlighter.veilTransparentBox.setAttribute("locked", true);
@@ -921,16 +931,21 @@ var InspectorUI = {
 
     if (forceUpdate || aNode != this.selection) {
       this.selection = aNode;
       if (!this.inspecting) {
         this.highlighter.highlightNode(this.selection);
       }
       this.ioBox.select(this.selection, true, true, aScroll);
     }
+    this.toolsDo(function IUI_toolsOnSelect(aTool) {
+      if (aTool.panel.state == "open") {
+        aTool.onSelect.apply(aTool.context, [aNode]);
+      }
+    });
   },
 
   /////////////////////////////////////////////////////////////////////////
   //// Event Handling
 
   highlighterReady: function IUI_highlighterReady()
   {
     // Setup the InspectorStore or restore state
@@ -969,16 +984,17 @@ var InspectorUI = {
             Services.obs.addObserver(function reopenInspectorForTab() {
               Services.obs.removeObserver(reopenInspectorForTab,
                 INSPECTOR_NOTIFICATIONS.CLOSED, false);
 
               InspectorUI.openInspectorUI();
             }, INSPECTOR_NOTIFICATIONS.CLOSED, false);
           } else {
             this.openInspectorUI();
+            this.restoreToolState(winID);
           }
         }
 
         if (InspectorStore.isEmpty()) {
           gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
         }
         break;
       case "pagehide":
@@ -1217,17 +1233,123 @@ var InspectorUI = {
       if (frame.language == Ci.nsIProgrammingLanguage.JAVASCRIPT ||
           frame.language == Ci.nsIProgrammingLanguage.JAVASCRIPT2) {
         this._log("filename: " + frame.filename + " lineNumber: " + frame.lineNumber +
           " functionName: " + frame.name);
       }
     }
     this._log("END TRACE");
   },
-}
+
+  /**
+   * Register an external tool with the inspector.
+   *
+   * aRegObj = {
+   *   id: "toolname",
+   *   context: myTool,
+   *   label: "Button label",
+   *   icon: "chrome://somepath.png",
+   *   tooltiptext: "Button tooltip",
+   *   accesskey: "S",
+   *   onSelect: object.method,
+   *   onShow: object.method,
+   *   onHide: object.method,
+   *   panel: myTool.panel
+   * }
+   *
+   * @param aRegObj
+   */
+  registerTool: function IUI_RegisterTool(aRegObj) {
+    if (this.tools[aRegObj.id]) {
+      return;
+    } else {
+      let id = aRegObj.id;
+      let buttonId = "inspector-" + id + "-toolbutton";
+      aRegObj.buttonId = buttonId;
+
+      aRegObj.panel.addEventListener("popuphiding",
+        function IUI_toolPanelHiding() {
+          btn.setAttribute("checked", "false");
+        }, false);
+      aRegObj.panel.addEventListener("popupshowing",
+        function IUI_toolPanelShowing() {
+          btn.setAttribute("checked", "true");
+        }, false);
+
+      this.tools[id] = aRegObj;
+    }
+
+    let toolbar = document.getElementById("inspector-toolbar");
+    let btn = document.createElement("toolbarbutton");
+    btn.setAttribute("id", aRegObj.buttonId);
+    btn.setAttribute("label", aRegObj.label);
+    btn.setAttribute("tooltiptext", aRegObj.tooltiptext);
+    btn.setAttribute("accesskey", aRegObj.accesskey);
+    btn.setAttribute("class", "toolbarbutton-text");
+    btn.setAttribute("image", aRegObj.icon || "");
+    toolbar.appendChild(btn);
+
+    btn.addEventListener("click",
+      function IUI_ToolButtonClick(aEvent) {
+        if (btn.getAttribute("checked") == "true") {
+          aRegObj.onHide.apply(aRegObj.context);
+        } else {
+          aRegObj.onShow.apply(aRegObj.context, [InspectorUI.selection]);
+          aRegObj.onSelect.apply(aRegObj.context, [InspectorUI.selection]);
+        }
+      }, false);
+  },
+
+/**
+ * Save a list of open tools to the inspector store.
+ *
+ * @param aWinID The ID of the window used to save the associated tools
+ */
+  saveToolState: function IUI_saveToolState(aWinID)
+  {
+    let openTools = {};
+    this.toolsDo(function IUI_toolsSetId(aTool) {
+      if (aTool.panel.state == "open") {
+        openTools[aTool.id] = true;
+      }
+    });
+    InspectorStore.setValue(aWinID, "openTools", openTools);
+  },
+
+/**
+ * Restore tools previously save using saveToolState().
+ *
+ * @param aWinID The ID of the window to which the associated tools are to be
+ *               restored.
+ */
+  restoreToolState: function IUI_restoreToolState(aWinID)
+  {
+    let openTools = InspectorStore.getValue(aWinID, "openTools");
+    InspectorUI.selection = InspectorUI.selection;
+    if (openTools) {
+      this.toolsDo(function IUI_toolsOnShow(aTool) {
+        if (aTool.id in openTools) {
+          aTool.onShow.apply(aTool.context, [InspectorUI.selection]);
+        }
+      });
+    }
+  },
+  
+  /**
+   * Loop through all registered tools and pass each into the provided function
+   *
+   * @param aFunction The function to which each tool is to be passed
+   */
+  toolsDo: function IUI_toolsDo(aFunction)
+  {
+    for each (let tool in this.tools) {
+      aFunction(tool);
+    }
+  },
+};
 
 /**
  * The Inspector store is used for storing data specific to each tab window.
  */
 var InspectorStore = {
   store: {},
   length: 0,
 
@@ -1352,9 +1474,8 @@ var InspectorStore = {
 };
 
 /////////////////////////////////////////////////////////////////////////
 //// Initializors
 
 XPCOMUtils.defineLazyGetter(InspectorUI, "inspectCmd", function () {
   return document.getElementById("Tools:Inspect");
 });
-
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3055,17 +3055,17 @@
             if (!detached) {
               this.setAttribute("drag", "detach");
               this._clearDragTransforms();
               this._tabDropIndicator.collapsed = true;
               if (draggedTab.style.maxWidth) {
                 data._maxWidth = draggedTab.style.maxWidth;
                 draggedTab.style.maxWidth = "";
               }
-              delete draggedTab._dropIndex;
+              delete data._dropIndex;
               let label = dragPanel.firstChild;
               let preview = dragPanel.lastChild;
               label.value = draggedTab.label;
               label.width = preview.width = Math.min(outerWidth / 2, screen.availWidth / 5);
               let aspectRatio = this.tabbrowser.clientWidth / this.tabbrowser.clientHeight;
               preview.height = Math.min(preview.width / aspectRatio, screen.availHeight / 5);
               dragPanel.hidden = false;
               dragPanel.openPopupAtScreen(event.screenX, event.screenY, false);
@@ -3882,17 +3882,16 @@
         // This does not work at all (see bug 458613)
         var target = event.relatedTarget;
         while (target && target != this)
           target = target.parentNode;
         if (target)
           return;
 
         this._tabDropIndicator.collapsed = true;
-        this._continueScroll(event);
         event.stopPropagation();
       ]]></handler>
     </handlers>
   </binding>
 
   <!-- close-tab-button binding
        This binding relies on the structure of the tabbrowser binding.
        Therefore it should only be used as a child of the tab or the tabs
--- a/browser/base/content/tabview/modules/utils.jsm
+++ b/browser/base/content/tabview/modules/utils.jsm
@@ -521,22 +521,25 @@ let Utils = {
 
   // ----------
   // Function: trace
   // Prints the given arguments to the JavaScript error console as a message,
   // along with a full stack trace.
   // Pass as many arguments as you want, it'll print them all.
   trace: function Utils_trace() {
     var text = this.expandArgumentsForLog(arguments);
-    // cut off the first two lines of the stack trace, because they're just this function.
-    let stack = Error().stack.replace(/^.*?\n.*?\n/, "");
+
+    // cut off the first line of the stack trace, because that's just this function.
+    let stack = Error().stack.split("\n").slice(1);
+
     // if the caller was assert, cut out the line for the assert function as well.
-    if (this.trace.caller.name == 'Utils_assert')
-      stack = stack.replace(/^.*?\n/, "");
-    this.log('trace: ' + text + '\n' + stack);
+    if (stack[0].indexOf("Utils_assert(") == 0)
+      stack.splice(0, 1);
+
+    this.log('trace: ' + text + '\n' + stack.join("\n"));
   },
 
   // ----------
   // Function: assert
   // Prints a stack trace along with label (as a console message) if condition is false.
   assert: function Utils_assert(condition, label) {
     if (!condition) {
       let text;
@@ -555,20 +558,20 @@ let Utils = {
   assertThrow: function Utils_assertThrow(condition, label) {
     if (!condition) {
       let text;
       if (typeof label != 'string')
         text = 'badly formed assert';
       else
         text = "tabview assert: " + label;
 
-      // cut off the first two lines of the stack trace, because they're just this function.
-      text += Error().stack.replace(/^.*?\n.*?\n/, "");
+      // cut off the first line of the stack trace, because that's just this function.
+      let stack = Error().stack.split("\n").slice(1);
 
-      throw text;
+      throw text + "\n" + stack.join("\n");
     }
   },
 
   // ----------
   // Function: expandObject
   // Prints the given object to a string, including all of its properties.
   expandObject: function Utils_expandObject(obj) {
     var s = obj + ' = {';
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -999,16 +999,19 @@ let UI = {
     keys = {};
     // The lower case letters are passed to processBrowserKeys() even with shift 
     // key when stimulating a key press using EventUtils.synthesizeKey() so need 
     // to handle both upper and lower cases here.
     [
 #ifdef XP_UNIX
       "redo",
 #endif
+#ifdef XP_MACOSX
+      "fullScreen",
+#endif
       "closeWindow", "tabview", "undoCloseTab", "undoCloseWindow",
       "privatebrowsing"
     ].forEach(function(key) {
       let element = gWindow.document.getElementById("key_" + key);
       let code = element.getAttribute("key").toLocaleLowerCase().charCodeAt(0);
       keys[code] = key;
     });
     this._browserKeysWithShift = keys;
--- a/browser/base/content/test/inspector/Makefile.in
+++ b/browser/base/content/test/inspector/Makefile.in
@@ -49,13 +49,14 @@ include $(topsrcdir)/config/rules.mk
 		browser_inspector_highlighter.js \
 		browser_inspector_iframeTest.js \
 		browser_inspector_scrolling.js \
 		browser_inspector_store.js \
 		browser_inspector_tab_switch.js \
 		browser_inspector_treePanel_output.js \
 		browser_inspector_treePanel_input.html \
 		browser_inspector_treePanel_result.html \
+		browser_inspector_registertools.js \
 		browser_inspector_bug_665880.js \
 		$(NULL)
 
 libs::	$(_BROWSER_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/inspector/browser_inspector_registertools.js
@@ -0,0 +1,275 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Inspector Highlighter Tests.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Michael Ratcliffe <mratcliffe@mozilla.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+let doc;
+let h1;
+let tool1;
+let tool2;
+let tool3;
+
+function createDocument()
+{
+  let div = doc.createElement("div");
+  let h1 = doc.createElement("h1");
+  let p1 = doc.createElement("p");
+  let p2 = doc.createElement("p");
+  let div2 = doc.createElement("div");
+  let p3 = doc.createElement("p");
+  doc.title = "Inspector Tree Selection Test";
+  h1.textContent = "Inspector Tree Selection Test";
+  p1.textContent = "This is some example text";
+  p2.textContent = "Lorem ipsum dolor sit amet, consectetur adipisicing " +
+    "elit, sed do eiusmod tempor incididunt ut labore et dolore magna " +
+    "aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco " +
+    "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure " +
+    "dolor in reprehenderit in voluptate velit esse cillum dolore eu " +
+    "fugiat nulla pariatur. Excepteur sint occaecat cupidatat non " +
+    "proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
+  p3.textContent = "Lorem ipsum dolor sit amet, consectetur adipisicing " +
+    "elit, sed do eiusmod tempor incididunt ut labore et dolore magna " +
+    "aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco " +
+    "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure " +
+    "dolor in reprehenderit in voluptate velit esse cillum dolore eu " +
+    "fugiat nulla pariatur. Excepteur sint occaecat cupidatat non " +
+    "proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
+  div.appendChild(h1);
+  div.appendChild(p1);
+  div.appendChild(p2);
+  div2.appendChild(p3);
+  doc.body.appendChild(div);
+  doc.body.appendChild(div2);
+  setupHighlighterTests();
+}
+
+function setupHighlighterTests()
+{
+  h1 = doc.querySelectorAll("h1")[0];
+  ok(h1, "we have the header node");
+  Services.obs.addObserver(inspectorOpen, "inspector-opened", false);
+  InspectorUI.toggleInspectorUI();
+}
+
+function inspectorOpen()
+{
+  info("we received the inspector-opened notification");
+  Services.obs.removeObserver(inspectorOpen, "inspector-opened", false);
+  Services.obs.addObserver(startToolTests, "inspector-highlighting", false);
+  let rect = h1.getBoundingClientRect();
+  executeSoon(function() {
+    EventUtils.synthesizeMouse(h1, 2, 2, {type: "mousemove"}, content);
+  });
+}
+
+function startToolTests(evt)
+{
+  info("we received the inspector-highlighting notification");
+  Services.obs.removeObserver(startToolTests, "inspector-highlighting", false);
+  InspectorUI.stopInspecting();
+
+  info("Getting InspectorUI.tools");
+  let tools = InspectorUI.tools;
+  tool1 = InspectorUI.tools["tool_1"];
+  tool2 = InspectorUI.tools["tool_2"];
+  tool3 = InspectorUI.tools["tool_3"];
+
+  info("Checking panel states 1");
+  ok(tool1.context.panelIsClosed, "Panel 1 is closed");
+  ok(tool2.context.panelIsClosed, "Panel 2 is closed");
+  ok(tool3.context.panelIsClosed, "Panel 3 is closed");
+
+  info("Calling show method for all tools");
+  tool1.onShow.apply(tool1.context, [h1]);
+  tool2.onShow.apply(tool2.context, [h1]);
+  tool3.onShow.apply(tool3.context, [h1]);
+
+  info("Checking panel states 2");
+  ok(tool1.context.panelIsOpen, "Panel 1 is open");
+  ok(tool2.context.panelIsOpen, "Panel 2 is open");
+  ok(tool3.context.panelIsOpen, "Panel 3 is open");
+
+  info("Calling selectNode method for all tools");
+  tool1.onSelect.apply(tool1.context, [h1]);
+  tool2.onSelect.apply(tool2.context, [h1]);
+  tool3.onSelect.apply(tool3.context, [h1]);
+
+  info("Calling hide method for all tools");
+  tool1.onHide.apply(tool1.context, [h1]);
+  tool2.onHide.apply(tool2.context, [h1]);
+  tool3.onHide.apply(tool3.context, [h1]);
+
+  info("Checking panel states 3");
+  ok(tool1.context.panelIsClosed, "Panel 1 is closed");
+  ok(tool2.context.panelIsClosed, "Panel 2 is closed");
+  ok(tool3.context.panelIsClosed, "Panel 3 is closed");
+
+  info("Showing tools 1 & 3");
+  tool1.onShow.apply(tool1.context, [h1]);
+  tool3.onShow.apply(tool3.context, [h1]);
+
+  info("Checking panel states 4");
+  ok(tool1.context.panelIsOpen, "Panel 1 is open");
+  ok(tool2.context.panelIsClosed, "Panel 2 is closed");
+  ok(tool3.context.panelIsOpen, "Panel 3 is open");
+
+  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedBrowser.addEventListener("load", function() {
+    gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
+    waitForFocus(testSecondTab, content);
+  }, true);
+
+  content.location = "data:text/html,registertool new tab test for inspector";
+}
+
+function testSecondTab()
+{
+  info("Opened second tab");
+  info("Checking panel states 5");
+  ok(tool1.context.panelIsClosed, "Panel 1 is closed");
+  ok(tool2.context.panelIsClosed, "Panel 2 is closed");
+  ok(tool3.context.panelIsClosed, "Panel 3 is closed");
+
+  info("Closing current tab");
+  gBrowser.removeCurrentTab();
+
+  info("Checking panel states 6");
+  ok(tool1.context.panelIsOpen, "Panel 1 is open");
+  ok(tool2.context.panelIsClosed, "Panel 2 is closed");
+  ok(tool3.context.panelIsOpen, "Panel 3 is open");
+
+  executeSoon(finishUp);
+}
+
+function finishUp() {
+  InspectorUI.closeInspectorUI(true);
+  gBrowser.removeCurrentTab();
+  finish();
+}
+
+function test()
+{
+  waitForExplicitFinish();
+  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedBrowser.addEventListener("load", function() {
+    gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
+    doc = content.document;
+    waitForFocus(registerTools, content);
+  }, true);
+  
+  content.location = "data:text/html,registertool tests for inspector";
+}
+
+function registerTools()
+{
+  createDocument();
+  registerTool(new testTool("tool_1", "Tool 1", "Tool 1 tooltip", "I"));
+  registerTool(new testTool("tool_2", "Tool 2", "Tool 2 tooltip", "J"));
+  registerTool(new testTool("tool_3", "Tool 3", "Tool 3 tooltip", "K"));
+}
+
+function registerTool(aTool)
+{
+  InspectorUI.registerTool({
+    id: aTool.id,
+    label: aTool.label,
+    tooltiptext: aTool.tooltip,
+    accesskey: aTool.accesskey,
+    context: aTool,
+    onSelect: aTool.selectNode,
+    onShow: aTool.show,
+    onHide: aTool.hide,
+    panel: aTool.panel
+  });
+}
+
+// Tool Object
+function testTool(aToolId, aLabel, aTooltip, aAccesskey)
+{
+  this.id = aToolId;
+  this.label = aLabel;
+  this.tooltip = aTooltip;
+  this.accesskey = aAccesskey
+  this.panel = this.createPanel();
+}
+
+testTool.prototype = {
+  get panelIsOpen()
+  {
+    return this.panel.state == "open" || this.panel.state == "showing";
+  },
+
+  get panelIsClosed()
+  {
+    return this.panel.state == "closed" || this.panel.state == "hiding";
+  },
+
+  selectNode: function BIR_selectNode(aNode) {
+    is(InspectorUI.selection, aNode,
+       "selectNode: currently selected node was passed: " + this.id);
+  },
+
+  show: function BIR_show(aNode) {
+    this.panel.openPopup(gBrowser.selectedBrowser,
+                         "end_before", 0, 20, false, false);
+    is(InspectorUI.selection, aNode,
+       "show: currently selected node was passed: " + this.id);
+  },
+
+  hide: function BIR_hide() {
+    info(this.id + " hide");
+    this.panel.hidePopup();
+  },
+
+  createPanel: function BIR_createPanel() {
+    let popupSet = document.getElementById("mainPopupSet");
+    let ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+    let panel = this.panel = document.createElementNS(ns, "panel");
+    panel.setAttribute("orient", "vertical");
+    panel.setAttribute("noautofocus", "true");
+    panel.setAttribute("noautohide", "true");
+    panel.setAttribute("titlebar", "normal");
+    panel.setAttribute("close", "true");
+    panel.setAttribute("label", "Panel for " + this.id);
+    panel.setAttribute("width", 200);
+    panel.setAttribute("height", 400);
+    popupSet.appendChild(panel);
+
+    ok(panel.parentNode == popupSet, "Panel created and appended successfully");
+    return panel;
+  },
+};
--- a/browser/base/content/test/tabview/browser_tabview_undo_group.js
+++ b/browser/base/content/test/tabview/browser_tabview_undo_group.js
@@ -20,17 +20,17 @@ function onTabViewWindowLoaded() {
   registerCleanupFunction(function() {
     let groupItem = contentWindow.GroupItems.groupItem(groupItemId);
     if (groupItem)
       closeGroupItem(groupItem, function() {});
   });
 
   // create a group item
   let groupItem = createGroupItemWithBlankTabs(window, 300, 300, 400, 1);
-  groupItemId = groupItem.id;
+  let groupItemId = groupItem.id;
   is(groupItem.getChildren().length, 1, "The new group has a tab item");
   // start the tests
   waitForFocus(function() {
     testUndoGroup(contentWindow, groupItem);
   }, contentWindow);
 }
 
 function testUndoGroup(contentWindow, groupItem) {
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -88,10 +88,8 @@ browser.jar:
 #endif
 *       content/browser/viewSourceOverlay.xul         (content/viewSourceOverlay.xul)
 #ifdef XP_WIN
 *       content/browser/win6BrowserOverlay.xul        (content/win6BrowserOverlay.xul)
 #endif
 # the following files are browser-specific overrides
 *       content/browser/license.html                  (/toolkit/content/license.html)
 % override chrome://global/content/license.html chrome://browser/content/license.html
-# XXXkhuey This really should live in browser/, but it's too late in the release cycle to move
-+       content/browser/NetworkPanel.xhtml            (/toolkit/components/console/hudservice/NetworkPanel.xhtml)
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -42,18 +42,16 @@ endif
 TIERS += app
 
 ifdef MOZ_EXTENSIONS
 tier_app_dirs += extensions
 endif
 
 tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
 
-tier_app_dirs += toolkit/components/console/hudservice
-
 ifdef MOZ_SERVICES_SYNC
 tier_app_dirs += services
 endif
 
 tier_app_dirs += browser
 # Never add other tier_app_dirs after browser. They won't get packaged
 # properly on mac.
 
--- a/browser/components/sessionstore/src/nsSessionStartup.js
+++ b/browser/components/sessionstore/src/nsSessionStartup.js
@@ -245,17 +245,17 @@ SessionStartup.prototype = {
       // This might throw if we're removing the observer multiple times,
       // but this is safe to ignore.
     }
   },
 
 /* ........ Public API ................*/
 
   /**
-   * Get the session state as a string
+   * Get the session state as a jsval
    */
   get state() {
     return this._initialState;
   },
 
   /**
    * Determine whether there is a pending session restore.
    * @returns bool
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -111,17 +111,17 @@ XXX keep these in sync with all the attr
 const CAPABILITIES = [
   "Subframes", "Plugins", "Javascript", "MetaRedirects", "Images",
   "DNSPrefetch", "Auth", "WindowControl"
 ];
 
 // These keys are for internal use only - they shouldn't be part of the JSON
 // that gets saved to disk nor part of the strings returned by the API.
 const INTERNAL_KEYS = ["_tabStillLoading", "_hosts", "_formDataSaved",
-                       "_shouldRestore"];
+                       "_shouldRestore", "_host", "_scheme"];
 
 // These are tab events that we listen to.
 const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide",
                     "TabPinned", "TabUnpinned"];
 
 #ifndef XP_WIN
 #define BROKEN_WM_Z_ORDER
 #endif
@@ -1765,17 +1765,25 @@ SessionStoreService.prototype = {
    *        always return privacy sensitive data (use with care)
    * @param aIsPinned
    *        the tab is pinned and should be treated differently for privacy
    * @returns object
    */
   _serializeHistoryEntry:
     function sss_serializeHistoryEntry(aEntry, aFullData, aIsPinned) {
     var entry = { url: aEntry.URI.spec };
-    
+
+    try {
+      entry._host = aEntry.URI.host;
+      entry._scheme = aEntry.URI.scheme;
+    }
+    catch (ex) {
+      // We just won't attempt to get cookies for this entry.
+    }
+
     if (aEntry.title && aEntry.title != entry.url) {
       entry.title = aEntry.title;
     }
     if (aEntry.isSubFrame) {
       entry.subframe = true;
     }
     if (!(aEntry instanceof Ci.nsISHEntry)) {
       return entry;
@@ -2173,31 +2181,30 @@ SessionStoreService.prototype = {
    * @param aCheckPrivacy
    *        should we check the privacy level for https
    * @param aIsPinned
    *        is the entry we're evaluating for a pinned tab; used only if
    *        aCheckPrivacy
    */
   _extractHostsForCookies:
     function sss__extractHostsForCookies(aEntry, aHosts, aCheckPrivacy, aIsPinned) {
-    let match;
-
-    if ((match = /^https?:\/\/(?:[^@\/\s]+@)?([\w.-]+)/.exec(aEntry.url)) != null) {
-      if (!aHosts[match[1]] &&
-          (!aCheckPrivacy ||
-           this._checkPrivacyLevel(this._getURIFromString(aEntry.url).schemeIs("https"),
-                                   aIsPinned))) {
-        // By setting this to true or false, we can determine when looking at
-        // the host in _updateCookies if we should check for privacy.
-        aHosts[match[1]] = aIsPinned;
-      }
+
+    // _host and _scheme may not be set (for about: urls for example), in which
+    // case testing _scheme will be sufficient.
+    if (/https?/.test(aEntry._scheme) && !aHosts[aEntry._host] &&
+        (!aCheckPrivacy ||
+         this._checkPrivacyLevel(aEntry._scheme == "https", aIsPinned))) {
+      // By setting this to true or false, we can determine when looking at
+      // the host in _updateCookies if we should check for privacy.
+      aHosts[aEntry._host] = aIsPinned;
     }
-    else if ((match = /^file:\/\/([^\/]*)/.exec(aEntry.url)) != null) {
-      aHosts[match[1]] = true;
+    else if (aEntry._scheme == "file") {
+      aHosts[aEntry._host] = true;
     }
+
     if (aEntry.children) {
       aEntry.children.forEach(function(entry) {
         this._extractHostsForCookies(entry, aHosts, aCheckPrivacy, aIsPinned);
       }, this);
     }
   },
 
   /**
new file mode 100644
--- /dev/null
+++ b/browser/devtools/Makefile.in
@@ -0,0 +1,56 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 1998
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#  Rob Campbell <rcampbell@mozilla.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH   = ../..
+topsrcdir = @top_srcdir@
+srcdir    = @srcdir@
+VPATH   = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/config.mk
+
+DIRS = \
+  webconsole \
+  $(NULL)
+
+ifdef ENABLE_TESTS
+# DIRS += test # no tests yet
+endif
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/browser/devtools/jar.mn
@@ -0,0 +1,2 @@
+browser.jar:
+    content/browser/NetworkPanel.xhtml            (webconsole/NetworkPanel.xhtml)
rename from toolkit/components/console/hudservice/AutocompletePopup.jsm
rename to browser/devtools/webconsole/AutocompletePopup.jsm
rename from toolkit/components/console/hudservice/HUDService.jsm
rename to browser/devtools/webconsole/HUDService.jsm
--- a/toolkit/components/console/hudservice/HUDService.jsm
+++ b/browser/devtools/webconsole/HUDService.jsm
@@ -1725,17 +1725,17 @@ HUD_SERVICE.prototype =
     // remove the nodes then.
     hud.jsterm.clearOutput();
 
     // Make sure that the console panel does not try to call
     // deactivateHUDForContext() again.
     hud.consoleWindowUnregisterOnHide = false;
 
     // Remove the HUDBox and the consolePanel if the Web Console is inside a
-    // floating xul:panel.
+    // floating panel.
     hud.HUDBox.parentNode.removeChild(hud.HUDBox);
     if (hud.consolePanel) {
       hud.consolePanel.parentNode.removeChild(hud.consolePanel);
     }
 
     if (hud.splitter.parentNode) {
       hud.splitter.parentNode.removeChild(hud.splitter);
     }
@@ -2500,40 +2500,40 @@ HUD_SERVICE.prototype =
    * @returns void
    */
   logNetActivity: function HS_logNetActivity(aActivityObject)
   {
     let hudId = aActivityObject.hudId;
     let outputNode = this.hudReferences[hudId].outputNode;
 
     let chromeDocument = outputNode.ownerDocument;
-    let msgNode = chromeDocument.createElementNS(XUL_NS, "xul:hbox");
-
-    let methodNode = chromeDocument.createElementNS(XUL_NS, "xul:label");
+    let msgNode = chromeDocument.createElementNS(XUL_NS, "hbox");
+
+    let methodNode = chromeDocument.createElementNS(XUL_NS, "label");
     methodNode.setAttribute("value", aActivityObject.method);
     methodNode.classList.add("webconsole-msg-body-piece");
     msgNode.appendChild(methodNode);
 
-    let linkNode = chromeDocument.createElementNS(XUL_NS, "xul:hbox");
+    let linkNode = chromeDocument.createElementNS(XUL_NS, "hbox");
     linkNode.setAttribute("flex", "1");
     linkNode.classList.add("webconsole-msg-body-piece");
     linkNode.classList.add("webconsole-msg-link");
     msgNode.appendChild(linkNode);
 
-    let urlNode = chromeDocument.createElementNS(XUL_NS, "xul:label");
+    let urlNode = chromeDocument.createElementNS(XUL_NS, "label");
     urlNode.setAttribute("crop", "center");
     urlNode.setAttribute("flex", "1");
     urlNode.setAttribute("title", aActivityObject.url);
     urlNode.setAttribute("value", aActivityObject.url);
     urlNode.classList.add("hud-clickable");
     urlNode.classList.add("webconsole-msg-body-piece");
     urlNode.classList.add("webconsole-msg-url");
     linkNode.appendChild(urlNode);
 
-    let statusNode = chromeDocument.createElementNS(XUL_NS, "xul:label");
+    let statusNode = chromeDocument.createElementNS(XUL_NS, "label");
     statusNode.setAttribute("value", "");
     statusNode.classList.add("hud-clickable");
     statusNode.classList.add("webconsole-msg-body-piece");
     statusNode.classList.add("webconsole-msg-status");
     linkNode.appendChild(statusNode);
 
     let clipboardText = aActivityObject.method + " " + aActivityObject.url;
 
@@ -3035,17 +3035,17 @@ HeadsUpDisplay.prototype = {
     return this.chromeDocument.getElementById("mainPopupSet");
   },
 
   /**
    * Get the tab associated to the HeadsUpDisplay object.
    */
   get tab()
   {
-    // TODO: we should only keep a reference to the xul:tab object and use
+    // TODO: we should only keep a reference to the tab object and use
     // getters to determine the rest of objects we need - the chrome window,
     // document, etc. We should simplify the entire code to use only a single
     // tab object ref. See bug 656231.
     let tab = null;
     let id = this.notificationBox.id;
     Array.some(this.chromeDocument.defaultView.gBrowser.tabs, function(aTab) {
       if (aTab.linkedPanel == id) {
         tab = aTab;
@@ -3131,63 +3131,56 @@ HeadsUpDisplay.prototype = {
 
       if (this.jsterm) {
         this.jsterm.inputNode.focus();
       }
     }).bind(this);
 
     panel.addEventListener("popupshown", onPopupShown,false);
 
-    let onPopupHiding = (function HUD_onPopupHiding(aEvent) {
+    let onPopupHidden = (function HUD_onPopupHidden(aEvent) {
       if (aEvent.target != panel) {
         return;
       }
 
-      panel.removeEventListener("popuphiding", onPopupHiding, false);
+      panel.removeEventListener("popuphidden", onPopupHidden, false);
+      if (panel.parentNode) {
+        panel.parentNode.removeChild(panel);
+      }
 
       let width = 0;
       try {
         width = Services.prefs.getIntPref("devtools.webconsole.width");
       }
       catch (ex) { }
 
-      if (width > -1) {
+      if (width > 0) {
         Services.prefs.setIntPref("devtools.webconsole.width", panel.clientWidth);
       }
 
-      Services.prefs.setIntPref("devtools.webconsole.top", panel.popupBoxObject.y);
-      Services.prefs.setIntPref("devtools.webconsole.left", panel.popupBoxObject.x);
+      /*
+       * Removed because of bug 674562
+       * Services.prefs.setIntPref("devtools.webconsole.top", panel.panelBox.y);
+       * Services.prefs.setIntPref("devtools.webconsole.left", panel.panelBox.x);
+       */
 
       // Make sure we are not going to close again, drop the hudId reference of
       // the panel.
       panel.removeAttribute("hudId");
 
       if (this.consoleWindowUnregisterOnHide) {
         HUDService.deactivateHUDForContext(this.tab, false);
       }
       else {
         this.consoleWindowUnregisterOnHide = true;
       }
 
       this.consolePanel = null;
     }).bind(this);
 
-    panel.addEventListener("popuphiding", onPopupHiding, false);
-
-    let onPopupHidden = (function HUD_onPopupHidden(aEvent) {
-      if (aEvent.target != panel) {
-        return;
-      }
-
-      panel.removeEventListener("popuphidden", onPopupHidden, false);
-      if (panel.parentNode) {
-        panel.parentNode.removeChild(panel);
-      }
-    }).bind(this);
-
     panel.addEventListener("popuphidden", onPopupHidden, false);
 
     let lastIndex = -1;
 
     if (this.outputNode.getIndexOfFirstVisibleRow) {
       lastIndex = this.outputNode.getIndexOfFirstVisibleRow() +
                   this.outputNode.getNumberOfVisibleRows() - 1;
     }
@@ -3244,20 +3237,24 @@ HeadsUpDisplay.prototype = {
   consoleWindowUnregisterOnHide: true,
 
   /**
    * Re-position the console
    */
   positionConsole: function HUD_positionConsole(aPosition)
   {
     if (!(aPosition in this.positions)) {
-      throw new Error("Incorrect argument: " + aPosition  + ". Cannot position Web Console");
+      throw new Error("Incorrect argument: " + aPosition +
+        ". Cannot position Web Console");
     }
 
     if (aPosition == "window") {
+      let closeButton = this.consoleFilterToolbar.
+        querySelector(".webconsole-close-button");
+      closeButton.setAttribute("hidden", "true");
       this.createOwnWindowPanel();
       this.positionMenuitems.window.setAttribute("checked", true);
       if (this.positionMenuitems.last) {
         this.positionMenuitems.last.setAttribute("checked", false);
       }
       this.positionMenuitems.last = this.positionMenuitems[aPosition];
       this.uiInOwnWindow = true;
       return;
@@ -3303,16 +3300,20 @@ HeadsUpDisplay.prototype = {
     this.positionMenuitems.last = this.positionMenuitems[aPosition];
 
     Services.prefs.setCharPref("devtools.webconsole.position", aPosition);
 
     if (lastIndex > -1 && lastIndex < this.outputNode.getRowCount()) {
       this.outputNode.ensureIndexIsVisible(lastIndex);
     }
 
+    let closeButton = this.consoleFilterToolbar.
+      getElementsByClassName("webconsole-close-button")[0];
+    closeButton.removeAttribute("hidden");
+
     this.uiInOwnWindow = false;
     if (this.consolePanel) {
       this.HUDBox.removeAttribute("flex");
       this.HUDBox.removeAttribute("height");
       this.HUDBox.style.height = height + "px";
 
       // must destroy the consolePanel
       this.consoleWindowUnregisterOnHide = false;
@@ -3579,17 +3580,17 @@ HeadsUpDisplay.prototype = {
 
     return toolbar;
   },
 
   /**
    * Creates the UI for re-positioning the console
    *
    * @return nsIDOMNode
-   *         The xul:toolbarbutton which holds the menu that allows the user to
+   *         The toolbarbutton which holds the menu that allows the user to
    *         change the console position.
    */
   createPositionUI: function HUD_createPositionUI()
   {
     let self = this;
 
     let button = this.makeXULNode("toolbarbutton");
     button.setAttribute("type", "menu");
@@ -5391,69 +5392,69 @@ ConsoleUtils = {
     if (aBody instanceof Ci.nsIDOMNode && aClipboardText == null) {
       throw new Error("HUDService.createMessageNode(): DOM node supplied " +
                       "without any clipboard text");
     }
 
     // Make the icon container, which is a vertical box. Its purpose is to
     // ensure that the icon stays anchored at the top of the message even for
     // long multi-line messages.
-    let iconContainer = aDocument.createElementNS(XUL_NS, "xul:vbox");
+    let iconContainer = aDocument.createElementNS(XUL_NS, "vbox");
     iconContainer.classList.add("webconsole-msg-icon-container");
 
     // Make the icon node. It's sprited and the actual region of the image is
     // determined by CSS rules.
-    let iconNode = aDocument.createElementNS(XUL_NS, "xul:image");
+    let iconNode = aDocument.createElementNS(XUL_NS, "image");
     iconNode.classList.add("webconsole-msg-icon");
     iconContainer.appendChild(iconNode);
 
     // Make the spacer that positions the icon.
-    let spacer = aDocument.createElementNS(XUL_NS, "xul:spacer");
+    let spacer = aDocument.createElementNS(XUL_NS, "spacer");
     spacer.setAttribute("flex", "1");
     iconContainer.appendChild(spacer);
 
     // Create the message body, which contains the actual text of the message.
-    let bodyNode = aDocument.createElementNS(XUL_NS, "xul:description");
+    let bodyNode = aDocument.createElementNS(XUL_NS, "description");
     bodyNode.setAttribute("flex", "1");
     bodyNode.classList.add("webconsole-msg-body");
 
     // If a string was supplied for the body, turn it into a DOM node and an
     // associated clipboard string now.
     aClipboardText = aClipboardText ||
                      (aBody + (aSourceURL ? " @ " + aSourceURL : "") +
                               (aSourceLine ? ":" + aSourceLine : ""));
     aBody = aBody instanceof Ci.nsIDOMNode ?
             aBody : aDocument.createTextNode(aBody);
 
     bodyNode.appendChild(aBody);
 
-    let repeatContainer = aDocument.createElementNS(XUL_NS, "xul:hbox");
+    let repeatContainer = aDocument.createElementNS(XUL_NS, "hbox");
     repeatContainer.setAttribute("align", "start");
-    let repeatNode = aDocument.createElementNS(XUL_NS, "xul:label");
+    let repeatNode = aDocument.createElementNS(XUL_NS, "label");
     repeatNode.setAttribute("value", "1");
     repeatNode.classList.add("webconsole-msg-repeat");
     repeatContainer.appendChild(repeatNode);
 
     // Create the timestamp.
-    let timestampNode = aDocument.createElementNS(XUL_NS, "xul:label");
+    let timestampNode = aDocument.createElementNS(XUL_NS, "label");
     timestampNode.classList.add("webconsole-timestamp");
     let timestamp = ConsoleUtils.timestamp();
     let timestampString = ConsoleUtils.timestampString(timestamp);
     timestampNode.setAttribute("value", timestampString);
 
     // Create the source location (e.g. www.example.com:6) that sits on the
     // right side of the message, if applicable.
     let locationNode;
     if (aSourceURL) {
       locationNode = this.createLocationNode(aDocument, aSourceURL,
                                              aSourceLine);
     }
 
     // Create the containing node and append all its elements to it.
-    let node = aDocument.createElementNS(XUL_NS, "xul:richlistitem");
+    let node = aDocument.createElementNS(XUL_NS, "richlistitem");
     node.clipboardText = aClipboardText;
     node.classList.add("hud-msg-node");
 
     node.timestamp = timestamp;
     ConsoleUtils.setMessageType(node, aCategory, aSeverity);
 
     node.appendChild(timestampNode);  // childNode[0]
     node.appendChild(iconContainer);  // childNode[1]
@@ -5518,17 +5519,17 @@ ConsoleUtils = {
    *        The line number on which the error occurred. If zero or omitted,
    *        there is no line number associated with this message.
    * @return nsIDOMNode
    *         The new XUL label node, ready to be added to the message node.
    */
   createLocationNode:
   function ConsoleUtils_createLocationNode(aDocument, aSourceURL,
                                            aSourceLine) {
-    let locationNode = aDocument.createElementNS(XUL_NS, "xul:label");
+    let locationNode = aDocument.createElementNS(XUL_NS, "label");
 
     // Create the text, which consists of an abbreviated version of the URL
     // plus an optional line number.
     let text = ConsoleUtils.abbreviateSourceURL(aSourceURL);
     if (aSourceLine) {
       text += ":" + aSourceLine;
     }
     locationNode.setAttribute("value", text);
@@ -5657,17 +5658,17 @@ ConsoleUtils = {
    *        The outputNode of the HUD.
    * @return boolean
    *         true if the message is filtered, false otherwise.
    */
   filterRepeatedConsole:
   function ConsoleUtils_filterRepeatedConsole(aNode, aOutput) {
     let lastMessage = aOutput.lastChild;
 
-    // childNodes[2] is the xul:description element
+    // childNodes[2] is the description element
     if (lastMessage &&
         aNode.childNodes[2].textContent ==
         lastMessage.childNodes[2].textContent) {
       this.mergeFilteredMessageNode(lastMessage, aNode);
       return true;
     }
 
     return false;
rename from toolkit/components/console/hudservice/Makefile.in
rename to browser/devtools/webconsole/Makefile.in
--- a/toolkit/components/console/hudservice/Makefile.in
+++ b/browser/devtools/webconsole/Makefile.in
@@ -16,43 +16,45 @@
 #
 # The Initial Developer of the Original Code is Mozilla Corporation.
 # 
 # Portions created by the Initial Developer are Copyright (C) 2010
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   David Dahl <ddahl@mozilla.com>
+#   Rob Campbell <rcampbell@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
-DEPTH		= ../../../..
+DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-EXTRA_JS_MODULES = HUDService.jsm \
+EXTRA_JS_MODULES = \
+		HUDService.jsm \
 		PropertyPanel.jsm \
 		NetworkHelper.jsm \
 		AutocompletePopup.jsm \
 		$(NULL)
 
 ifdef ENABLE_TESTS
 ifneq (mobile,$(MOZ_BUILD_APP))
-	DIRS += tests
+	DIRS += test
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
rename from toolkit/components/console/hudservice/NetworkHelper.jsm
rename to browser/devtools/webconsole/NetworkHelper.jsm
rename from toolkit/components/console/hudservice/NetworkPanel.xhtml
rename to browser/devtools/webconsole/NetworkPanel.xhtml
rename from toolkit/components/console/hudservice/PropertyPanel.jsm
rename to browser/devtools/webconsole/PropertyPanel.jsm
rename from toolkit/components/console/hudservice/tests/Makefile.in
rename to browser/devtools/webconsole/test/Makefile.in
--- a/toolkit/components/console/hudservice/tests/Makefile.in
+++ b/browser/devtools/webconsole/test/Makefile.in
@@ -31,20 +31,18 @@
 # use your version of this file under the terms of the MPL, indicate your
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
-DEPTH		= ../../../../..
+DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-MODULE		= test_hudservice
-
 DIRS = browser
 
 include $(topsrcdir)/config/rules.mk
rename from toolkit/components/console/hudservice/tests/browser/Makefile.in
rename to browser/devtools/webconsole/test/browser/Makefile.in
--- a/toolkit/components/console/hudservice/tests/browser/Makefile.in
+++ b/browser/devtools/webconsole/test/browser/Makefile.in
@@ -16,36 +16,37 @@
 # The Initial Developer of the Original Code is Mozilla Foundation.
 # Portions created by the Initial Developer are Copyright (C) 2010
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #  David Dahl <ddahl@mozilla.com>
 #  Patrick Walton <pcwalton@mozilla.com>
 #  Mihai Șucan <mihai.sucan@gmail.com>
+#  Rob Campbell <rcampbell@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either of the GNU General Public License Version 2 or later (the "GPL"),
 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
-DEPTH			= ../../../../../..
+DEPTH			= ../../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH			= @srcdir@
-relativesrcdir  = toolkit/components/console/hudservice/tests/browser
+relativesrcdir  = browser/devtools/webconsole/test/browser
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_TEST_FILES = \
 	browser_webconsole_notifications.js \
 	browser_webconsole_message_node_id.js \
 	browser_webconsole_bug_580030_errors_after_page_reload.js \
rename from toolkit/components/console/hudservice/tests/browser/browser_warn_user_about_replaced_api.js
rename to browser/devtools/webconsole/test/browser/browser_warn_user_about_replaced_api.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_warn_user_about_replaced_api.js
+++ b/browser/devtools/webconsole/test/browser/browser_warn_user_about_replaced_api.js
@@ -32,17 +32,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_REPLACED_API_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console-replaced-api.html";
+const TEST_REPLACED_API_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console-replaced-api.html";
 
 function test() {
   waitForExplicitFinish();
 
   // First test that the warning does not appear on a normal page (about:blank)
   addTab("about:blank");
   browser.addEventListener("load", function() {
     browser.removeEventListener("load", arguments.callee, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_abbreviate_source_url.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_abbreviate_source_url.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_basic_net_logging.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_basic_net_logging.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_basic_net_logging.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_basic_net_logging.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the page's resources are displayed in the console as they're
 // loaded
 
-const TEST_NETWORK_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-network.html" + "?_date=" + Date.now();
+const TEST_NETWORK_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-network.html" + "?_date=" + Date.now();
 
 function test() {
   addTab("data:text/html,Web Console basic network logging test");
   browser.addEventListener("load", onLoad, true);
 }
 
 function onLoad(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_578437_page_reload.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_578437_page_reload.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_578437_page_reload.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_578437_page_reload.js
@@ -34,17 +34,17 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the console object still exists after a page reload.
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_579412_input_focus.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_579412_input_focus.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_579412_input_focus.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_579412_input_focus.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the input field is focused when the console is opened.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testInputFocus, false);
 }
 
 function testInputFocus() {
   browser.removeEventListener("DOMContentLoaded", testInputFocus, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580001_closing_after_completion.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_580001_closing_after_completion.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580001_closing_after_completion.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580001_closing_after_completion.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests to ensure that errors don't appear when the console is closed while a
 // completion is being performed.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testClosingAfterCompletion,
                            false);
 }
 
 function testClosingAfterCompletion() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that errors still show up in the Web Console after a page reload.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-error.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", onLoad, true);
 }
 
 // see bug 580030: the error handler fails silently after page reload.
 // https://bugzilla.mozilla.org/show_bug.cgi?id=580030
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580400_groups.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_580400_groups.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580400_groups.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580400_groups.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that console groups behave properly.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testGroups, false);
 }
 
 function testGroups() {
   browser.removeEventListener("DOMContentLoaded", testGroups, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580454_timestamp_l10n.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_580454_timestamp_l10n.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580454_timestamp_l10n.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580454_timestamp_l10n.js
@@ -7,17 +7,17 @@
  *  Patrick Walton <pcwalton@mozilla.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that appropriately-localized timestamps are printed.
 
 Cu.import("resource:///modules/HUDService.jsm");
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testTimestamp, false);
 
   function testTimestamp()
   {
     browser.removeEventListener("DOMContentLoaded", testTimestamp, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_581231_close_button.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_581231_close_button.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_581231_close_button.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_581231_close_button.js
@@ -5,17 +5,17 @@
  *
  * Contributor(s):
  *  Patrick Walton <pcwalton@mozilla.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the Web Console close button functions.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testCloseButton, false);
 }
 
 function testCloseButton() {
   browser.removeEventListener("DOMContentLoaded", testCloseButton, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_582201_duplicate_errors.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_582201_duplicate_errors.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_582201_duplicate_errors.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_582201_duplicate_errors.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that exceptions thrown by content don't show up twice in the Web
 // Console.
 
-const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-duplicate-error.html";
+const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-duplicate-error.html";
 
 function test() {
   addTab(TEST_DUPLICATE_ERROR_URI);
   browser.addEventListener("DOMContentLoaded", testDuplicateErrors, false);
 }
 
 function testDuplicateErrors() {
   browser.removeEventListener("DOMContentLoaded", testDuplicateErrors,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_583816_tab_focus.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_583816_tab_focus.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_583816_tab_focus.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_583816_tab_focus.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 let HUD, inputNode;
 
 function tabLoad(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   waitForFocus(function() {
     openConsole();
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585237_line_limit.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_585237_line_limit.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585237_line_limit.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_585237_line_limit.js
@@ -7,17 +7,17 @@
  *  Patrick Walton <pcwalton@mozilla.com>
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the Web Console limits the number of lines displayed according to
 // the user's preferences.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testLineLimit,
                                             false);
 }
 
 function testLineLimit() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585956_console_trace.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_585956_console_trace.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585956_console_trace.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_585956_console_trace.js
@@ -31,17 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-585956-console-trace.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-585956-console-trace.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded() {
   browser.removeEventListener("load", tabLoaded, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585991_autocomplete_keys.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_keys.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_585991_autocomplete_popup.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_popup.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_586388_select_all.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_586388_select_all.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_587617_output_copy.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_587617_output_copy.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_587617_output_copy.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_587617_output_copy.js
@@ -3,17 +3,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *  Patrick Walton <pcwalton@mozilla.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded() {
   browser.removeEventListener("load", tabLoaded, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588342_document_focus.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_588342_document_focus.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588730_text_node_insertion.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_588730_text_node_insertion.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588730_text_node_insertion.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_588730_text_node_insertion.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that adding text to one of the output labels doesn't cause errors.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testTextNodeInsertion,
                            false);
 }
 
 // Test for bug 588730: Adding a text node to an existing label element causes
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588967_input_expansion.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_588967_input_expansion.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_588967_input_expansion.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_588967_input_expansion.js
@@ -31,17 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testInputExpansion, false);
 }
 
 function testInputExpansion() {
   browser.removeEventListener("DOMContentLoaded", testInputExpansion, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_589162_css_filter.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_589162_css_filter.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_592442_closing_brackets.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_592442_closing_brackets.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
@@ -31,21 +31,21 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud.html";
 
-const TEST_IFRAME_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud-iframe.html";
+const TEST_IFRAME_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud-iframe.html";
 
-const TEST_DUMMY_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_DUMMY_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 let tab1, tab2;
 
 function test() {
   addTab(TEST_URI);
   tab1 = tab;
   browser.addEventListener("load", tab1Loaded, true);
 }
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_594477_clickable_output.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_594477_clickable_output.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_594477_clickable_output.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_594477_clickable_output.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 let HUD;
 
 let outputItem;
 
 function tabLoad1(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   openConsole();
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_594497_history_arrow_keys.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_594497_history_arrow_keys.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595223_file_uri.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_595223_file_uri.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TESTS_PATH = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/";
+const TESTS_PATH = "http://example.com/browser/browser/devtools/webconsole/test//browser/";
 const TESTS = [
   { // #0
     file: "test-bug-595934-css-loader.html",
     category: "CSS Loader",
     matchString: "text/css",
   },
   { // #1
     file: "test-bug-595934-dom-events.html",
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 let tab1, tab2, win1, win2;
 let noErrors = true;
 
 function tab1Loaded(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   win2 = OpenBrowserWindow();
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597136_external_script_errors.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_external_script_errors.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597136_external_script_errors.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_external_script_errors.js
@@ -3,18 +3,18 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Patrick Walton <pcwalton@mozilla.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/" +
-                 "hudservice/tests/browser/test-bug-597136-external-script-" +
+const TEST_URI = "http://example.com/browser/browser/devtools/" +
+                 "webconsole/test/browser/test-bug-597136-external-script-" +
                  "errors.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded(aEvent) {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597136_network_requests_from_chrome.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_network_requests_from_chrome.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597460_filter_scroll.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_597460_filter_scroll.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597460_filter_scroll.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597460_filter_scroll.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-network.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-network.html";
 
 function tabLoad(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   openConsole();
 
   let hudId = HUDService.getHudIdByWindow(content);
   hud = HUDService.hudReferences[hudId];
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-597756-reopen-closed-tab.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-597756-reopen-closed-tab.html";
 
 let newTabIsOpen = false;
 
 function tabLoaded(aEvent) {
   gBrowser.selectedBrowser.removeEventListener(aEvent.type, arguments.callee, true);
 
   HUDService.activateHUDForContext(gBrowser.selectedTab);
 
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_598357_jsterm_output.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_598357_jsterm_output.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_598357_jsterm_output.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_598357_jsterm_output.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 let testEnded = false;
 let pos = -1;
 
 let dateNow = Date.now();
 
 let inputValues = [
   // [showsPropertyPanel?, input value, expected output format,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_599725_response_headers.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_599725_response_headers.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_599725_response_headers.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_599725_response_headers.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-599725-response-headers.sjs";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-599725-response-headers.sjs";
 
 let lastFinishedRequest = null;
 
 function requestDoneCallback(aHttpRequest)
 {
   lastFinishedRequest = aHttpRequest;
 }
 
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_600183_charset.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_600183_charset.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_600183_charset.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_600183_charset.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-600183-charset.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-600183-charset.html";
 
 let lastFinishedRequest = null;
 
 function requestDoneCallback(aHttpRequest)
 {
   lastFinishedRequest = aHttpRequest;
 }
 
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601177_log_levels.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_601177_log_levels.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601177_log_levels.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_601177_log_levels.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-601177-log-levels.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-601177-log-levels.html";
 
 let msgs;
 
 function onContentLoaded()
 {
   let hudId = HUDService.getHudIdByWindow(content);
   let HUD = HUDService.hudReferences[hudId];
   msgs = HUD.outputNode.querySelectorAll(".hud-msg-node");
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601352_scroll.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_601352_scroll.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601667_filter_buttons.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_601667_filter_buttons.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_601909_remember_height.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_601909_remember_height.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_602572_log_bodies_checkbox.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_602572_log_bodies_checkbox.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_603750_websocket.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_603750_websocket.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_603750_websocket.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_603750_websocket.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-603750-websocket.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-603750-websocket.html";
 const pref_ws = "network.websocket.enabled";
 const pref_block = "network.websocket.override-security-block";
 
 let errors = 0;
 let lastWindowId = 0;
 let oldPref_ws;
 
 let TestObserver = {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_611795.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_611795.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613013_console_api_iframe.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_613013_console_api_iframe.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613013_console_api_iframe.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_613013_console_api_iframe.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-613013-console-api-iframe.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-613013-console-api-iframe.html";
 
 let TestObserver = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
   observe: function test_observe(aMessage, aTopic, aData)
   {
     if (aTopic == "console-api-log-event") {
       executeSoon(performTest);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613280_jsterm_copy.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_613280_jsterm_copy.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613642_maintain_scroll.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_maintain_scroll.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_613642_prune_scroll.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_prune_scroll.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_614793_jsterm_scroll.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_614793_jsterm_scroll.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618078_network_exceptions.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_618078_network_exceptions.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618078_network_exceptions.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_618078_network_exceptions.js
@@ -21,17 +21,17 @@
  *
  * Contributor(s):
  *   Mihai Sucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that network log messages bring up the network panel.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-618078-network-exceptions.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-618078-network-exceptions.html";
 
 let testEnded = false;
 
 let TestObserver = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
   observe: function test_observe(aSubject)
   {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618311_close_panels.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_close_panels.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618311_close_panels.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_close_panels.js
@@ -31,17 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", function() {
     browser.removeEventListener("load", arguments.callee, true);
 
     openConsole();
     content.location.reload();
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618311_private_browsing.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_private_browsing.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_618311_private_browsing.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_private_browsing.js
@@ -31,17 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 let pb = Cc["@mozilla.org/privatebrowsing;1"].
          getService(Ci.nsIPrivateBrowsingService);
 
 function test() {
   addTab("data:text/html,Web Console test for bug 618311 (private browsing)");
 
   browser.addEventListener("load", function() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_621644_jsterm_dollar.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_621644_jsterm_dollar.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_621644_jsterm_dollar.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_621644_jsterm_dollar.js
@@ -2,17 +2,17 @@
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *   Mihai Sucan <mihai.sucan@gmail.com>
  */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-621644-jsterm-dollar.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-621644-jsterm-dollar.html";
 
 function tabLoad(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   waitForFocus(function () {
     openConsole();
 
     let hudId = HUDService.getHudIdByWindow(content);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_626484_output_copy_order.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_626484_output_copy_order.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_630733_response_redirect_headers.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_630733_response_redirect_headers.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_630733_response_redirect_headers.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_630733_response_redirect_headers.js
@@ -2,17 +2,17 @@
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *   Mihai Sucan <mihai.sucan@gmail.com>
  */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-630733-response-redirect-headers.sjs";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-630733-response-redirect-headers.sjs";
 
 let lastFinishedRequests = {};
 
 function requestDoneCallback(aHttpRequest)
 {
   let status = aHttpRequest.response.status.
                replace(/^HTTP\/\d\.\d (\d+).+$/, "$1");
   lastFinishedRequests[status] = aHttpRequest;
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632275_getters_document_width.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_632275_getters_document_width.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632275_getters_document_width.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_632275_getters_document_width.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-632275-getters.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-632275-getters.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded() {
   browser.removeEventListener("load", tabLoaded, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_632347_iterators_generators.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_632347_iterators_generators.js
@@ -31,17 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-632347-iterators-generators.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-632347-iterators-generators.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded() {
   browser.removeEventListener("load", tabLoaded, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632817.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_632817.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632817.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_632817.js
@@ -1,17 +1,17 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that network log messages bring up the network panel.
 
-const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-network-request.html";
+const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-network-request.html";
 
-const TEST_IMG = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-image.png";
+const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-image.png";
 
 const TEST_DATA_JSON_CONTENT =
   '{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] }';
 
 let lastRequest = null;
 let requestCallback = null;
 
 function test()
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642108_pruneTest.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_642108_pruneTest.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642615_autocomplete.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_642615_autocomplete.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_644419_log_limits.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_644419_log_limits.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_644419_log_limits.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_644419_log_limits.js
@@ -2,18 +2,18 @@
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests that the Web Console limits the number of lines displayed according to
 // the limit set for each category.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/" +
-                 "hudservice/tests/browser/test-bug-644419-log-limits.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/" +
+                 "webconsole/test/browser/test-bug-644419-log-limits.html";
 
 var gOldPref, gHudId;
 
 function test() {
   addTab("data:text/html,Web Console test for bug 644419: Console should " +
          "have user-settable log limits for each message category");
   browser.addEventListener("load", onLoad, true);
 }
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_646025_console_file_location.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_646025_console_file_location.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_646025_console_file_location.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_646025_console_file_location.js
@@ -37,18 +37,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that console logging methods display the method location along with
 // the output in the console.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/" +
-                 "hudservice/tests/browser/" +
+const TEST_URI = "http://example.com/browser/browser/devtools/" +
+                 "webconsole/test/browser/" +
                  "test-bug-646025-console-file-location.html";
 
 function test() {
   addTab("data:text/html,Web Console file location display test");
   browser.addEventListener("load", onLoad, true);
 }
 
 function onLoad(aEvent) {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_651501_document_body_autocomplete.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_651501_document_body_autocomplete.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_660806_history_nav.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_660806_history_nav.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_663443_panel_title.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_bug_663443_panel_title.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_663443_panel_title.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_663443_panel_title.js
@@ -1,43 +1,48 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html,<p>test for bug 663443. test1";
 
 const POSITION_PREF = "devtools.webconsole.position";
+const POSITION_ABOVE = "above"; // default
+const POSITION_WINDOW = "window";
 
 function tabLoad(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
-  Services.prefs.setCharPref(POSITION_PREF, "window");
+  Services.prefs.setCharPref(POSITION_PREF, POSITION_WINDOW);
 
   openConsole();
 
-  document.addEventListener("popupshown", function() {
-    document.removeEventListener("popupshown", arguments.callee, false);
+  document.addEventListener("popupshown", function popupShown() {
+    document.removeEventListener("popupshown", popupShown, false);
 
     let hudId = HUDService.getHudIdByWindow(content);
+
     ok(hudId, "Web Console is open");
 
     let HUD = HUDService.hudReferences[hudId];
     ok(HUD.consolePanel, "Web Console opened in a panel");
 
     isnot(HUD.consolePanel.label.indexOf("test1"), -1, "panel title is correct");
 
     browser.addEventListener("load", function() {
       browser.removeEventListener("load", arguments.callee, true);
 
       isnot(HUD.consolePanel.label.indexOf("test2"), -1,
             "panel title is correct after page navigation");
 
-      Services.prefs.clearUserPref(POSITION_PREF);
+      HUD.positionConsole(POSITION_ABOVE);
 
-      executeSoon(finish);
+      closeConsole();
+
+      executeSoon(finishTest);
     }, true);
 
     content.location = "data:text/html,<p>test2 for bug 663443";
   }, false);
 }
 
 function test() {
   addTab(TEST_URI);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_chrome.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_chrome.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_completion.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_completion.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_completion.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_completion.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that code completion works properly.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testCompletion, false);
 }
 
 function testCompletion() {
   browser.removeEventListener("DOMContentLoaded", testCompletion, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_console_extras.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_console_extras.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_console_extras.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_console_extras.js
@@ -32,17 +32,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the basic console.log()-style APIs and filtering work.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console-extras.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console-extras.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_console_logging_api.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_console_logging_api.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_console_logging_api.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_console_logging_api.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the basic console.log()-style APIs and filtering work.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_consoleonpage.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_consoleonpage.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_consoleonpage.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_consoleonpage.js
@@ -4,17 +4,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Julian Viereck <jviereck@mozilla.com>
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-own-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-own-console.html";
 
 function test()
 {
   addTab(TEST_URI);
   browser.addEventListener("load", function() {
     browser.removeEventListener("load", arguments.callee, true);
     testOpenWebConsole();
   }, true);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_execution_scope.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_execution_scope.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_execution_scope.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_execution_scope.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that commands run by the user are executed in content space.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testExecutionScope, false);
 }
 
 function testExecutionScope() {
   browser.removeEventListener("DOMContentLoaded", testExecutionScope,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_history.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_history.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_history.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_history.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests the console history feature accessed via the up and down arrow keys.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 // Constants used for defining the direction of JSTerm input history navigation.
 const HISTORY_BACK = -1;
 const HISTORY_FORWARD = 1;
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testHistory, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_hud_getters.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_hud_getters.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_hud_getters.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_hud_getters.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the HUD can be accessed via the HUD references in the HUD
 // service.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testHUDGetters, false);
 }
 
 function testHUDGetters() {
   browser.removeEventListener("DOMContentLoaded", testHUDGetters, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_js_input_and_output_styling.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_js_input_and_output_styling.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_js_input_and_output_styling.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_js_input_and_output_styling.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the correct CSS styles are applied to the lines of console
 // output.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testJSInputAndOutputStyling,
                            false);
 }
 
 function testJSInputAndOutputStyling() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_js_input_expansion.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_js_input_expansion.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_js_input_expansion.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_js_input_expansion.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the input box expands as the user types long lines.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testJSInputExpansion, false);
 }
 
 function testJSInputExpansion() {
   browser.removeEventListener("DOMContentLoaded", testJSInputExpansion,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_jsterm.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_jsterm.js
@@ -34,17 +34,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 let jsterm;
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testJSTerm, false);
 }
 
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_live_filtering_of_message_types.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_of_message_types.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_live_filtering_of_message_types.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_of_message_types.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the message type filter checkboxes work.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded",
                               testLiveFilteringOfMessageTypes, false);
 }
 
 function testLiveFilteringOfMessageTypes() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_live_filtering_on_search_strings.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_on_search_strings.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_live_filtering_on_search_strings.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_on_search_strings.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the text filter box works.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded",
                            testLiveFilteringOnSearchStrings, false);
 }
 
 function testLiveFilteringOnSearchStrings() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_log_node_classes.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_log_node_classes.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_log_node_classes.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_log_node_classes.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that console logging via the console API produces nodes of the correct
 // CSS classes.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testLogNodeClasses, false);
 }
 
 function testLogNodeClasses() {
   browser.removeEventListener("DOMContentLoaded", testLogNodeClasses,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_message_node_id.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_message_node_id.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_message_node_id.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_message_node_id.js
@@ -30,17 +30,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_netlogging.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_netlogging.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_netlogging.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_netlogging.js
@@ -7,19 +7,19 @@
  *  Julian Viereck <jviereck@mozilla.com>
  *  Patrick Walton <pcwalton@mozilla.com>
  *  Mihai Șucan <mihai.sucan@gmail.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that network log messages bring up the network panel.
 
-const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-network-request.html";
+const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-network-request.html";
 
-const TEST_IMG = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-image.png";
+const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-image.png";
 
 const TEST_DATA_JSON_CONTENT =
   '{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] }';
 
 let lastRequest = null;
 let requestCallback = null;
 
 function test()
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_network_panel.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_network_panel.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_network_panel.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_network_panel.js
@@ -36,19 +36,19 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the network panel works.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
-const TEST_IMG = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-image.png";
-const TEST_ENCODING_ISO_8859_1 = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-encoding-ISO-8859-1.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-image.png";
+const TEST_ENCODING_ISO_8859_1 = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-encoding-ISO-8859-1.html";
 
 let testDriver;
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testNetworkPanel, false);
 }
 
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_notifications.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_notifications.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_notifications.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_notifications.js
@@ -30,17 +30,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   observer.init();
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function webConsoleCreated(aID)
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_null_and_undefined_output.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_null_and_undefined_output.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_null_and_undefined_output.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_null_and_undefined_output.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test that JavaScript expressions that evaluate to null or undefined produce
 // meaningful output.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testNullAndUndefinedOutput,
                            false);
 }
 
 function testNullAndUndefinedOutput() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_output_order.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_output_order.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_output_order.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_output_order.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that any output created from calls to the console API comes after the
 // echoed JavaScript.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testOutputOrder, false);
 }
 
 function testOutputOrder() {
   browser.removeEventListener("DOMContentLoaded", testOutputOrder, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_position_ui.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_position_ui.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_position_ui.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_position_ui.js
@@ -46,32 +46,34 @@ function onLoad() {
   let id = hudBox.parentNode.childNodes[2].getAttribute("id");
   is(id, hudId, "below position is correct");
 
   is(hudRef.positionMenuitems.below.getAttribute("checked"), "true",
      "position menu checkbox is below");
   is(Services.prefs.getCharPref(POSITION_PREF), "below", "pref is below");
 
   // listen for the panel popupshown event.
-  document.addEventListener("popupshown", function() {
-    document.removeEventListener("popupshown", arguments.callee, false);
+  document.addEventListener("popupshown", function popupShown() {
+    document.removeEventListener("popupshown", popupShown, false);
 
-    document.addEventListener("popuphidden", function() {
-      document.removeEventListener("popuphidden", arguments.callee, false);
+    document.addEventListener("popuphidden", function popupHidden() {
+      document.removeEventListener("popuphidden", popupHidden, false);
 
       id = hudBox.parentNode.childNodes[2].getAttribute("id");
       is(id, hudId, "below position is correct after reopen");
 
       diffHeight = Math.abs(hudBox.clientHeight - boxHeight);
       ok(diffHeight < 3, "hudBox height is still correct");
 
       is(Services.prefs.getCharPref(POSITION_PREF), "below", "pref is below");
-      is(Services.prefs.getIntPref(WIDTH_PREF), panelWidth, "width pref updated");
-      isnot(Services.prefs.getIntPref(TOP_PREF), 50, "top location pref updated");
-      isnot(Services.prefs.getIntPref(LEFT_PREF), 51, "left location pref updated");
+
+      // following three disabled due to bug 674562
+      // is(Services.prefs.getIntPref(WIDTH_PREF), panelWidth, "width pref updated - bug 674562");
+      // isnot(Services.prefs.getIntPref(TOP_PREF), 50, "top location pref updated - bug 674562");
+      // isnot(Services.prefs.getIntPref(LEFT_PREF), 51, "left location pref updated - bug 674562");
 
       // Close the window console via the toolbar button
       let btn = hudBox.querySelector(".webconsole-close-button");
       EventUtils.sendMouseEvent({ type: "click" }, btn);
 
       openConsole();
 
       hudId = HUDService.getHudIdByWindow(content);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_property_panel.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_property_panel.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_property_panel.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_property_panel.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests the functionality of the "property panel", which allows JavaScript
 // objects and DOM nodes to be inspected.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testPropertyPanel, false);
 }
 
 function testPropertyPanel() {
   browser.removeEventListener("DOMContentLoaded", testPropertyPanel, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_property_provider.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_property_provider.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_property_provider.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_property_provider.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests the property provider, which is part of the code completion
 // infrastructure.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testPropertyProvider, false);
 }
 
 function testPropertyProvider() {
   browser.removeEventListener("DOMContentLoaded", testPropertyProvider,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_registries.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_registries.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_registries.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_registries.js
@@ -36,17 +36,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the HUD service keeps an accurate registry of all the Web Console
 // instances.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testRegistries, false);
 }
 
 function testRegistries() {
   browser.removeEventListener("DOMContentLoaded", testRegistries, false);
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_create_display.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_storage_create_display.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_create_display.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_storage_create_display.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the console message store is initialized properly.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testStorageCreateDisplay,
                            false);
 }
 
 function testStorageCreateDisplay() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_iteration.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_storage_iteration.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_iteration.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_storage_iteration.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test that the iterator API of the console message store works.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testStorageIteration, false);
 }
 
 function testStorageIteration() {
   browser.removeEventListener("DOMContentLoaded", testStorageIteration,
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_record_entry.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_storage_record_entry.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_record_entry.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_storage_record_entry.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Tests that the recordEntry() method of the console store works.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testStorageRecordEntry,
                               false);
 }
 
 function testStorageRecordEntry() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_record_many_entries.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_storage_record_many_entries.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_storage_record_many_entries.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_storage_record_many_entries.js
@@ -35,17 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test that the recordManyEntries() method of the console store works.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testStorageRecordManyEntries,
                            false);
 }
 
 function testStorageRecordManyEntries() {
rename from toolkit/components/console/hudservice/tests/browser/browser_webconsole_view_source.js
rename to browser/devtools/webconsole/test/browser/browser_webconsole_view_source.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_view_source.js
+++ b/browser/devtools/webconsole/test/browser/browser_webconsole_view_source.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that source URLs in the Web Console can be clicked to display the
 // standard View Source window.
 
-const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-error.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testViewSource, false);
 }
 
 function testViewSource() {
   browser.removeEventListener("DOMContentLoaded", testViewSource, false);
rename from toolkit/components/console/hudservice/tests/browser/head.js
rename to browser/devtools/webconsole/test/browser/head.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-585956-console-trace.html
rename to browser/devtools/webconsole/test/browser/test-bug-585956-console-trace.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud-iframe.html
rename to browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud-iframe.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud.html
rename to browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud.html
--- a/toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud.html
+++ b/browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud.html
@@ -3,11 +3,11 @@
   <head>
     <title>WebConsole test: iframe associated to the wrong HUD</title>
 <!-- Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/ -->
    </head>
    <body>
      <p>WebConsole test: iframe associated to the wrong HUD.</p>
      <iframe 
-       src="http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud-iframe.html"></iframe>
+       src="http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud-iframe.html"></iframe>
    </body>
  </html>
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas-css.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas-css.js
rename to browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-canvas.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-canvas.js
rename to browser/devtools/webconsole/test/browser/test-bug-595934-canvas.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-loader.css
rename to browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-loader.css^headers^
rename to browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css^headers^
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-loader.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-parser.css
rename to browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.css
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-css-parser.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external2.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events-external2.js
rename to browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-events.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-dom-events.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-html-external.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-html-external.js
rename to browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-dom-html.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-dom-html.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-empty-getelementbyid.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-empty-getelementbyid.js
rename to browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-html.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-html.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-image.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-image.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-image.jpg
rename to browser/devtools/webconsole/test/browser/test-bug-595934-image.jpg
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-imagemap.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-imagemap.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-malformedxml-external.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-malformedxml-external.xml
rename to browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.xml
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-malformedxml.xhtml
rename to browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml.xhtml
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-svg.xhtml
rename to browser/devtools/webconsole/test/browser/test-bug-595934-svg.xhtml
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-workers.html
rename to browser/devtools/webconsole/test/browser/test-bug-595934-workers.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-595934-workers.js
rename to browser/devtools/webconsole/test/browser/test-bug-595934-workers.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-597136-external-script-errors.html
rename to browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-597136-external-script-errors.js
rename to browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-597756-reopen-closed-tab.html
rename to browser/devtools/webconsole/test/browser/test-bug-597756-reopen-closed-tab.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-599725-response-headers.sjs
rename to browser/devtools/webconsole/test/browser/test-bug-599725-response-headers.sjs
rename from toolkit/components/console/hudservice/tests/browser/test-bug-600183-charset.html
rename to browser/devtools/webconsole/test/browser/test-bug-600183-charset.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-600183-charset.html^headers^
rename to browser/devtools/webconsole/test/browser/test-bug-600183-charset.html^headers^
rename from toolkit/components/console/hudservice/tests/browser/test-bug-601177-log-levels.html
rename to browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-601177-log-levels.js
rename to browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-603750-websocket.html
rename to browser/devtools/webconsole/test/browser/test-bug-603750-websocket.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-603750-websocket.js
rename to browser/devtools/webconsole/test/browser/test-bug-603750-websocket.js
rename from toolkit/components/console/hudservice/tests/browser/test-bug-613013-console-api-iframe.html
rename to browser/devtools/webconsole/test/browser/test-bug-613013-console-api-iframe.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-618078-network-exceptions.html
rename to browser/devtools/webconsole/test/browser/test-bug-618078-network-exceptions.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-621644-jsterm-dollar.html
rename to browser/devtools/webconsole/test/browser/test-bug-621644-jsterm-dollar.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-630733-response-redirect-headers.sjs
rename to browser/devtools/webconsole/test/browser/test-bug-630733-response-redirect-headers.sjs
rename from toolkit/components/console/hudservice/tests/browser/test-bug-632275-getters.html
rename to browser/devtools/webconsole/test/browser/test-bug-632275-getters.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-632347-iterators-generators.html
rename to browser/devtools/webconsole/test/browser/test-bug-632347-iterators-generators.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-644419-log-limits.html
rename to browser/devtools/webconsole/test/browser/test-bug-644419-log-limits.html
rename from toolkit/components/console/hudservice/tests/browser/test-bug-646025-console-file-location.html
rename to browser/devtools/webconsole/test/browser/test-bug-646025-console-file-location.html
rename from toolkit/components/console/hudservice/tests/browser/test-console-extras.html
rename to browser/devtools/webconsole/test/browser/test-console-extras.html
rename from toolkit/components/console/hudservice/tests/browser/test-console-replaced-api.html
rename to browser/devtools/webconsole/test/browser/test-console-replaced-api.html
rename from toolkit/components/console/hudservice/tests/browser/test-console.html
rename to browser/devtools/webconsole/test/browser/test-console.html
rename from toolkit/components/console/hudservice/tests/browser/test-data.json
rename to browser/devtools/webconsole/test/browser/test-data.json
rename from toolkit/components/console/hudservice/tests/browser/test-duplicate-error.html
rename to browser/devtools/webconsole/test/browser/test-duplicate-error.html
rename from toolkit/components/console/hudservice/tests/browser/test-encoding-ISO-8859-1.html
rename to browser/devtools/webconsole/test/browser/test-encoding-ISO-8859-1.html
rename from toolkit/components/console/hudservice/tests/browser/test-error.html
rename to browser/devtools/webconsole/test/browser/test-error.html
rename from toolkit/components/console/hudservice/tests/browser/test-file-location.js
rename to browser/devtools/webconsole/test/browser/test-file-location.js
rename from toolkit/components/console/hudservice/tests/browser/test-filter.html
rename to browser/devtools/webconsole/test/browser/test-filter.html
rename from toolkit/components/console/hudservice/tests/browser/test-image.png
rename to browser/devtools/webconsole/test/browser/test-image.png
rename from toolkit/components/console/hudservice/tests/browser/test-mutation.html
rename to browser/devtools/webconsole/test/browser/test-mutation.html
rename from toolkit/components/console/hudservice/tests/browser/test-network-request.html
rename to browser/devtools/webconsole/test/browser/test-network-request.html
--- a/toolkit/components/console/hudservice/tests/browser/test-network-request.html
+++ b/browser/devtools/webconsole/test/browser/test-network-request.html
@@ -22,14 +22,14 @@
         makeXhr('post', 'test-data.json', "Hello world!", aCallback);
       }
     // --></script>
   </head>
   <body>
     <h1>Heads Up Display HTTP Logging Testpage</h1>
     <h2>This page is used to test the HTTP logging.</h2>
 
-    <form action="http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-network-request.html" method="post">
+    <form action="http://example.com/browser/browser/devtools/webconsole/test//browser/test-network-request.html" method="post">
       <input name="name" type="text" value="foo bar"><br>
       <input name="age" type="text" value="144"><br>
     </form>
   </body>
 </html>
rename from toolkit/components/console/hudservice/tests/browser/test-network.html
rename to browser/devtools/webconsole/test/browser/test-network.html
rename from toolkit/components/console/hudservice/tests/browser/test-observe-http-ajax.html
rename to browser/devtools/webconsole/test/browser/test-observe-http-ajax.html
rename from toolkit/components/console/hudservice/tests/browser/test-own-console.html
rename to browser/devtools/webconsole/test/browser/test-own-console.html
rename from toolkit/components/console/hudservice/tests/browser/test-property-provider.html
rename to browser/devtools/webconsole/test/browser/test-property-provider.html
rename from toolkit/components/console/hudservice/tests/browser/testscript.js
rename to browser/devtools/webconsole/test/browser/testscript.js
--- a/configure.in
+++ b/configure.in
@@ -338,17 +338,17 @@ case "$target" in
     elif test "$target" != "arm-android-eabi"; then
        dnl fail if we're not building with NDKr4
        AC_MSG_ERROR([Couldn't find path to stlport in the android ndk])
     fi
 
     CPPFLAGS="-I$android_platform/usr/include $STLPORT_CPPFLAGS $CPPFLAGS"
     CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CXXFLAGS"
-    LIBS="$LIBS $STLPORT_LIBS"
+    LIBS="$LIBS $STLPORT_LIBS -static-libstdc++"
 
     dnl Add -llog by default, since we use it all over the place.
     dnl Add --allow-shlib-undefined, because libGLESv2 links to an
     dnl undefined symbol (present on the hardware, just not in the
     dnl NDK.)
     LDFLAGS="-mandroid $STLPORT_LDFLAGS -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
 
     dnl prevent cross compile section from using these flags as host flags
@@ -7504,72 +7504,64 @@ else
   *-netbsd*)
     AC_DEFINE(MOZ_MEMORY_BSD)
     ;;
   *-solaris*)
     AC_DEFINE(MOZ_MEMORY_SOLARIS)
     ;;
   *-mingw*)
     AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    dnl This is sort of awful. Will revisit if we add support for more versions
+    AC_MSG_CHECKING([for VC2005/2008++ CRT source])
     if test "$CC_VERSION" == "14.00.50727.762" -o "$CC_VERSION" == "15.00.30729.01"; then
-      WIN32_OLD_STYLE_JEMALLOC=1
-      AC_DEFINE(WIN32_OLD_STYLE_JEMALLOC)
-    elif test "$CC_VERSION" == "16.00.30319.01" -o "$CC_VERSION" == "16.00.40219.01"; then
-      WIN32_NEW_STYLE_JEMALLOC=1
-      AC_DEFINE(WIN32_NEW_STYLE_JEMALLOC)
-    else        
-      AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 or 2010 currently.])
-    fi
-    if test -z "$WIN32_CRT_SRC_DIR" -a -n "$WIN32_OLD_STYLE_JEMALLOC"; then
-      if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
-        AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
-      else
+      if test -z "$WIN32_CRT_SRC_DIR" -a -n "$VCINSTALLDIR"; then
         WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
       fi
-    fi
-    dnl cpu check
-    case "${target_cpu}" in
-    i*86)
-      MOZ_CRT_CPU_ARCH=intel
-      ;;
-    x86_64)
-      MOZ_CRT_CPU_ARCH=amd64
-      ;;
-    *)
-      AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
-      ;;
-    esac
-
-    AC_SUBST(MOZ_CRT_CPU_ARCH)
-
-    if test -n "$WIN32_OLD_STYLE_JEMALLOC"; then
-      if test ! -d "$WIN32_CRT_SRC_DIR"; then
-        AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
+      if test -n "$WIN32_CRT_SRC_DIR" -a -d "$WIN32_CRT_SRC_DIR"; then
+        AC_MSG_RESULT([yes])
+        dnl cpu check
+        case "${target_cpu}" in
+        i*86)
+          MOZ_CRT_CPU_ARCH=intel
+          ;;
+        x86_64)
+          MOZ_CRT_CPU_ARCH=amd64
+          ;;
+        *)
+          AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
+          ;;
+        esac
+        AC_SUBST(MOZ_CRT_CPU_ARCH)
+        WIN32_OLD_STYLE_JEMALLOC=1
+        AC_DEFINE(WIN32_OLD_STYLE_JEMALLOC)
+        WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
+        _objdir_win=`pwd -W`
+        WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
+        MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
       fi
-      WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
-      _objdir_win=`pwd -W`
-      WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
-      MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
-    else
+    fi
+    if test -z "$WIN32_OLD_STYLE_JEMALLOC"; then
+      AC_MSG_RESULT([no])
+      WIN32_NEW_STYLE_JEMALLOC=1
+      AC_DEFINE(WIN32_NEW_STYLE_JEMALLOC)
       if test -z "$MOZ_DEBUG"; then
         WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
       else
         WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
       fi
       dnl Look for a broken crtdll.obj
-      WIN32_CRTDLL_FULLPATH=`lib -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
-      lib -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
-      if grep -q '__imp__\{0,1\}free' crtdll.obj; then
+      WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
+      lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
+      if grep -q __imp__\{0,1\}free crtdll.obj; then
         MOZ_MEMORY_LDFLAGS='-MANIFEST:NO -LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
       else
         MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
       fi
       rm crtdll.obj
     fi
+
     dnl Also pass this to NSPR/NSS
     DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
     export DLLFLAGS
     ;;
   *)
     AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
     ;;
   esac
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -92,17 +92,17 @@ NS_MEMORY_REPORTER_IMPLEMENT(WebGLTextur
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLBufferMemoryUsed,
                              "webgl-buffer-memory",
                              KIND_OTHER,
                              UNITS_BYTES,
                              WebGLMemoryReporter::GetBufferMemoryUsed,
                              "Memory used by WebGL buffers. The OpenGL implementation is free to store these buffers in either video memory or main memory. This measurement is only a lower bound, actual memory usage may be higher for example if the storage is strided.")
 
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLBufferCacheMemoryUsed,
-                             "webgl-buffer-cache-memory",
+                             "explicit/webgl/buffer-cache-memory",
                              KIND_HEAP,
                              UNITS_BYTES,
                              WebGLMemoryReporter::GetBufferCacheMemoryUsed,
                              "Memory used by WebGL buffer caches. The WebGL implementation caches the contents of element array buffers only. This adds up with the webgl-buffer-memory value, but contrary to it, this one represents bytes on the heap, not managed by OpenGL.")
 
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLBufferCount,
                              "webgl-buffer-count",
                              KIND_OTHER,
@@ -120,24 +120,24 @@ NS_MEMORY_REPORTER_IMPLEMENT(WebGLRender
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLRenderbufferCount,
                              "webgl-renderbuffer-count",
                              KIND_OTHER,
                              UNITS_COUNT,
                              WebGLMemoryReporter::GetRenderbufferCount,
                              "Number of WebGL renderbuffers.")
 
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLShaderSourcesSize,
-                             "webgl-shader-sources-size",
+                             "explicit/webgl/shader-sources-size",
                              KIND_HEAP,
                              UNITS_BYTES,
                              WebGLMemoryReporter::GetShaderSourcesSize,
                              "Combined size of WebGL shader ASCII sources, cached on the heap. This should always be at most a few kilobytes, or dozen kilobytes for very shader-intensive WebGL demos.")
 
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLShaderTranslationLogsSize,
-                             "webgl-shader-translationlogs-size",
+                             "explicit/webgl/shader-translationlogs-size",
                              KIND_HEAP,
                              UNITS_BYTES,
                              WebGLMemoryReporter::GetShaderTranslationLogsSize,
                              "Combined size of WebGL shader ASCII translation logs, cached on the heap.")
 
 NS_MEMORY_REPORTER_IMPLEMENT(WebGLShaderCount,
                              "webgl-shader-count",
                              KIND_OTHER,
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -4543,16 +4543,20 @@ WebGLContext::TexSubImage2D_base(WebGLen
 
     if (!tex)
         return ErrorInvalidOperation("texSubImage2D: no texture is bound to this target");
 
     size_t face = WebGLTexture::FaceForTarget(target);
     const WebGLTexture::ImageInfo &imageInfo = tex->ImageInfoAt(level, face);
     if (!CanvasUtils::CheckSaneSubrectSize(xoffset, yoffset, width, height, imageInfo.mWidth, imageInfo.mHeight))
         return ErrorInvalidValue("texSubImage2D: subtexture rectangle out of bounds");
+    
+    // Require the format and type in texSubImage2D to match that of the existing texture as created by texImage2D
+    if (imageInfo.mFormat != format || imageInfo.mType != type)
+        return ErrorInvalidOperation("texSubImage2D: format or type doesn't match the existing texture");
 
     MakeContextCurrent();
 
     int dstFormat = GetWebGLTexelFormat(format, type);
     int actualSrcFormat = srcFormat == WebGLTexelFormat::Auto ? dstFormat : srcFormat;
     size_t srcStride = srcStrideOrZero ? srcStrideOrZero : checked_alignedRowSize.value();
 
     size_t dstPlainRowSize = texelSize * width;
--- a/content/canvas/test/webgl/failing_tests_linux.txt
+++ b/content/canvas/test/webgl/failing_tests_linux.txt
@@ -4,15 +4,12 @@ conformance/gl-uniform-bool.html
 conformance/glsl-2types-of-textures-on-same-unit.html
 conformance/glsl-conformance.html
 conformance/invalid-passed-params.html
 conformance/more/conformance/quickCheckAPI.html
 conformance/more/functions/copyTexImage2D.html
 conformance/more/functions/copyTexSubImage2D.html
 conformance/more/functions/deleteBufferBadArgs.html
 conformance/more/functions/texImage2DBadArgs.html
-conformance/more/functions/texSubImage2DBadArgs.html
-conformance/more/functions/texSubImage2DHTMLBadArgs.html
 conformance/more/functions/uniformfArrayLen1.html
 conformance/object-deletion-behaviour.html
 conformance/read-pixels-test.html
-conformance/tex-sub-image-2d-bad-args.html
 conformance/uninitialized-test.html
--- a/content/canvas/test/webgl/failing_tests_mac.txt
+++ b/content/canvas/test/webgl/failing_tests_mac.txt
@@ -1,17 +1,14 @@
 conformance/gl-getshadersource.html
 conformance/gl-object-get-calls.html
 conformance/texture-npot.html
 conformance/glsl-conformance.html
 conformance/invalid-passed-params.html
 conformance/object-deletion-behaviour.html
 conformance/read-pixels-test.html
 conformance/tex-input-validation.html
-conformance/tex-sub-image-2d-bad-args.html
 conformance/more/functions/copyTexImage2D.html
 conformance/more/functions/copyTexSubImage2D.html
 conformance/more/functions/deleteBufferBadArgs.html
 conformance/more/functions/texImage2DBadArgs.html
-conformance/more/functions/texSubImage2DBadArgs.html
-conformance/more/functions/texSubImage2DHTMLBadArgs.html
 conformance/more/functions/uniformfBadArgs.html
 conformance/more/functions/uniformiBadArgs.html
\ No newline at end of file
--- a/content/canvas/test/webgl/failing_tests_windows.txt
+++ b/content/canvas/test/webgl/failing_tests_windows.txt
@@ -1,14 +1,11 @@
 conformance/gl-getshadersource.html
 conformance/glsl-conformance.html
 conformance/invalid-passed-params.html
 conformance/object-deletion-behaviour.html
 conformance/read-pixels-test.html
-conformance/tex-sub-image-2d-bad-args.html
 conformance/more/conformance/quickCheckAPI.html
 conformance/more/functions/copyTexImage2D.html
 conformance/more/functions/copyTexSubImage2D.html
 conformance/more/functions/deleteBufferBadArgs.html
 conformance/more/functions/texImage2DBadArgs.html
-conformance/more/functions/texSubImage2DBadArgs.html
-conformance/more/functions/texSubImage2DHTMLBadArgs.html
 conformance/more/functions/uniformfArrayLen1.html
--- a/content/canvas/test/webgl/test_webgl_conformance_test_suite.html
+++ b/content/canvas/test/webgl/test_webgl_conformance_test_suite.html
@@ -358,24 +358,16 @@ function start() {
     failingTestsFilename = 'failing_tests_linux.txt';
   else if (kIsMac)
     failingTestsFilename = 'failing_tests_mac.txt';
 
   var testsExpectedToFail = loadTextFileSynchronous(failingTestsFilename)
                             .replace(/\r/g, '') // convert to unix line breaks
                             .split('\n');
 
-  if (kIsWindows && !kIsWindowsVistaOrHigher) {
-    testsExpectedToFail.push('conformance/framebuffer-object-attachment.html'); // NVIDIA 190.42 doesnt support DEPTH_STENCIL
-    testsExpectedToFail.push('conformance/gl-get-active-attribute.html'); // bug in NVIDIA 190.42, fixed in newer drivers
-    testsExpectedToFail.push('conformance/gl-uniform-bool.html'); // bug in NVIDIA 190.42, fixed in newer drivers
-    testsExpectedToFail.push('conformance/tex-image-and-sub-image-2d-with-array-buffer-view.html'); // ???
-    testsExpectedToFail.push('conformance/uninitialized-test.html'); // bug in NVIDIA 190.42, fixed in newer drivers
-  }
-
   var testsToIgnore = [];
 
   var testsSuccessful = [];
 
   runTestSuite();
 }
 
 </script>
--- a/dom/plugins/base/npapi.h
+++ b/dom/plugins/base/npapi.h
@@ -361,17 +361,17 @@ typedef enum {
   NPPVpluginWantsAllNetworkStreams = 18,
 
   /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
   NPPVpluginNativeAccessibleAtkPlugId = 19,
 
   /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
   NPPVpluginCancelSrcStream = 20,
 
-  NPPVSupportsAdvancedKeyHandling = 21,
+  NPPVsupportsAdvancedKeyHandling = 21,
 
   NPPVpluginUsesDOMForCursorBool = 22
 
 #if defined(XP_MACOSX)
   /* Used for negotiating drawing models */
   , NPPVpluginDrawingModel = 1000
   /* Used for negotiating event models */
   , NPPVpluginEventModel = 1001
@@ -424,16 +424,18 @@ typedef enum {
   , NPNVsupportsCoreAnimationBool = 2003
   , NPNVsupportsInvalidatingCoreAnimationBool = 2004
 #ifndef NP_NO_CARBON
   , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
 #endif
   , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
   , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
                                                     Cocoa text input specification. */
+  , NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
+                                                               CA model compositing */
 #endif
 #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
   , NPNVSupportsWindowlessLocal = 2002
 #endif
 } NPNVariable;
 
 typedef enum {
   NPNURLVCookie = 501,
@@ -782,17 +784,17 @@ enum NPEventType {
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* NPP_* functions are provided by the plugin and called by the navigator. */
 
 #if defined(XP_UNIX)
-char* NPP_GetMIMEDescription(void);
+const char* NPP_GetMIMEDescription(void);
 #endif
 
 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
                           uint16_t mode, int16_t argc, char* argn[],
                           char* argv[], NPSavedData* saved);
 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
--- a/dom/plugins/base/npfunctions.h
+++ b/dom/plugins/base/npfunctions.h
@@ -212,17 +212,17 @@ typedef struct _NPNetscapeFuncs {
 } NPNetscapeFuncs;
 
 #ifdef XP_MACOSX
 /*
  * Mac OS X version(s) of NP_GetMIMEDescription(const char *)
  * These can be called to retreive MIME information from the plugin dynamically
  *
  * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
- *       to get mime info from the plugin only on OSX and may not be supported 
+ *       to get mime info from the plugin only on OSX and may not be supported
  *       in furture version -- use NP_GetMIMEDescription instead
  */
 enum
 {
  kBPSupportedMIMETypesStructVers_1    = 1
 };
 typedef struct _BPSupportedMIMETypes
 {
@@ -268,55 +268,55 @@ typedef struct _NPPluginData {   /* Alte
   char *pMimeTypes;
   char *pFileExtents;
   char *pFileOpenTemplate;
   char *pProductName;
   char *pProductDescription;
   unsigned long dwProductVersionMS;
   unsigned long dwProductVersionLS;
 } NPPluginData;
-typedef NPError (*NP_GetPluginDataFunc)(NPPluginData*);
-NPError OSCALL  NP_GetPluginData(NPPluginData * pPluginData);
+typedef NPError     (*NP_GetPluginDataFunc)(NPPluginData*);
+NPError OSCALL      NP_GetPluginData(NPPluginData * pPluginData);
 #endif
-typedef NPError (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
-NPError OSCALL  NP_GetEntryPoints(NPPluginFuncs* pFuncs);
-typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*);
-NPError OSCALL  NP_Initialize(NPNetscapeFuncs* bFuncs);
-typedef NPError (*NP_ShutdownFunc)(void);
-NPError OSCALL  NP_Shutdown(void);
-typedef char*   (*NP_GetMIMEDescriptionFunc)(void);
-char*           NP_GetMIMEDescription(void);
+typedef NPError     (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+NPError OSCALL      NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+typedef NPError     (*NP_InitializeFunc)(NPNetscapeFuncs*);
+NPError OSCALL      NP_Initialize(NPNetscapeFuncs* bFuncs);
+typedef NPError     (*NP_ShutdownFunc)(void);
+NPError OSCALL      NP_Shutdown(void);
+typedef const char* (*NP_GetMIMEDescriptionFunc)(void);
+const char*         NP_GetMIMEDescription(void);
 #ifdef __cplusplus
 }
 #endif
 #endif
 
 #if defined(__OS2__)
 #pragma pack()
 #endif
 
 #ifdef XP_UNIX
 #ifdef __cplusplus
 extern "C" {
 #endif
-typedef char*      (*NP_GetPluginVersionFunc)(void);
-NP_EXPORT(char*)   NP_GetPluginVersion(void);
-typedef char*      (*NP_GetMIMEDescriptionFunc)(void);
-NP_EXPORT(char*)   NP_GetMIMEDescription(void);
+typedef char*          (*NP_GetPluginVersionFunc)(void);
+NP_EXPORT(char*)       NP_GetPluginVersion(void);
+typedef const char*    (*NP_GetMIMEDescriptionFunc)(void);
+NP_EXPORT(const char*) NP_GetMIMEDescription(void);
 #ifdef XP_MACOSX
-typedef NPError    (*NP_InitializeFunc)(NPNetscapeFuncs*);
-NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
-typedef NPError    (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
-NP_EXPORT(NPError) NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+typedef NPError        (*NP_InitializeFunc)(NPNetscapeFuncs*);
+NP_EXPORT(NPError)     NP_Initialize(NPNetscapeFuncs* bFuncs);
+typedef NPError        (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+NP_EXPORT(NPError)     NP_GetEntryPoints(NPPluginFuncs* pFuncs);
 #else
-typedef NPError    (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
-NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
+typedef NPError        (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
+NP_EXPORT(NPError)     NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
 #endif
-typedef NPError    (*NP_ShutdownFunc)(void);
-NP_EXPORT(NPError) NP_Shutdown(void);
-typedef NPError    (*NP_GetValueFunc)(void *, NPPVariable, void *);
-NP_EXPORT(NPError) NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
+typedef NPError        (*NP_ShutdownFunc)(void);
+NP_EXPORT(NPError)     NP_Shutdown(void);
+typedef NPError        (*NP_GetValueFunc)(void *, NPPVariable, void *);
+NP_EXPORT(NPError)     NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
 #ifdef __cplusplus
 }
 #endif
 #endif
 
 #endif /* npfunctions_h_ */
--- a/dom/plugins/base/npruntime.h
+++ b/dom/plugins/base/npruntime.h
@@ -1,27 +1,27 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
- * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation. 
+ * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  * notice, this list of conditions and the following disclaimer in the
  * documentation and/or other materials provided with the distribution.
  * 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
  * Foundation ("Mozilla") nor the names of their contributors may be used
  * to endorse or promote products derived from this software without
  * specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR
  * THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
@@ -39,17 +39,17 @@ extern "C" {
 
 #include "nptypes.h"
 
 /*
     This API is used to facilitate binding code written in C to script
     objects.  The API in this header does not assume the presence of a
     user agent.  That is, it can be used to bind C code to scripting
     environments outside of the context of a user agent.
-    
+
     However, the normal use of the this API is in the context of a
     scripting environment running in a browser or other user agent.
     In particular it is used to support the extended Netscape
     script-ability API for plugins (NP-SAP).  NP-SAP is an extension
     of the Netscape plugin API.  As such we have adopted the use of
     the "NP" prefix for this API.
 
     The following NP{N|P}Variables were added to the Netscape plugin
@@ -162,24 +162,24 @@ NP_END_MACRO
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_Double;                                         \
     (_v).value.doubleValue = _val;                                            \
 NP_END_MACRO
 
 #define STRINGZ_TO_NPVARIANT(_val, _v)                                        \
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_String;                                         \
-    NPString str = { _val, uint32_t(strlen(_val)) };                          \
+    NPString str = { _val, (uint32_t)(strlen(_val)) };                        \
     (_v).value.stringValue = str;                                             \
 NP_END_MACRO
 
 #define STRINGN_TO_NPVARIANT(_val, _len, _v)                                  \
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_String;                                         \
-    NPString str = { _val, uint32_t(_len) };                                  \
+    NPString str = { _val, (uint32_t)(_len) };                                \
     (_v).value.stringValue = str;                                             \
 NP_END_MACRO
 
 #define OBJECT_TO_NPVARIANT(_val, _v)                                         \
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_Object;                                         \
     (_v).value.objectValue = _val;                                            \
 NP_END_MACRO
@@ -350,17 +350,17 @@ void NPN_ReleaseObject(NPObject *npobj);
 
 /*
     Functions to access script objects represented by NPObject.
 
     Calls to script objects are synchronous.  If a function returns a
     value, it will be supplied via the result NPVariant
     argument. Successful calls will return true, false will be
     returned in case of an error.
-    
+
     Calls made from plugin code to script must be made from the thread
     on which the plugin was initialized.
 */
 
 bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName,
                 const NPVariant *args, uint32_t argCount, NPVariant *result);
 bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
                        uint32_t argCount, NPVariant *result);
--- a/dom/plugins/base/nptypes.h
+++ b/dom/plugins/base/nptypes.h
@@ -64,17 +64,17 @@
 
   #ifndef __cplusplus
     typedef int bool;
     #define true   1
     #define false  0
   #endif
 #elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
   /*
-   * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and 
+   * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
    * u_int32_t.
    */
   #include <sys/types.h>
 
   /*
    * BSD/OS ships no header that defines uint32_t, nor bool (for C)
    */
   #if defined(bsdi)
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -564,19 +564,19 @@ NP_GetPluginVersion()
 {
   return sPluginVersion;
 }
 #endif
 
 static char sMimeDescription[] = "application/x-test:tst:Test mimetype";
 
 #if defined(XP_UNIX)
-NP_EXPORT(char*) NP_GetMIMEDescription()
+NP_EXPORT(const char*) NP_GetMIMEDescription()
 #elif defined(XP_WIN) || defined(XP_OS2)
-char* NP_GetMIMEDescription()
+const char* NP_GetMIMEDescription()
 #endif
 {
   return sMimeDescription;
 }
 
 #ifdef XP_UNIX
 NP_EXPORT(NPError)
 NP_GetValue(void* future, NPPVariable aVariable, void* aValue) {
--- a/gfx/angle/src/libEGL/Makefile.in
+++ b/gfx/angle/src/libEGL/Makefile.in
@@ -136,10 +136,12 @@ CPPSRCS += \
   $(NULL)
 
 DEFFILE = $(srcdir)/libEGL.def
 
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS = "$(MOZ_DIRECTX_SDK_PATH)/lib/x86/d3d9.lib" \
                    "$(MOZ_DIRECTX_SDK_PATH)/lib/x86/dxguid.lib" \
-		   "dwmapi.lib" \
-		   $(DIST)/lib/libGLESv2.lib
+		   "$(DIST)/lib/libGLESv2.lib" \
+		   dwmapi.lib \
+		   delayimp.lib \
+		   /delayload:dwmapi.dll
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -329,17 +329,17 @@ case "$target" in
     elif test "$target" != "arm-android-eabi"; then
        dnl fail if we're not building with NDKr4
        AC_MSG_ERROR([Couldn't find path to stlport in the android ndk])
     fi
 
     CPPFLAGS="-I$android_platform/usr/include $STLPORT_CPPFLAGS $CPPFLAGS"
     CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CXXFLAGS"
-    LIBS="$LIBS $STLPORT_LIBS"
+    LIBS="$LIBS $STLPORT_LIBS -static-libstdc++"
 
     dnl Add -llog by default, since we use it all over the place.
     dnl Add --allow-shlib-undefined, because libGLESv2 links to an
     dnl undefined symbol (present on the hardware, just not in the
     dnl NDK.)
     LDFLAGS="-mandroid $STLPORT_LDFLAGS -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
 
     dnl prevent cross compile section from using these flags as host flags
--- a/memory/jemalloc/Makefile.in
+++ b/memory/jemalloc/Makefile.in
@@ -206,43 +206,41 @@ ifndef WIN32_OLD_STYLE_JEMALLOC
 # back together with the patched crtdll.obj, glue it to the end of jemalloc's
 # import library and link the rest of Mozilla to that.
 #
 # The result?  A binary that uses jemalloc, doesn't crash, and leaks a tiny
 # amount of memory (32 words per DLL in the 2010 CRT) at shutdown.
 #
 ###############################################################################
 
-libs:: $(DIST)/lib/mozcrt.lib
-
-$(DIST)/lib/mozcrt.lib:: mozcrt.lib
+libs:: mozcrt.lib
 	$(INSTALL) $(IFLAGS2) mozcrt.lib $(DIST)/lib
 
 # And finally combine that with the jemalloc import library to get an import
 # library that has our malloc/free/etc and the CRT's everything else
-mozcrt.lib:: $(IMPORT_LIBRARY) msvc_modified.lib
+mozcrt.lib: $(IMPORT_LIBRARY) msvc_modified.lib
 	lib -OUT:$@ $^
 
 # Put the fixed object file back in
-msvc_modified.lib:: msvc_removed.lib crtdll_fixed.obj
+msvc_modified.lib: msvc_removed.lib crtdll_fixed.obj
 	lib -OUT:$@ $^
 
 # Fix the object file
-crtdll_fixed.obj:: crtdll.obj
+crtdll_fixed.obj: crtdll.obj
 	$(PYTHON) $(srcdir)/fixcrt.py
 
 # Find the path of crtdll.obj
 CRTDLL_FULLPATH=$(subst \,\\,$(shell lib -list msvc_combined.lib | grep crtdll\\.obj))
 
 # Remove the broken object file, only after we have extracted it
-msvc_removed.lib:: msvc_combined.lib crtdll.obj
+msvc_removed.lib: msvc_combined.lib crtdll.obj
 	lib -OUT:$@ msvc_combined.lib -REMOVE:$(CRTDLL_FULLPATH)
 
 # Extract the broken object file out of the combined library
-crtdll.obj:: msvc_combined.lib
+crtdll.obj: msvc_combined.lib
 	lib -OUT:$@ $^ -EXTRACT:$(CRTDLL_FULLPATH)
 
 # Grab both CRT libraries and combine them into one library to simplify things
-msvc_combined.lib::
+msvc_combined.lib:
 	lib -OUT:$@ $(WIN32_CRT_LIBS)
 
 endif
 endif
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_8_9_BETA3
+NSPR_4_8_9_BETA4
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -37,9 +37,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/nsprpub/config/rules.mk
+++ b/nsprpub/config/rules.mk
@@ -373,16 +373,24 @@ ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
 
 $(PROGRAM): pgo.relink
 
 endif	# WINNT && !GCC
 endif	# MOZ_PROFILE_USE
 
 ################################################################################
 
+ifdef MOZ_PROFILE_GENERATE
+# Clean up profiling data during PROFILE_GENERATE phase
+export::
+	-$(RM) *.pgd *.gcda
+endif
+
+################################################################################
+
 ifeq ($(OS_ARCH),WINNT)
 $(RES): $(RESNAME)
 	@$(MAKE_OBJDIR)
 # The resource compiler does not understand the -U option.
 ifdef NS_USE_GCC
 	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
 else
 	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -2817,17 +2817,17 @@ else
   rm -rf conftest*
   result="no"
 fi
 rm -f conftest*
 echo "$ac_t""$result" 1>&6
 
 if test $result = "yes"; then
    PROFILE_GEN_LDFLAGS="-fprofile-generate"
-   PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch -freorder-blocks-and-partition"
+   PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
    PROFILE_USE_LDFLAGS="-fprofile-use"
 fi
 
 CFLAGS="$_SAVE_CFLAGS"
 
 if test "$GNU_CC"; then
     echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
 echo "configure:2834: checking for visibility(hidden) attribute" >&5
@@ -3773,25 +3773,27 @@ EOF
 EOF
 
     AS='$(CC) -x assembler-with-cpp'
     CFLAGS="$CFLAGS -Wall -fno-common"
     case "${target_cpu}" in
         i*86*)
             if test -n "$USE_64"; then
                 CPU_ARCH=x86_64
-                CC="$CC -arch x86_64"
             else        
                 CPU_ARCH=i386
             fi
             ;;
         *)
             CPU_ARCH=ppc
             ;;
     esac
+    if test "`echo $CC | grep -c '\-arch '`" = "0"; then
+        CC="$CC -arch $CPU_ARCH"
+    fi
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
     _OPTIMIZE_FLAGS=-O2
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
@@ -4935,27 +4937,27 @@ EOF
     if test -z "$GNU_CC"; then
         CC="$CC -std1 -ieee_with_inexact"
         if test "$OS_RELEASE" != "V2.0"; then
             CC="$CC -readonly_strings"
         fi
         _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
         ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
-echo "configure:4944: checking for machine/builtins.h" >&5
+echo "configure:4946: checking for machine/builtins.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4949 "configure"
+#line 4951 "configure"
 #include "confdefs.h"
 #include <machine/builtins.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -5594,63 +5596,63 @@ if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 
 
 case $target in
 *-darwin*|*-beos*|*-os2*)
     ;;
 *)
     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5603: checking for dlopen in -ldl" >&5
+echo "configure:5605: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5611 "configure"
+#line 5613 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
 
 int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
 LIBS="$ac_save_LIBS"
 
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:5639: checking for dlfcn.h" >&5
+echo "configure:5641: checking for dlfcn.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5644 "configure"
+#line 5646 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -5673,23 +5675,23 @@ fi
     ;;
 esac
 
 
 
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:5682: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:5684: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 5688 "configure"
+#line 5690 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -5697,17 +5699,17 @@ else
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=no
 fi
 rm -f conftest*
 
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 5706 "configure"
+#line 5708 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -5721,22 +5723,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
 for ac_func in lchown strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5730: checking for $ac_func" >&5
+echo "configure:5732: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5735 "configure"
+#line 5737 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char $ac_func();
@@ -5749,17 +5751,17 @@ int main() {
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
 $ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:5758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
@@ -5800,17 +5802,17 @@ if test "$CCACHE" != "no"; then
             fi
         fi
     fi
     for ac_prog in $CCACHE ccache
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5809: checking for $ac_word" >&5
+echo "configure:5811: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   case "$CCACHE" in
   /*)
   ac_cv_path_CCACHE="$CCACHE" # Let the user override the test with a path.
   ;;
   ?:/*)			 
@@ -5859,17 +5861,17 @@ if test "${enable_strip+set}" = set; the
 fi
 
 
 case "${target_os}" in
 hpux*)
 if test -z "$GNU_CC"; then
 
     echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
-echo "configure:5868: checking for +Olit support" >&5
+echo "configure:5870: checking for +Olit support" >&5
 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
                   ac_cv_hpux_usable_olit_option=no
         rm -f conftest*
         echo 'int main() { return 0; }' | cat > conftest.c
         ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
         if test $? -eq 0; then
@@ -5901,17 +5903,17 @@ darwin*)
     _HAVE_PTHREADS=1
     ;;
 wince*)
     _HAVE_PTHREADS=
     ;;
 *)
     
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:5910: checking for pthread_create in -lpthreads" >&5
+echo "configure:5912: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5923,17 +5925,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:5932: checking for pthread_create in -lpthread" >&5
+echo "configure:5934: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5945,17 +5947,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:5954: checking for pthread_create in -lc_r" >&5
+echo "configure:5956: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5967,17 +5969,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:5976: checking for pthread_create in -lc" >&5
+echo "configure:5978: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -6085,17 +6087,17 @@ if test "${enable_ipv6+set}" = set; then
       fi
 fi
 
 
 if test -n "$USE_PTHREADS"; then
       rm -f conftest*
    ac_cv_have_dash_pthread=no
    echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:6094: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:6096: checking whether ${CC-cc} accepts -pthread" >&5
    echo 'int main() { return 0; }' | cat > conftest.c
    ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
    if test $? -eq 0; then
 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 	    ac_cv_have_dash_pthread=yes
 		case "$target_os" in
 	    freebsd*)
 # Freebsd doesn't use -pthread for compiles, it uses them for linking
@@ -6108,17 +6110,17 @@ echo "configure:6094: checking whether $
 	fi
     fi
     rm -f conftest*
     echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6
 
 			    ac_cv_have_dash_pthreads=no
     if test "$ac_cv_have_dash_pthread" = "no"; then
 	    echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:6117: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:6119: checking whether ${CC-cc} accepts -pthreads" >&5
     	echo 'int main() { return 0; }' | cat > conftest.c
 	    ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
     	if test $? -eq 0; then
 	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 			    ac_cv_have_dash_pthreads=yes
 			    CFLAGS="$CFLAGS -pthreads"
 			    CXXFLAGS="$CXXFLAGS -pthreads"
 		    fi
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -671,17 +671,17 @@ CFLAGS="$CFLAGS -fprofile-generate -fpro
 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
 AC_TRY_COMPILE([], [return 0;],
                [ PROFILE_GEN_CFLAGS="-fprofile-generate"
                  result="yes" ], result="no")
 AC_MSG_RESULT([$result])
 
 if test $result = "yes"; then
    PROFILE_GEN_LDFLAGS="-fprofile-generate"
-   PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch -freorder-blocks-and-partition"
+   PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
    PROFILE_USE_LDFLAGS="-fprofile-use"
 fi
 
 CFLAGS="$_SAVE_CFLAGS"
 
 dnl ===============================================================
 dnl Check for .hidden assembler directive and visibility attribute.
 dnl Borrowed from glibc configure.in
@@ -1304,25 +1304,27 @@ case "$target" in
     AC_DEFINE(HAVE_BSD_FLOCK)
     AC_DEFINE(HAVE_SOCKLEN_T)
     AS='$(CC) -x assembler-with-cpp'
     CFLAGS="$CFLAGS -Wall -fno-common"
     case "${target_cpu}" in
         i*86*)
             if test -n "$USE_64"; then
                 CPU_ARCH=x86_64
-                CC="$CC -arch x86_64"
             else        
                 CPU_ARCH=i386
             fi
             ;;
         *)
             CPU_ARCH=ppc
             ;;
     esac
+    if test "`echo $CC | grep -c '\-arch '`" = "0"; then
+        CC="$CC -arch $CPU_ARCH"
+    fi
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
     _OPTIMIZE_FLAGS=-O2
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
--- a/nsprpub/pr/include/pratom.h
+++ b/nsprpub/pr/include/pratom.h
@@ -128,19 +128,19 @@ long __cdecl _InterlockedExchangeAdd(lon
 #define PR_ATOMIC_INCREMENT(val) _InterlockedIncrement((long volatile *)(val))
 #define PR_ATOMIC_DECREMENT(val) _InterlockedDecrement((long volatile *)(val))
 #define PR_ATOMIC_SET(val, newval) \
         _InterlockedExchange((long volatile *)(val), (long)(newval))
 #define PR_ATOMIC_ADD(ptr, val) \
         (_InterlockedExchangeAdd((long volatile *)(ptr), (long)(val)) + (val))
 
 #elif ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \
-      ((defined(DARWIN) && \
+      ((defined(__APPLE__) && \
            (defined(__ppc__) || defined(__i386__) || defined(__x86_64__))) || \
-       (defined(LINUX) && \
+       (defined(__linux__) && \
            ((defined(__i386__) && \
            defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
            defined(__ia64__) || defined(__x86_64__) || \
            (defined(__powerpc__) && !defined(__powerpc64__)) || \
            (defined(__arm__) && \
            defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
            defined(__alpha))))
 
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -92,16 +92,21 @@ typedef PRBool (*PRVersionCheck)(const c
 **
 ** NSPR's existance proof of the version check function.
 **
 ** Note that NSPR has no cooperating dependencies.
 */
 
 NSPR_API(PRBool) PR_VersionCheck(const char *importedVersion);
 
+/*
+ * Returns a const string of the NSPR library version.
+ */
+NSPR_API(const char*) PR_GetVersion(void);
+
 
 /************************************************************************/
 /*******************************INITIALIZATION***************************/
 /************************************************************************/
 
 /*
 ** Initialize the runtime. Attach a thread object to the currently
 ** executing native thread of type "type".
--- a/nsprpub/pr/include/prtime.h
+++ b/nsprpub/pr/include/prtime.h
@@ -51,21 +51,21 @@
 #include "prlong.h"
 
 PR_BEGIN_EXTERN_C
 
 /**********************************************************************/
 /************************* TYPES AND CONSTANTS ************************/
 /**********************************************************************/
 
-#define PR_MSEC_PER_SEC		1000UL
-#define PR_USEC_PER_SEC		1000000UL
-#define PR_NSEC_PER_SEC		1000000000UL
-#define PR_USEC_PER_MSEC	1000UL
-#define PR_NSEC_PER_MSEC	1000000UL
+#define PR_MSEC_PER_SEC		1000L
+#define PR_USEC_PER_SEC		1000000L
+#define PR_NSEC_PER_SEC		1000000000L
+#define PR_USEC_PER_MSEC	1000L
+#define PR_NSEC_PER_MSEC	1000000L
 
 /*
  * PRTime --
  *
  *     NSPR represents basic time as 64-bit signed integers relative
  *     to midnight (00:00:00), January 1, 1970 Greenwich Mean Time (GMT).
  *     (GMT is also known as Coordinated Universal Time, UTC.)
  *     The units of time are in microseconds. Negative times are allowed
--- a/nsprpub/pr/include/prtypes.h
+++ b/nsprpub/pr/include/prtypes.h
@@ -223,16 +223,23 @@
 ** DESCRIPTION:
 **      Commonly used macros for operations on compatible types.
 ***********************************************************************/
 #define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
 #define PR_MIN(x,y)     ((x)<(y)?(x):(y))
 #define PR_MAX(x,y)     ((x)>(y)?(x):(y))
 #define PR_ABS(x)       ((x)<0?-(x):(x))
 
+/***********************************************************************
+** MACROS:      PR_ARRAY_SIZE
+** DESCRIPTION:
+**  The number of elements in an array.
+***********************************************************************/
+#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
+
 PR_BEGIN_EXTERN_C
 
 /************************************************************************
 ** TYPES:       PRUint8
 **              PRInt8
 ** DESCRIPTION:
 **  The int8 types are known to be 8 bits each. There is no type that
 **      is equivalent to a plain "char".
--- a/nsprpub/pr/src/misc/prinit.c
+++ b/nsprpub/pr/src/misc/prinit.c
@@ -132,16 +132,20 @@ PR_IMPLEMENT(PRBool) PR_VersionCheck(con
         return PR_FALSE;
     }
     if (vmajor == PR_VMAJOR && vminor == PR_VMINOR && vpatch > PR_VPATCH) {
         return PR_FALSE;
     }
     return PR_TRUE;
 }  /* PR_VersionCheck */
 
+PR_IMPLEMENT(const char*) PR_GetVersion(void)
+{
+    return PR_VERSION;
+}
 
 PR_IMPLEMENT(PRBool) PR_Initialized(void)
 {
     return _pr_initialized;
 }
 
 PRInt32 _native_threads_only = 0;
 
--- a/nsprpub/pr/src/misc/prsystem.c
+++ b/nsprpub/pr/src/misc/prsystem.c
@@ -72,16 +72,22 @@
 #include <sys/pstat.h>
 #endif
 
 #if defined(XP_UNIX)
 #include <unistd.h>
 #include <sys/utsname.h>
 #endif
 
+#if defined(LINUX)
+#include <string.h>
+#include <ctype.h>
+#define MAX_LINE 512
+#endif
+
 #if defined(AIX)
 #include <cf.h>
 #include <sys/cfgodm.h>
 #endif
 
 #if defined(WIN32)
 /* This struct is not present in VC6 headers, so declare it here */
 typedef struct {
@@ -250,18 +256,51 @@ PR_IMPLEMENT(PRInt32) PR_GetNumberOfProc
     if ( numCpus < 1 )  {
         numCpus = -1; /* set to -1 for return value on error */
         _PR_MD_MAP_DEFAULT_ERROR( _MD_ERRNO() );
     }
 #elif defined(IRIX)
     numCpus = sysconf( _SC_NPROC_ONLN );
 #elif defined(RISCOS) || defined(SYMBIAN)
     numCpus = 1;
+#elif defined(LINUX)
+    /* for the benefit of devices with advanced power-saving, that
+       actually hotplug their cpus in heavy load, try to figure out
+       the real number of CPUs */
+    char buf[MAX_LINE];
+    FILE *fin;
+    const char *cpu_present = "/sys/devices/system/cpu/present";
+    size_t strsize;
+    numCpus = 0;
+    fin = fopen(cpu_present, "r");
+    if (fin != NULL) {
+        if (fgets(buf, MAX_LINE, fin) != NULL) {
+            /* check that the format is what we expect */
+            if (buf[0] == '0') {
+                strsize = strlen(buf);
+                if (strsize == 1) {
+                    /* single core */
+                    numCpus = 1;
+                } else if (strsize >= 3 && strsize <= 5) {
+                    /* should be of the form 0-999 */
+                    /* parse the part after the 0-, note count is 0-based */
+                    if (buf[1] == '-' && isdigit(buf[2])) {
+                        numCpus = 1 + atoi(buf + 2);
+                    }
+                }
+            }
+        }
+        fclose(fin);
+    }
+    /* if that fails, fall back to more standard methods */
+    if (!numCpus) {
+        numCpus = sysconf( _SC_NPROCESSORS_CONF );
+    }
 #elif defined(XP_UNIX)
-    numCpus = sysconf( _SC_NPROCESSORS_ONLN );
+    numCpus = sysconf( _SC_NPROCESSORS_CONF );
 #else
 #error "An implementation is required"
 #endif
     return(numCpus);
 } /* end PR_GetNumberOfProcessors() */
 
 /*
 ** PR_GetPhysicalMemorySize()
--- a/nsprpub/pr/src/nspr.def
+++ b/nsprpub/pr/src/nspr.def
@@ -469,8 +469,12 @@ EXPORTS ;-
 ;+	global:
 		PR_ParseTimeStringToExplodedTime;
 ;+} NSPR_4.6;
 ;+NSPR_4.8 {
 ;+	global:
 		PR_AssertCurrentThreadOwnsLock;
 		PR_AssertCurrentThreadInMonitor;
 ;+} NSPR_4.7;
+;+NSPR_4.8.9 {
+;+      global:
+                PR_GetVersion;
+;+} NSPR_4.8;
--- a/nsprpub/pr/tests/sprintf.c
+++ b/nsprpub/pr/tests/sprintf.c
@@ -51,18 +51,16 @@
 #include "prinit.h"
 #include "prprf.h"
 #include "prlog.h"
 #include "prlong.h"
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-#define countof(a) (sizeof(a)/sizeof(a[0]))
-
 static char sbuf[20000];
 
 
 /*
 ** Perform a three way test against PR_smprintf, PR_snprintf, and sprintf.
 ** Make sure the results are identical
 */
 static void test_i(char *pattern, int i)
@@ -116,25 +114,25 @@ static void TestI(void)
     };
     static char *formats[] = {
 	"d", "o", "x", "u",
 	"hd", "ho", "hx", "hu"
     };
     int f, s, n, p;
     char fmt[20];
 
-    for (f = 0; f < countof(formats); f++) {
-	for (s = 0; s < countof(signs); s++) {
-	    for (p = 0; p < countof(precs); p++) {
+    for (f = 0; f < PR_ARRAY_SIZE(formats); f++) {
+	for (s = 0; s < PR_ARRAY_SIZE(signs); s++) {
+	    for (p = 0; p < PR_ARRAY_SIZE(precs); p++) {
 		fmt[0] = '%';
 		fmt[1] = 0;
 		if (signs[s]) strcat(fmt, signs[s]);
 		if (precs[p]) strcat(fmt, precs[p]);
 		if (formats[f]) strcat(fmt, formats[f]);
-		for (n = 0; n < countof(nums); n++) {
+		for (n = 0; n < PR_ARRAY_SIZE(nums); n++) {
 		    test_i(fmt, nums[n]);
 		}
 	    }
 	}
     }
 }
 
 /************************************************************************/
@@ -208,27 +206,27 @@ static void TestL(void)
     static char *sformats[] = { "ld", "lo", "lx", "lu" };
 #else
 #error Neither int nor long is 4 bytes on this platform
 #endif
 
     int f, s, n, p;
     char fmt[40], sfmt[40];
 
-    for (f = 0; f < countof(formats); f++) {
-	for (s = 0; s < countof(signs); s++) {
-	    for (p = 0; p < countof(precs); p++) {
+    for (f = 0; f < PR_ARRAY_SIZE(formats); f++) {
+	for (s = 0; s < PR_ARRAY_SIZE(signs); s++) {
+	    for (p = 0; p < PR_ARRAY_SIZE(precs); p++) {
 		fmt[0] = '%';
 		fmt[1] = 0;
 		if (signs[s]) strcat(fmt, signs[s]);
 		if (precs[p]) strcat(fmt, precs[p]);
 		strcpy(sfmt, fmt);
 		if (formats[f]) strcat(fmt, formats[f]);
 		if (sformats[f]) strcat(sfmt, sformats[f]);
-		for (n = 0; n < countof(nums); n++) {
+		for (n = 0; n < PR_ARRAY_SIZE(nums); n++) {
 		    test_l(fmt, sfmt, nums[n]);
 		}
 	    }
 	}
     }
 }
 
 /************************************************************************/
@@ -331,27 +329,27 @@ static void TestLL(void)
     static char *sformats[] = { "I64d", "I64o", "I64x", "I64u" };
 #else
     static char *sformats[] = { "lld", "llo", "llx", "llu" };
 #endif
 
     int f, s, n, p;
     char fmt[40], sfmt[40];
 
-    for (f = 0; f < countof(formats); f++) {
-	for (s = 0; s < countof(signs); s++) {
-	    for (p = 0; p < countof(precs); p++) {
+    for (f = 0; f < PR_ARRAY_SIZE(formats); f++) {
+	for (s = 0; s < PR_ARRAY_SIZE(signs); s++) {
+	    for (p = 0; p < PR_ARRAY_SIZE(precs); p++) {
 		fmt[0] = '%';
 		fmt[1] = 0;
 		if (signs[s]) strcat(fmt, signs[s]);
 		if (precs[p]) strcat(fmt, precs[p]);
 		strcpy(sfmt, fmt);
 		if (formats[f]) strcat(fmt, formats[f]);
 		if (sformats[f]) strcat(sfmt, sformats[f]);
-		for (n = 0; n < countof(nums); n++) {
+		for (n = 0; n < PR_ARRAY_SIZE(nums); n++) {
 		    test_ll(fmt, sfmt, nums[n]);
 		}
 	    }
 	}
     }
 }
 
 /************************************************************************/
@@ -419,25 +417,25 @@ static void TestS(void)
 	"", "3", "5", "43",
 	".3", ".43",
 	"7.3", "7.5", "7.11", "7.43",
     };
     static char *formats[] = { "s" };
     int f, s, n, p;
     char fmt[40];
 
-    for (f = 0; f < countof(formats); f++) {
-	for (s = 0; s < countof(signs); s++) {
-	    for (p = 0; p < countof(precs); p++) {
+    for (f = 0; f < PR_ARRAY_SIZE(formats); f++) {
+	for (s = 0; s < PR_ARRAY_SIZE(signs); s++) {
+	    for (p = 0; p < PR_ARRAY_SIZE(precs); p++) {
 		fmt[0] = '%';
 		fmt[1] = 0;
 		if (signs[s]) strcat(fmt+strlen(fmt), signs[s]);
 		if (precs[p]) strcat(fmt+strlen(fmt), precs[p]);
 		if (formats[f]) strcat(fmt+strlen(fmt), formats[f]);
-		for (n = 0; n < countof(strs); n++) {
+		for (n = 0; n < PR_ARRAY_SIZE(strs); n++) {
 		    test_s(fmt, strs[n]);
 		}
 	    }
 	}
     }
 }
 
 /************************************************************************/
--- a/security/coreconf/Linux.mk
+++ b/security/coreconf/Linux.mk
@@ -187,8 +187,23 @@ ZLIB_LIBS = -lz
 ifeq ($(BUILD_SUN_PKG), 1)
 ifeq ($(USE_64), 1)
 RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib'
 else
 RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib'
 endif
 endif
 
+OS_REL_CFLAGS   += -DLINUX2_1
+MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
+
+ifdef MAPFILE
+	MKSHLIB += -Wl,--version-script,$(MAPFILE)
+endif
+PROCESS_MAP_FILE = grep -v ';-' $< | \
+        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
+
+ifeq ($(OS_RELEASE),2.4)
+# Softoken 3.13 uses NO_FORK_CHECK only.
+# Softoken 3.12 uses NO_FORK_CHECK and NO_CHECK_FORK.
+# Don't use NO_CHECK_FORK in new code.
+DEFINES += -DNO_FORK_CHECK -DNO_CHECK_FORK
+endif
deleted file mode 100644
--- a/security/coreconf/Linux2.1.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
-ifeq ($(OS_RELEASE),2.1)
-        OS_REL_CFLAGS   += -DLINUX2_1
-        MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
-	ifdef MAPFILE
-		MKSHLIB += -Wl,--version-script,$(MAPFILE)
-	endif
-	PROCESS_MAP_FILE = grep -v ';-' $< | \
-       	 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
-endif
-
deleted file mode 100644
--- a/security/coreconf/Linux2.2.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
-
-OS_REL_CFLAGS   += -DLINUX2_1
-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
-
-ifdef MAPFILE
-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
-endif
-PROCESS_MAP_FILE = grep -v ';-' $< | \
-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
-
deleted file mode 100644
--- a/security/coreconf/Linux2.4.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
-
-OS_REL_CFLAGS   += -DLINUX2_1
-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
-
-ifdef MAPFILE
-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
-endif
-PROCESS_MAP_FILE = grep -v ';-' $< | \
-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
-        
-# Softoken 3.13 uses NO_FORK_CHECK only.
-# Softoken 3.12 uses NO_FORK_CHECK and NO_CHECK_FORK.
-# Don't use NO_CHECK_FORK in new code.
-DEFINES += -DNO_FORK_CHECK -DNO_CHECK_FORK
-
deleted file mode 100644
--- a/security/coreconf/Linux2.5.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
-
-OS_REL_CFLAGS   += -DLINUX2_1
-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
-
-ifdef MAPFILE
-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
-endif
-PROCESS_MAP_FILE = grep -v ';-' $< | \
-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
-
deleted file mode 100644
--- a/security/coreconf/Linux2.6.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
-
-OS_REL_CFLAGS   += -DLINUX2_1
-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
-
-ifdef MAPFILE
-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
-endif
-PROCESS_MAP_FILE = grep -v ';-' $< | \
-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
-
deleted file mode 100644
--- a/security/coreconf/LinuxELF1.2.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
deleted file mode 100644
--- a/security/coreconf/LinuxELF2.0.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Netscape security libraries.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1994-2000
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-include $(CORE_DEPTH)/coreconf/Linux.mk
--- a/security/coreconf/config.mk
+++ b/security/coreconf/config.mk
@@ -58,17 +58,17 @@ endif
 #       (dependent upon <architecture> tags)                          #
 #                                                                     #
 #       We are moving towards just having a $(OS_TARGET).mk file      #
 #       as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files,    #
 #       one for each OS release.                                      #
 #######################################################################
 
 TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
-              AIX RISCOS WINNT WIN95 WINCE
+              AIX RISCOS WINNT WIN95 WINCE Linux
 
 ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
 include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
 else
 include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk
 endif
 
 #######################################################################
--- a/security/nss/TAG-INFO
+++ b/security/nss/TAG-INFO
@@ -1,1 +1,1 @@
-NSS_3_12_10_RTM
+NSS_3_12_11_BETA1
--- a/security/nss/cmd/lib/secutil.c
+++ b/security/nss/cmd/lib/secutil.c
@@ -3975,25 +3975,23 @@ SECU_DerSignDataCRL(PRArenaPool *arena, 
      * and algID match
      */
 
     /* Sign input buffer */
     rv = SEC_SignData(&it, buf, len, pk, algID);
     if (rv) goto loser;
 
     /* Fill out SignedData object */
-    PORT_Memset(sd, 0, sizeof(sd));
+    PORT_Memset(sd, 0, sizeof(*sd));
     sd->data.data = buf;
     sd->data.len = len;
     sd->signature.data = it.data;
     sd->signature.len = it.len << 3;		/* convert to bit string */
-    if (!sd->signatureAlgorithm.parameters.data) {
-        rv = SECOID_SetAlgorithmID(arena, &sd->signatureAlgorithm, algID, 0);
-        if (rv) goto loser;
-    }
+    rv = SECOID_SetAlgorithmID(arena, &sd->signatureAlgorithm, algID, 0);
+    if (rv) goto loser;
 
     return rv;
 
   loser:
     PORT_Free(it.data);
     return rv;
 }
 
--- a/security/nss/lib/certdb/certdb.c
+++ b/security/nss/lib/certdb/certdb.c
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Certificate handling code
  *
- * $Id: certdb.c,v 1.104.2.2 2010/09/02 00:52:02 wtc%google.com Exp $
+ * $Id: certdb.c,v 1.104.2.3 2011/07/12 12:39:04 kaie%kuix.de Exp $
  */
 
 #include "nssilock.h"
 #include "prmon.h"
 #include "prtime.h"
 #include "cert.h"
 #include "certi.h"
 #include "secder.h"
@@ -2558,17 +2558,27 @@ CERT_ImportCerts(CERTCertDBHandle *certd
     
 	/* decode all of the certs into the temporary DB */
 	for ( i = 0, fcerts= 0; i < ncerts; i++) {
 	    certs[fcerts] = CERT_NewTempCertificate(certdb,
 	                                            derCerts[i],
 	                                            NULL,
 	                                            PR_FALSE,
 	                                            PR_TRUE);
-	    if (certs[fcerts]) fcerts++;
+	    if (certs[fcerts]) {
+		SECItem subjKeyID = {siBuffer, NULL, 0};
+		if (CERT_FindSubjectKeyIDExtension(certs[fcerts],
+		                                   &subjKeyID) == SECSuccess) {
+		    if (subjKeyID.data) {
+			cert_AddSubjectKeyIDMapping(&subjKeyID, certs[fcerts]);
+		    }
+		    SECITEM_FreeItem(&subjKeyID, PR_FALSE);
+		}
+		fcerts++;
+	    }
 	}
 
 	if ( keepCerts ) {
 	    for ( i = 0; i < fcerts; i++ ) {
                 char* canickname = NULL;
                 PRBool freeNickname = PR_FALSE;
 
 		SECKEY_UpdateCertPQG(certs[i]);
--- a/security/nss/lib/certhigh/ocsp.c
+++ b/security/nss/lib/certhigh/ocsp.c
@@ -34,17 +34,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Implementation of OCSP services, for both client and server.
  * (XXX, really, mostly just for client right now, but intended to do both.)
  *
- * $Id: ocsp.c,v 1.65 2010/06/07 19:03:27 kaie%kuix.de Exp $
+ * $Id: ocsp.c,v 1.65.2.1 2011/07/13 11:13:55 kaie%kuix.de Exp $
  */
 
 #include "prerror.h"
 #include "prprf.h"
 #include "plarena.h"
 #include "prnetdb.h"
 
 #include "seccomon.h"
@@ -607,20 +607,24 @@ ocsp_RemoveCacheItem(OCSPCacheData *cach
     PR_ExitMonitor(OCSP_Global.monitor);
 }
 
 static void
 ocsp_CheckCacheSize(OCSPCacheData *cache)
 {
     OCSP_TRACE(("OCSP ocsp_CheckCacheSize\n"));
     PR_EnterMonitor(OCSP_Global.monitor);
-    if (OCSP_Global.maxCacheEntries <= 0) /* disabled or unlimited */
-        return;
-    while (cache->numberOfEntries > OCSP_Global.maxCacheEntries) {
-        ocsp_RemoveCacheItem(cache, cache->LRUitem);
+    if (OCSP_Global.maxCacheEntries > 0) {
+        /* Cache is not disabled. Number of cache entries is limited.
+         * The monitor ensures that maxCacheEntries remains positive.
+         */
+        while (cache->numberOfEntries > 
+                     (PRUint32)OCSP_Global.maxCacheEntries) {
+            ocsp_RemoveCacheItem(cache, cache->LRUitem);
+        }
     }
     PR_ExitMonitor(OCSP_Global.monitor);
 }
 
 SECStatus
 CERT_ClearOCSPCache()
 {
     OCSP_TRACE(("OCSP CERT_ClearOCSPCache\n"));
--- a/security/nss/lib/crmf/crmfi.h
+++ b/security/nss/lib/crmf/crmfi.h
@@ -41,20 +41,48 @@
 /* This file will contain all declarations common to both 
  * encoding and decoding of CRMF Cert Requests.  This header 
  * file should only be included internally by CRMF implementation
  * files.
  */
 #include "secasn1.h"
 #include "crmfit.h"
 #include "secerr.h"
+#include "blapit.h"
 
 #define CRMF_DEFAULT_ARENA_SIZE   1024
-#define MAX_WRAPPED_KEY_LEN       2048
 
+/*
+ * Explanation for the definition of MAX_WRAPPED_KEY_LEN:
+ * 
+ * It's used for internal buffers to transport a wrapped private key.
+ * The value is in BYTES.
+ * We want to define a reasonable upper bound for this value.
+ * Ideally this could be calculated, but in order to simplify the code
+ * we want to estimate the maximum requires size.
+ * See also bug 655850 for the full explanation.
+ * 
+ * We know the largest wrapped keys are RSA keys.
+ * We'll estimate the maximum size needed for wrapped RSA keys,
+ * and assume it's sufficient for wrapped keys of any type we support.
+ * 
+ * The maximum size of RSA keys in bits is defined elsewhere as
+ *   RSA_MAX_MODULUS_BITS
+ * 
+ * The idea is to define MAX_WRAPPED_KEY_LEN based on the above.
+ * 
+ * A wrapped RSA key requires about
+ *   ( ( RSA_MAX_MODULUS_BITS / 8 ) * 5.5) + 65
+ * bytes.
+ * 
+ * Therefore, a safe upper bound is:
+ *   ( ( RSA_MAX_MODULUS_BITS / 8 ) *8 ) = RSA_MAX_MODULUS_BITS
+ * 
+ */
+#define MAX_WRAPPED_KEY_LEN       RSA_MAX_MODULUS_BITS
 
 #define CRMF_BITS_TO_BYTES(bits) (((bits)+7)/8)
 #define CRMF_BYTES_TO_BITS(bytes) ((bytes)*8)
 
 struct crmfEncoderArg {
     SECItem *buffer;
     long     allocatedLen;
 };
--- a/security/nss/lib/freebl/intel-aes.s
+++ b/security/nss/lib/freebl/intel-aes.s
@@ -1649,18 +1649,18 @@ 4:	movdqu	(%r8, %rax), %xmm1
 	.byte 0x66,0x0f,0x38,0xde,0xce	/* aesdec	%xmm6, %xmm1 */
 	.byte 0x66,0x0f,0x38,0xde,0xcd	/* aesdec	%xmm5, %xmm1 */
 	.byte 0x66,0x0f,0x38,0xde,0xcc	/* aesdec	%xmm4, %xmm1 */
 	.byte 0x66,0x0f,0x38,0xde,0xcb	/* aesdec	%xmm3, %xmm1 */
 	.byte 0x66,0x0f,0x38,0xde,0xca	/* aesdec	%xmm2, %xmm1 */
 	.byte 0x66,0x41,0x0f,0x38,0xdf,0xc8	/* aesdeclast %xmm8, %xmm1 */
 	movdqu	112(%rdi), %xmm8
 	pxor	%xmm0, %xmm1
-	movdqu	%xmm1, (%rsi, %rax)
-	movdqu	(%r8, %rax), %xmm0
+	movdqu	(%r8, %rax), %xmm0  /* fetch the IV before we store the block */
+	movdqu	%xmm1, (%rsi, %rax) /* in case input buf = output buf */
 	addq	$16, %rax
 	cmpq	%rax, %r9
 	jne	4b
 
 5:	movdqu	%xmm0, (%rdx)
 
 	xor	%eax, %eax
 	ret
--- a/security/nss/lib/freebl/mpi/mp_comba.c
+++ b/security/nss/lib/freebl/mpi/mp_comba.c
@@ -44,17 +44,17 @@
 /* this should multiply i and j  */
 #define MULADD(i, j)                                      \
 __asm__  (                                                    \
      "movq  %6,%%rax     \n\t"                            \
      "mulq  %7           \n\t"                            \
      "addq  %%rax,%0     \n\t"                            \
      "adcq  %%rdx,%1     \n\t"                            \
      "adcq  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","cc");
 
 
 
 
 /* sqr macros only */
 #define CLEAR_CARRY \
    c0 = c1 = c2 = 0;
 
@@ -71,57 +71,57 @@
 
 #define SQRADD(i, j)                                      \
 __asm__ (                                                     \
      "movq  %6,%%rax     \n\t"                            \
      "mulq  %%rax        \n\t"                            \
      "addq  %%rax,%0     \n\t"                            \
      "adcq  %%rdx,%1     \n\t"                            \
      "adcq  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","%cc");
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","cc");
 
 #define SQRADD2(i, j)                                     \
 __asm__ (                                                     \
      "movq  %6,%%rax     \n\t"                            \
      "mulq  %7           \n\t"                            \
      "addq  %%rax,%0     \n\t"                            \
      "adcq  %%rdx,%1     \n\t"                            \
      "adcq  $0,%2        \n\t"                            \
      "addq  %%rax,%0     \n\t"                            \
      "adcq  %%rdx,%1     \n\t"                            \
      "adcq  $0,%2        \n\t"                            \
-     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","cc");
 
 #define SQRADDSC(i, j)                                    \
 __asm__ (                                                     \
      "movq  %3,%%rax     \n\t"                            \
      "mulq  %4           \n\t"                            \
      "movq  %%rax,%0     \n\t"                            \
      "movq  %%rdx,%1     \n\t"                            \
      "xorq  %2,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","%cc");
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","cc");
 
 #define SQRADDAC(i, j)                                                         \
 __asm__ (                                                     \
      "movq  %6,%%rax     \n\t"                            \
      "mulq  %7           \n\t"                            \
      "addq  %%rax,%0     \n\t"                            \
      "adcq  %%rdx,%1     \n\t"                            \
      "adcq  $0,%2        \n\t"                            \
-     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","cc");
 
 #define SQRADDDB                                                               \
 __asm__ (                                                     \
      "addq %6,%0         \n\t"                            \
      "adcq %7,%1         \n\t"                            \
      "adcq %8,%2         \n\t"                            \
      "addq %6,%0         \n\t"                            \
      "adcq %7,%1         \n\t"                            \
      "adcq %8,%2         \n\t"                            \
-     :"=&r"(c0), "=&r"(c1), "=&r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
+     :"=&r"(c0), "=&r"(c1), "=&r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
 
 
 
 
 
 void s_mp_mul_comba_4(const mp_int *A, const mp_int *B, mp_int *C)
 {
    mp_digit c0, c1, c2, at[8];
--- a/security/nss/lib/nss/nss.h
+++ b/security/nss/lib/nss/nss.h
@@ -31,17 +31,17 @@
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
-/* $Id: nss.h,v 1.81.2.6 2011/05/06 17:04:37 christophe.ravel.bugs%sun.com Exp $ */
+/* $Id: nss.h,v 1.81.2.7 2011/05/06 22:23:25 christophe.ravel.bugs%sun.com Exp $ */
 
 #ifndef __nss_h_
 #define __nss_h_
 
 /* The private macro _NSS_ECC_STRING is for NSS internal use only. */
 #ifdef NSS_ENABLE_ECC
 #ifdef NSS_ECC_MORE_THAN_SUITE_B
 #define _NSS_ECC_STRING " Extended ECC"
@@ -61,22 +61,22 @@
 
 /*
  * NSS's major version, minor version, patch level, build number, and whether
  * this is a beta release.
  *
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
  */
-#define NSS_VERSION  "3.12.10.0" _NSS_ECC_STRING _NSS_CUSTOMIZED
+#define NSS_VERSION  "3.12.11.0" _NSS_ECC_STRING _NSS_CUSTOMIZED " Beta"
 #define NSS_VMAJOR   3
 #define NSS_VMINOR   12
-#define NSS_VPATCH   10
+#define NSS_VPATCH   11
 #define NSS_VBUILD   0
-#define NSS_BETA     PR_FALSE
+#define NSS_BETA     PR_TRUE
 
 #ifndef RC_INVOKED
 
 #include "seccomon.h"
 
 typedef struct NSSInitParametersStr NSSInitParameters;
 
 /*
--- a/security/nss/lib/pk11wrap/pk11skey.c
+++ b/security/nss/lib/pk11wrap/pk11skey.c
@@ -1452,25 +1452,28 @@ PK11_DeriveWithTemplate( PK11SymKey *bas
     PK11SymKey *    symKey;
     PK11SymKey *    newBaseKey	= NULL;
     CK_BBOOL        cktrue	= CK_TRUE; 
     CK_OBJECT_CLASS keyClass	= CKO_SECRET_KEY;
     CK_KEY_TYPE     keyType	= CKK_GENERIC_SECRET;
     CK_ULONG        valueLen	= 0;
     CK_MECHANISM    mechanism; 
     CK_RV           crv;
-    CK_ATTRIBUTE    keyTemplate[MAX_TEMPL_ATTRS];
+#define MAX_ADD_ATTRS 4
+    CK_ATTRIBUTE    keyTemplate[MAX_TEMPL_ATTRS + MAX_ADD_ATTRS];
+#undef MAX_ADD_ATTRS
     CK_ATTRIBUTE *  attrs	= keyTemplate;
     CK_SESSION_HANDLE session;
     unsigned int    templateCount;
 
     if (numAttrs > MAX_TEMPL_ATTRS) {
     	PORT_SetError(SEC_ERROR_INVALID_ARGS);
 	return NULL;
     }
+
     /* first copy caller attributes in. */
     for (templateCount = 0; templateCount < numAttrs; ++templateCount) {
     	*attrs++ = *userAttr++;
     }
 
     /* We only add the following attributes to the template if the caller
     ** didn't already supply them.
     */
@@ -1490,17 +1493,17 @@ PK11_DeriveWithTemplate( PK11SymKey *bas
 	attrs++;
     }
     if ((operation != CKA_FLAGS_ONLY) &&
 	  !pk11_FindAttrInTemplate(keyTemplate, numAttrs, operation)) {
 	PK11_SETATTRS(attrs, operation, &cktrue, sizeof cktrue); attrs++;
     }
 
     templateCount = attrs - keyTemplate;
-    PR_ASSERT(templateCount <= MAX_TEMPL_ATTRS);
+    PR_ASSERT(templateCount <= sizeof(keyTemplate)/sizeof(CK_ATTRIBUTE));
 
     /* move the key to a slot that can do the function */
     if (!PK11_DoesMechanism(slot,derive)) {
 	/* get a new base key & slot */
 	PK11SlotInfo *newSlot = PK11_GetBestSlot(derive, baseKey->cx);
 
 	if (newSlot == NULL) return NULL;
 
@@ -2019,24 +2022,27 @@ pk11_AnyUnwrapKey(PK11SlotInfo *slot, CK
     CK_BBOOL        cktrue	= CK_TRUE; 
     CK_OBJECT_CLASS keyClass	= CKO_SECRET_KEY;
     CK_KEY_TYPE     keyType	= CKK_GENERIC_SECRET;
     CK_ULONG        valueLen	= 0;
     CK_MECHANISM    mechanism;
     CK_SESSION_HANDLE rwsession;
     CK_RV           crv;
     CK_MECHANISM_INFO mechanism_info;
-    CK_ATTRIBUTE    keyTemplate[MAX_TEMPL_ATTRS];
+#define MAX_ADD_ATTRS 4
+    CK_ATTRIBUTE    keyTemplate[MAX_TEMPL_ATTRS + MAX_ADD_ATTRS];
+#undef MAX_ADD_ATTRS
     CK_ATTRIBUTE *  attrs	= keyTemplate;
     unsigned int    templateCount;
 
     if (numAttrs > MAX_TEMPL_ATTRS) {
     	PORT_SetError(SEC_ERROR_INVALID_ARGS);
 	return NULL;
     }
+
     /* first copy caller attributes in. */
     for (templateCount = 0; templateCount < numAttrs; ++templateCount) {
     	*attrs++ = *userAttr++;
     }
 
     /* We only add the following attributes to the template if the caller
     ** didn't already supply them.
     */
--- a/security/nss/lib/softoken/softkver.h
+++ b/security/nss/lib/softoken/softkver.h
@@ -52,16 +52,16 @@
 
 /*
  * Softoken's major version, minor version, patch level, build number,
  * and whether this is a beta release.
  *
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
  */
-#define SOFTOKEN_VERSION  "3.12.10.0" SOFTOKEN_ECC_STRING
+#define SOFTOKEN_VERSION  "3.12.11.0" SOFTOKEN_ECC_STRING " Beta"
 #define SOFTOKEN_VMAJOR   3
 #define SOFTOKEN_VMINOR   12
-#define SOFTOKEN_VPATCH   10
+#define SOFTOKEN_VPATCH   11
 #define SOFTOKEN_VBUILD   0
-#define SOFTOKEN_BETA     PR_FALSE
+#define SOFTOKEN_BETA     PR_TRUE
 
 #endif /* _SOFTKVER_H_ */
--- a/security/nss/lib/ssl/sslsock.c
+++ b/security/nss/lib/ssl/sslsock.c
@@ -35,17 +35,17 @@
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
-/* $Id: sslsock.c,v 1.67.2.2 2011/03/16 19:04:02 alexei.volkov.bugs%sun.com Exp $ */
+/* $Id: sslsock.c,v 1.67.2.3 2011/07/26 14:42:57 wtc%google.com Exp $ */
 #include "seccomon.h"
 #include "cert.h"
 #include "keyhi.h"
 #include "ssl.h"
 #include "sslimpl.h"
 #include "sslproto.h"
 #include "nspr.h"
 #include "private/pprio.h"
@@ -201,16 +201,17 @@ char                    ssl_trace;
 FILE *                  ssl_trace_iob;
 FILE *                  ssl_keylog_iob;
 char lockStatus[] = "Locks are ENABLED.  ";
 #define LOCKSTATUS_OFFSET 10 /* offset of ENABLED */
 
 /* forward declarations. */
 static sslSocket *ssl_NewSocket(PRBool makeLocks);
 static SECStatus  ssl_MakeLocks(sslSocket *ss);
+static void       ssl_SetDefaultsFromEnvironment(void);
 static PRStatus   ssl_PushIOLayer(sslSocket *ns, PRFileDesc *stack, 
                                   PRDescIdentity id);
 
 /************************************************************************/
 
 /*
 ** Lookup a socket structure from a file descriptor.
 ** Only functions called through the PRIOMethods table should use this.
@@ -816,16 +817,18 @@ SSL_OptionGetDefault(PRInt32 which, PRBo
     SECStatus  rv = SECSuccess;
     PRBool     on = PR_FALSE;
 
     if (!pOn) {
 	PORT_SetError(SEC_ERROR_INVALID_ARGS);
 	return SECFailure;
     }
 
+    ssl_SetDefaultsFromEnvironment();
+
     switch (which) {
     case SSL_SOCKS:               on = PR_FALSE;                        break;
     case SSL_SECURITY:            on = ssl_defaults.useSecurity;        break;
     case SSL_REQUEST_CERTIFICATE: on = ssl_defaults.requestCertificate; break;
     case SSL_REQUIRE_CERTIFICATE: on = ssl_defaults.requireCertificate; break;
     case SSL_HANDSHAKE_AS_CLIENT: on = ssl_defaults.handshakeAsClient;  break;
     case SSL_HANDSHAKE_AS_SERVER: on = ssl_defaults.handshakeAsServer;  break;
     case SSL_ENABLE_TLS:          on = ssl_defaults.enableTLS;          break;
@@ -863,16 +866,18 @@ SECStatus
 SSL_EnableDefault(int which, PRBool on)
 {
     return SSL_OptionSetDefault(which, on);
 }
 
 SECStatus
 SSL_OptionSetDefault(PRInt32 which, PRBool on)
 {
+    ssl_SetDefaultsFromEnvironment();
+
     switch (which) {
       case SSL_SOCKS:
 	ssl_defaults.useSocks = PR_FALSE;
 	if (on) {
 	    PORT_SetError(SEC_ERROR_INVALID_ARGS);
 	    return SECFailure;
 	}
 	break;
@@ -2245,23 +2250,19 @@ loser:
 }
 
 #if (defined(XP_UNIX) || defined(XP_WIN32) || defined(XP_BEOS)) && !defined(_WIN32_WCE)
 #define NSS_HAVE_GETENV 1
 #endif
 
 #define LOWER(x) (x | 0x20)  /* cheap ToLower function ignores LOCALE */
 
-/*
-** Create a newsocket structure for a file descriptor.
-*/
-static sslSocket *
-ssl_NewSocket(PRBool makeLocks)
+static void
+ssl_SetDefaultsFromEnvironment(void)
 {
-    sslSocket *ss;
 #if defined( NSS_HAVE_GETENV )
     static int firsttime = 1;
 
     if (firsttime) {
 	char * ev;
 	firsttime = 0;
 #ifdef DEBUG
 	ev = getenv("SSLDEBUGFILE");
@@ -2322,16 +2323,28 @@ ssl_NewSocket(PRBool makeLocks)
 	ev = getenv("NSS_SSL_REQUIRE_SAFE_NEGOTIATION");
 	if (ev && ev[0] == '1') {
 	    ssl_defaults.requireSafeNegotiation = PR_TRUE;
 	    SSL_TRACE(("SSL: requireSafeNegotiation set to %d", 
 	                PR_TRUE));
 	}
     }
 #endif /* NSS_HAVE_GETENV */
+}
+
+/*
+** Create a newsocket structure for a file descriptor.
+*/
+static sslSocket *
+ssl_NewSocket(PRBool makeLocks)
+{
+    sslSocket *ss;
+
+    ssl_SetDefaultsFromEnvironment();
+
     if (ssl_force_locks)
 	makeLocks = PR_TRUE;
 
     /* Make a new socket and get it ready */
     ss = (sslSocket*) PORT_ZAlloc(sizeof(sslSocket));
     if (ss) {
         /* This should be of type SSLKEAType, but CC on IRIX
 	 * complains during the for loop.
--- a/security/nss/lib/util/nssb64d.c
+++ b/security/nss/lib/util/nssb64d.c
@@ -32,17 +32,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Base64 decoding (ascii to binary).
  *
- * $Id: nssb64d.c,v 1.7 2008/10/05 20:59:26 nelson%bolyard.com Exp $
+ * $Id: nssb64d.c,v 1.7.32.1 2011/05/07 18:20:53 kaie%kuix.de Exp $
  */
 
 #include "nssb64.h"
 #include "nspr.h"
 #include "secitem.h"
 #include "secerr.h"
 
 /*
@@ -558,18 +558,20 @@ PL_Base64DecodeBuffer (const char *src, 
 		       PRUint32 maxdestlen, PRUint32 *output_destlen)
 {
     PRUint32 need_length;
     unsigned char *output_buffer = NULL;
     PLBase64Decoder *data = NULL;
     PRStatus status;
 
     PR_ASSERT(srclen > 0);
-    if (srclen == 0)
-	return dest;
+    if (srclen == 0) {
+	PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
+	return NULL;
+    }
 
     /*
      * How much space could we possibly need for decoding this input?
      */
     need_length = PL_Base64MaxDecodedLength (srclen);
 
     /*
      * Make sure we have at least that much, if output buffer provided.
@@ -742,27 +744,31 @@ NSSBase64Decoder_Destroy (NSSBase64Decod
  * you will want to free the result via SECITEM_FreeItem.
  *
  * Return value is NULL on error, the Item (allocated or provided) otherwise.
  */
 SECItem *
 NSSBase64_DecodeBuffer (PRArenaPool *arenaOpt, SECItem *outItemOpt,
 			const char *inStr, unsigned int inLen)
 {
-    SECItem *out_item = outItemOpt;
-    PRUint32 max_out_len = PL_Base64MaxDecodedLength (inLen);
+    SECItem *out_item = NULL;
+    PRUint32 max_out_len = 0;
     PRUint32 out_len;
     void *mark = NULL;
     unsigned char *dummy;
 
-    PORT_Assert(outItemOpt == NULL || outItemOpt->data == NULL);
+    if ((outItemOpt != NULL && outItemOpt->data != NULL) || inLen == 0) {
+	PORT_SetError (SEC_ERROR_INVALID_ARGS);
+	return NULL;
+    }
 
     if (arenaOpt != NULL)
 	mark = PORT_ArenaMark (arenaOpt);
 
+    max_out_len = PL_Base64MaxDecodedLength (inLen);
     out_item = SECITEM_AllocItem (arenaOpt, outItemOpt, max_out_len);
     if (out_item == NULL) {
 	if (arenaOpt != NULL)
 	    PORT_ArenaRelease (arenaOpt, mark);
 	return NULL;
     }
 
     dummy = PL_Base64DecodeBuffer (inStr, inLen, out_item->data,
--- a/security/nss/lib/util/nssutil.h
+++ b/security/nss/lib/util/nssutil.h
@@ -46,16 +46,16 @@
 
 /*
  * NSS utilities's major version, minor version, patch level, build number,
  * and whether this is a beta release.
  *
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <Beta>]"
  */
-#define NSSUTIL_VERSION  "3.12.10.0"
+#define NSSUTIL_VERSION  "3.12.11.0 Beta"
 #define NSSUTIL_VMAJOR   3
 #define NSSUTIL_VMINOR   12
-#define NSSUTIL_VPATCH   10
+#define NSSUTIL_VPATCH   11
 #define NSSUTIL_VBUILD   0
-#define NSSUTIL_BETA     PR_FALSE
+#define NSSUTIL_BETA     PR_TRUE
 
 #endif /* __nssutil_h_ */
--- a/security/nss/lib/util/secport.c
+++ b/security/nss/lib/util/secport.c
@@ -175,20 +175,16 @@ PORT_Strdup(const char *str)
 }
 
 void
 PORT_SetError(int value)
 {	
 #ifdef DEBUG_jp96085
     PORT_Assert(value != SEC_ERROR_REUSED_ISSUER_AND_SERIAL);
 #endif
-    if (value == SEC_ERROR_NO_MEMORY &&
-        PR_GetEnv("NSS_DEBUG_SEC_ERROR_NO_MEMORY")) {
-        PR_Assert("SEC_ERROR_NO_MEMORY: attach minidump to bug 662557", __FILE__, __LINE__);
-    }
     PR_SetError(value, 0);
     return;
 }
 
 int
 PORT_GetError(void)
 {
     return(PR_GetError());
index 8fb20c696dbf4133b4674abddf20eb885cab2b88..6d24954120b014028dbf2ff2ddba4ebd91a63b82
GIT binary patch
literal 583
zc$_n6VsbWUVqCL;nTe5!iILHOmyJ`a&7<u*FC!x>D}#ZxA-4f18*?ZNn=n&ou%Vy<
zKZwI6%;E1G91xVBUt%a}APy2@78ZaBDFpfZhbTBZ8pw(B8X6iH8<-fH7@8XzMgh5I
zNL&LuRKo=f_#lR}gG_REG&GbokcOBo0u@p4%qvMP%1uqlOe{$?Xq=DiTt-#~=EhzI
zgT_v##zux~%X0+^FGc=r%X@oKu6ySizRf=srGvGvJN;5{(D4swD`&r&x@_t5mI><$
zpC-o?J*-umn{eqOZ;_1J@=1pC!`LQecE3rKn7rJ4!UN{!oAM97@3_T&ap{%AFKe!c
z%&OJBG2dl(U4QG`e{u3&#j$F_QLYQ-N3jR-I?VO0&HG?|s*#DAk%4h>h(QoI#AJmT
z8UM4e8ZZMX1A8_OZ8l)&vNJNW7#kQG=)?F1jBUypB_#z``uZvP$r+h>r3J-$rNw&r
zMTyBdsd~xzxmHGI1_o$x#0>PU|LRoEKTdTvvKORlm!7fWC@ea5$+#hvu|};r&_FdN
z-s$+kdPa_a-&9?1_f;31@;)2HwN~Z)v@MD+9N)@G*iDbxD_G(&r>FA7<m$^S7wdMf
z+oE60v~`!;;nmCH`hIN+EIoAj>>t~0`DSZEn|Ecu>tMC`#O%F*@2+#$W9!#HRA&GH
DtLMP<
index 4ec3cf5bca6db42ab33cf698d1d69942170ea217..990cbb6f7cf4efa12a50d186721d0dbc5583ee0d
GIT binary patch
literal 1692
zc${sMdpOgJAIEnyjENn?!Wa?_eH|2Xn8@Xf+%HWLT1&2lE-p1IGf~JCvYL+0kDQrb
z_S@W(;lWV+B0BYyR!*z4gw6eOob#ODd4A{l{oc>>{`~QNKhNi{_Y0sxz)*k+SKdSS
zqAwxAieNU?gbJg<-2m$UiJ__h4XU(l7+mGgN)-Wyu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Op{Dg1Yb_QRxfkyo=xrQIs3PkGxBp9yszZg&8>dzwfB=)
jJ)!wbyYvd(?;1Z`<dPr~ak55w!pr_^qO%fqpS%nJWuCbe
index de675893572fa238504cfe03466a9d6ca65ea638..5f819af3b2e98bae5ce23acd7cd819692167850f
GIT binary patch
literal 561
zc$_n6V$wBeVw|>snTe5!iILfWmyJ`a&7<u*FC!x>D}#ZZA-4f18*?ZNn=n&ou%Unf
zABe*x%<k_T9N_F|XeetS4H97%7J-T=c;=O)7Uia<WG0rR8pw(B8X6iH8<-fH7@8Xz
zM*+EJNL&LmRPzN5_#x(VfJ}3BH8eI9F%W`Szzq{paCJ3koR92MMpg#q#$E=4#!jZj
zMuycLFIN3v?kW5`<4Nxc_pL#Td3U<K*Z=H&aO1DFYZEn}z1+i*^LS=qf|F&yWB%3r
zzVrO17%gpCFJ@hF?X|-!*44VZ4jWm$abr8>`tYXjjOc@xt}Ikcu>HI3;ezJ$OB{Vg
z!PUIqoRTjToqTY0sn>-#(ZZ_fcSX)0GO^2ga3bfwn=BJEBLm}NX9GtAdo~VjHefii
zGcvLm8yFhs!}tb_ZOR!XB?VUc`YHLz8JT&d1;u)$#d`TgiOD&sddc~@Rz_w(4XClf
z4D?)PM4xu}qh(q`8GpY@y9%b(OlMq_oYgeZWKqz=jnm)#z3Fr<-0<kSxCzU*PBW2P
zZR=>iy*K#Vx_>!KwQ?Ie#c!`Uo3rb3LD%8W^F{W^O{!z@@n+S!88$)ux=Hi(y4NXc
m-#=Z`=e22jm0fxB>1qET5g{(M3`!qn9h_ab_0vPcmM;M56vK4@
index be73602a15277a674d12ea82daca431732053f9a..5c171689d16f368a759d75bffa74dd9be9c71f03
GIT binary patch
literal 561
zc$_n6V$wBeVw|>snTe5!iIK&CmyJ`a&7<u*FC!x>D}#ZZA-4f18*?ZNn=n&ou%Unf
zABe*x%<k_T9N_F|XeetS4H97%7J-T=c;=O)7Uia<WG0rR8pw(B8X6iH8<-fH7@8Xz
zM*+EJNL&LmRP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d8cc8649fe269561478541c79c99
-# User Brian Smith <bsmith@mozilla.com>
-diff --git a/security/nss/lib/util/secport.c b/security/nss/lib/util/secport.c
---- a/security/nss/lib/util/secport.c
-+++ b/security/nss/lib/util/secport.c
-@@ -175,16 +175,20 @@ PORT_Strdup(const char *str)
- }
- 
- void
- PORT_SetError(int value)
- {	
- #ifdef DEBUG_jp96085
-     PORT_Assert(value != SEC_ERROR_REUSED_ISSUER_AND_SERIAL);
- #endif
-+    if (value == SEC_ERROR_NO_MEMORY &&
-+        PR_GetEnv("NSS_DEBUG_SEC_ERROR_NO_MEMORY")) {
-+        PR_Assert("SEC_ERROR_NO_MEMORY: attach minidump to bug 662557", __FILE__, __LINE__);
-+    }
-     PR_SetError(value, 0);
-     return;
- }
- 
- int
- PORT_GetError(void)
- {
-     return(PR_GetError());
--- a/toolkit/content/Services.jsm
+++ b/toolkit/content/Services.jsm
@@ -14,16 +14,17 @@
  * The Original Code is mozilla.org code.
  *
  * The Initial Developer of the Original Code is Mozilla Foundation.
  * Portions created by the Initial Developer are Copyright (C) 2010
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Gavin Sharp <gavin@gavinsharp.com> (original author)
+ *   Justin Dolske <dolske@mozilla.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -56,89 +57,38 @@ XPCOMUtils.defineLazyGetter(Services, "a
 });
 
 XPCOMUtils.defineLazyGetter(Services, "dirsvc", function () {
   return Cc["@mozilla.org/file/directory_service;1"]
            .getService(Ci.nsIDirectoryService)
            .QueryInterface(Ci.nsIProperties);
 });
 
-XPCOMUtils.defineLazyServiceGetter(Services, "contentPrefs",
-                                   "@mozilla.org/content-pref/service;1",
-                                   "nsIContentPrefService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "wm",
-                                   "@mozilla.org/appshell/window-mediator;1",
-                                   "nsIWindowMediator");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "obs",
-                                   "@mozilla.org/observer-service;1",
-                                   "nsIObserverService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "perms",
-                                   "@mozilla.org/permissionmanager;1",
-                                   "nsIPermissionManager");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "io",
-                                   "@mozilla.org/network/io-service;1",
-                                   "nsIIOService2");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "prompt",
-                                   "@mozilla.org/embedcomp/prompt-service;1",
-                                   "nsIPromptService");
-
+let initTable = [
+  ["console", "@mozilla.org/consoleservice;1", "nsIConsoleService"],
+  ["contentPrefs", "@mozilla.org/content-pref/service;1", "nsIContentPrefService"],
+  ["cookies", "@mozilla.org/cookiemanager;1", "nsICookieManager2"],
+  ["droppedLinkHandler", "@mozilla.org/content/dropped-link-handler;1", "nsIDroppedLinkHandler"],
+  ["eTLD", "@mozilla.org/network/effective-tld-service;1", "nsIEffectiveTLDService"],
+  ["io", "@mozilla.org/network/io-service;1", "nsIIOService2"],
+  ["locale", "@mozilla.org/intl/nslocaleservice;1", "nsILocaleService"],
+  ["logins", "@mozilla.org/login-manager;1", "nsILoginManager"],
+  ["obs", "@mozilla.org/observer-service;1", "nsIObserverService"],
+  ["perms", "@mozilla.org/permissionmanager;1", "nsIPermissionManager"],
+  ["prompt", "@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService"],
+  ["scriptloader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader"],
 #ifdef MOZ_TOOLKIT_SEARCH
-XPCOMUtils.defineLazyServiceGetter(Services, "search",
-                                   "@mozilla.org/browser/search-service;1",
-                                   "nsIBrowserSearchService");
+  ["search", "@mozilla.org/browser/search-service;1", "nsIBrowserSearchService"],
 #endif
-
-XPCOMUtils.defineLazyServiceGetter(Services, "storage",
-                                   "@mozilla.org/storage/service;1",
-                                   "mozIStorageService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "vc",
-                                   "@mozilla.org/xpcom/version-comparator;1",
-                                   "nsIVersionComparator");
+  ["storage", "@mozilla.org/storage/service;1", "mozIStorageService"],
+  ["strings", "@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"],
+  ["telemetry", "@mozilla.org/base/telemetry;1", "nsITelemetry"],
+  ["tm", "@mozilla.org/thread-manager;1", "nsIThreadManager"],
+  ["urlFormatter", "@mozilla.org/toolkit/URLFormatterService;1", "nsIURLFormatter"],
+  ["vc", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator"],
+  ["wm", "@mozilla.org/appshell/window-mediator;1", "nsIWindowMediator"],
+  ["ww", "@mozilla.org/embedcomp/window-watcher;1", "nsIWindowWatcher"],
+];
 
-XPCOMUtils.defineLazyServiceGetter(Services, "locale",
-                                   "@mozilla.org/intl/nslocaleservice;1",
-                                   "nsILocaleService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "scriptloader",
-                                   "@mozilla.org/moz/jssubscript-loader;1",
-                                   "mozIJSSubScriptLoader");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "ww",
-                                   "@mozilla.org/embedcomp/window-watcher;1",
-                                   "nsIWindowWatcher");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "tm",
-                                   "@mozilla.org/thread-manager;1",
-                                   "nsIThreadManager");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "droppedLinkHandler",
-                                   "@mozilla.org/content/dropped-link-handler;1",
-                                   "nsIDroppedLinkHandler");
+initTable.forEach(function ([name, contract, intf])
+  XPCOMUtils.defineLazyServiceGetter(Services, name, contract, intf));
 
-XPCOMUtils.defineLazyServiceGetter(Services, "console",
-                                   "@mozilla.org/consoleservice;1",
-                                   "nsIConsoleService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "strings",
-                                   "@mozilla.org/intl/stringbundle;1",
-                                   "nsIStringBundleService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "urlFormatter",
-                                   "@mozilla.org/toolkit/URLFormatterService;1",
-                                   "nsIURLFormatter");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "eTLD",
-                                   "@mozilla.org/network/effective-tld-service;1",
-                                   "nsIEffectiveTLDService");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "cookies",
-                                   "@mozilla.org/cookiemanager;1",
-                                   "nsICookieManager2");
-
-XPCOMUtils.defineLazyServiceGetter(Services, "logins",
-                                   "@mozilla.org/login-manager;1",
-                                   "nsILoginManager");
+initTable = undefined;
--- a/toolkit/content/license.html
+++ b/toolkit/content/license.html
@@ -2332,17 +2332,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
 
 
     <hr>
 
     <h1><a name="firebug"></a>Firebug License</h1>
 
     <p>This license applies to the code
-    <span class="path">toolkit/components/console/hudservice/NetworkHelper.jsm</span>.</p>
+    <span class="path">browser/devtools/webconsole/NetworkHelper.jsm</span>.</p>
 
 <pre>
 Copyright (c) 2007, Parakey Inc.
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 
--- a/toolkit/content/tests/browser/browser_Services.js
+++ b/toolkit/content/tests/browser/browser_Services.js
@@ -68,9 +68,10 @@ function checkServices() {
   checkService("ww", Ci.nsIWindowWatcher);
   checkService("tm", Ci.nsIThreadManager);
   checkService("droppedLinkHandler", Ci.nsIDroppedLinkHandler);
   checkService("strings", Ci.nsIStringBundleService);
   checkService("urlFormatter", Ci.nsIURLFormatter);
   checkService("eTLD", Ci.nsIEffectiveTLDService);
   checkService("cookies", Ci.nsICookieManager2);
   checkService("logins", Ci.nsILoginManager);
+  checkService("telemetry", Ci.nsITelemetry);
 }
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -64,30 +64,28 @@ MAKEFILES_dom="
   dom/interfaces/json/Makefile
   dom/interfaces/load-save/Makefile
   dom/interfaces/offline/Makefile
   dom/interfaces/range/Makefile
   dom/interfaces/sidebar/Makefile
   dom/interfaces/storage/Makefile
   dom/interfaces/stylesheets/Makefile
   dom/interfaces/svg/Makefile
-  dom/interfaces/threads/Makefile
   dom/interfaces/traversal/Makefile
   dom/interfaces/xbl/Makefile
   dom/interfaces/xpath/Makefile
   dom/interfaces/xul/Makefile
   dom/base/Makefile
   dom/src/Makefile
   dom/src/events/Makefile
   dom/src/jsurl/Makefile
   dom/src/geolocation/Makefile
   dom/src/json/Makefile
   dom/src/offline/Makefile
   dom/src/storage/Makefile
-  dom/src/threads/Makefile
   dom/locales/Makefile
   dom/plugins/base/Makefile
   dom/plugins/ipc/Makefile
   dom/plugins/test/Makefile
   dom/plugins/test/mochitest/Makefile
   dom/plugins/test/testplugin/Makefile
   js/jetpack/Makefile
 "
@@ -804,17 +802,16 @@ if [ "$ENABLE_TESTS" ]; then
     content/xul/content/test/Makefile
     content/xul/document/test/Makefile
     docshell/test/Makefile
     docshell/test/browser/Makefile
     docshell/test/chrome/Makefile
     docshell/test/navigation/Makefile
     dom/src/json/test/Makefile
     dom/src/jsurl/test/Makefile
-    dom/src/threads/test/Makefile
     dom/tests/Makefile
     dom/tests/mochitest/Makefile
     dom/tests/mochitest/ajax/Makefile
     dom/tests/mochitest/ajax/jquery/Makefile
     dom/tests/mochitest/ajax/jquery/dist/Makefile
     dom/tests/mochitest/ajax/jquery/test/Makefile
     dom/tests/mochitest/ajax/jquery/test/data/Makefile
     dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile