merge fx-team to m-c
authorRob Campbell <rcampbell@mozilla.com>
Fri, 16 Dec 2011 14:42:54 -0400
changeset 84421 ac22a1aae2633830730772a2cbcca51a3d5275db
parent 84420 c135571daddf04d68649bb997f41cbad95ad2b42 (current diff)
parent 84412 7cc472108eb4accb272b6b103a827bf1a6f44df8 (diff)
child 84422 cbb0233c7ba868e9be6603d5a3591a33b4072088
child 84445 0ab6831c77bce759bba7640f4f5114052d56c0b2
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone11.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 fx-team to m-c
browser/base/content/NetworkPrioritizer.jsm
browser/base/content/browser.js
browser/base/content/openLocationLastURL.jsm
browser/base/content/test/Makefile.in
browser/base/content/test/browser_NetworkPrioritizer.js
browser/components/migration/src/nsOperaProfileMigrator.cpp
browser/components/migration/src/nsOperaProfileMigrator.h
browser/components/sessionstore/test/browser/Makefile.in
browser/components/sessionstore/test/browser/browser_248970_a.js
browser/components/sessionstore/test/browser/browser_248970_b.js
browser/components/sessionstore/test/browser/browser_248970_b_sample.html
browser/components/sessionstore/test/browser/browser_339445.js
browser/components/sessionstore/test/browser/browser_339445_sample.html
browser/components/sessionstore/test/browser/browser_345898.js
browser/components/sessionstore/test/browser/browser_346337.js
browser/components/sessionstore/test/browser/browser_346337_sample.html
browser/components/sessionstore/test/browser/browser_350525.js
browser/components/sessionstore/test/browser/browser_354894.js
browser/components/sessionstore/test/browser/browser_367052.js
browser/components/sessionstore/test/browser/browser_393716.js
browser/components/sessionstore/test/browser/browser_394759_basic.js
browser/components/sessionstore/test/browser/browser_394759_behavior.js
browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js
browser/components/sessionstore/test/browser/browser_394759_purge.js
browser/components/sessionstore/test/browser/browser_408470.js
browser/components/sessionstore/test/browser/browser_408470_sample.html
browser/components/sessionstore/test/browser/browser_423132.js
browser/components/sessionstore/test/browser/browser_423132_sample.html
browser/components/sessionstore/test/browser/browser_447951.js
browser/components/sessionstore/test/browser/browser_447951_sample.html
browser/components/sessionstore/test/browser/browser_448741.js
browser/components/sessionstore/test/browser/browser_454908.js
browser/components/sessionstore/test/browser/browser_454908_sample.html
browser/components/sessionstore/test/browser/browser_456342.js
browser/components/sessionstore/test/browser/browser_456342_sample.xhtml
browser/components/sessionstore/test/browser/browser_459906.js
browser/components/sessionstore/test/browser/browser_459906_empty.html
browser/components/sessionstore/test/browser/browser_459906_sample.html
browser/components/sessionstore/test/browser/browser_461634.js
browser/components/sessionstore/test/browser/browser_461743.js
browser/components/sessionstore/test/browser/browser_461743_sample.html
browser/components/sessionstore/test/browser/browser_463205.js
browser/components/sessionstore/test/browser/browser_463205_helper.html
browser/components/sessionstore/test/browser/browser_463205_sample.html
browser/components/sessionstore/test/browser/browser_463206.js
browser/components/sessionstore/test/browser/browser_463206_sample.html
browser/components/sessionstore/test/browser/browser_464199.js
browser/components/sessionstore/test/browser/browser_464620_a.html
browser/components/sessionstore/test/browser/browser_464620_a.js
browser/components/sessionstore/test/browser/browser_464620_b.html
browser/components/sessionstore/test/browser/browser_464620_b.js
browser/components/sessionstore/test/browser/browser_464620_xd.html
browser/components/sessionstore/test/browser/browser_465215.js
browser/components/sessionstore/test/browser/browser_465223.js
browser/components/sessionstore/test/browser/browser_466937.js
browser/components/sessionstore/test/browser/browser_466937_sample.html
browser/components/sessionstore/test/browser/browser_467409-backslashplosion.js
browser/components/sessionstore/test/browser/browser_477657.js
browser/components/sessionstore/test/browser/browser_480148.js
browser/components/sessionstore/test/browser/browser_480893.js
browser/components/sessionstore/test/browser/browser_483330.js
browser/components/sessionstore/test/browser/browser_485482.js
browser/components/sessionstore/test/browser/browser_485482_sample.html
browser/components/sessionstore/test/browser/browser_485563.js
browser/components/sessionstore/test/browser/browser_490040.js
browser/components/sessionstore/test/browser/browser_491168.js
browser/components/sessionstore/test/browser/browser_491577.js
browser/components/sessionstore/test/browser/browser_493467.js
browser/components/sessionstore/test/browser/browser_495495.js
browser/components/sessionstore/test/browser/browser_500328.js
browser/components/sessionstore/test/browser/browser_506482.js
browser/components/sessionstore/test/browser/browser_514751.js
browser/components/sessionstore/test/browser/browser_522375.js
browser/components/sessionstore/test/browser/browser_522545.js
browser/components/sessionstore/test/browser/browser_524745.js
browser/components/sessionstore/test/browser/browser_526613.js
browser/components/sessionstore/test/browser/browser_528776.js
browser/components/sessionstore/test/browser/browser_579868.js
browser/components/sessionstore/test/browser/browser_579879.js
browser/components/sessionstore/test/browser/browser_580512.js
browser/components/sessionstore/test/browser/browser_581593.js
browser/components/sessionstore/test/browser/browser_581937.js
browser/components/sessionstore/test/browser/browser_586068-cascaded_restore.js
browser/components/sessionstore/test/browser/browser_586147.js
browser/components/sessionstore/test/browser/browser_588426.js
browser/components/sessionstore/test/browser/browser_589246.js
browser/components/sessionstore/test/browser/browser_590268.js
browser/components/sessionstore/test/browser/browser_590563.js
browser/components/sessionstore/test/browser/browser_595601-restore_hidden.js
browser/components/sessionstore/test/browser/browser_597071.js
browser/components/sessionstore/test/browser/browser_597315.js
browser/components/sessionstore/test/browser/browser_597315_a.html
browser/components/sessionstore/test/browser/browser_597315_b.html
browser/components/sessionstore/test/browser/browser_597315_c.html
browser/components/sessionstore/test/browser/browser_597315_c1.html
browser/components/sessionstore/test/browser/browser_597315_c2.html
browser/components/sessionstore/test/browser/browser_597315_index.html
browser/components/sessionstore/test/browser/browser_599909.js
browser/components/sessionstore/test/browser/browser_600545.js
browser/components/sessionstore/test/browser/browser_601955.js
browser/components/sessionstore/test/browser/browser_607016.js
browser/components/sessionstore/test/browser/browser_615394-SSWindowState_events.js
browser/components/sessionstore/test/browser/browser_618151.js
browser/components/sessionstore/test/browser/browser_623779.js
browser/components/sessionstore/test/browser/browser_624727.js
browser/components/sessionstore/test/browser/browser_625016.js
browser/components/sessionstore/test/browser/browser_625257.js
browser/components/sessionstore/test/browser/browser_628270.js
browser/components/sessionstore/test/browser/browser_635418.js
browser/components/sessionstore/test/browser/browser_636279.js
browser/components/sessionstore/test/browser/browser_644409-scratchpads.js
browser/components/sessionstore/test/browser/browser_645428.js
browser/components/sessionstore/test/browser/browser_659591.js
browser/components/sessionstore/test/browser/browser_662812.js
browser/components/sessionstore/test/browser/browser_665702-state_session.js
browser/components/sessionstore/test/browser/browser_682507.js
browser/components/sessionstore/test/browser/browser_687710.js
browser/components/sessionstore/test/browser/browser_687710_2.js
browser/components/sessionstore/test/browser/browser_694378.js
browser/components/sessionstore/test/browser/browser_705597.js
browser/components/sessionstore/test/browser/browser_form_restore_events.js
browser/components/sessionstore/test/browser/browser_form_restore_events_sample.html
browser/components/sessionstore/test/browser/head.js
browser/components/sidebar/src/Makefile.in
browser/components/sidebar/src/nsSidebar.js
browser/components/sidebar/src/nsSidebar.manifest
browser/components/test/browser/Makefile.in
browser/components/test/browser/browser_bug538331.js
browser/components/wintaskbar/WindowsJumpLists.jsm
browser/components/wintaskbar/WindowsPreviewPerTab.jsm
browser/components/wintaskbar/test/browser_taskbar_preview.js
browser/devtools/styleinspector/test/browser/Makefile.in
browser/devtools/styleinspector/test/browser/browser_bug683672.html
browser/devtools/styleinspector/test/browser/browser_bug683672.js
browser/devtools/styleinspector/test/browser/browser_bug_692400_element_style.js
browser/devtools/styleinspector/test/browser/browser_csslogic_inherited.js
browser/devtools/styleinspector/test/browser/browser_ruleview_editor.js
browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js
browser/devtools/styleinspector/test/browser/browser_ruleview_manipulation.js
browser/devtools/styleinspector/test/browser/browser_ruleview_override.js
browser/devtools/styleinspector/test/browser/browser_ruleview_ui.js
browser/devtools/styleinspector/test/browser/browser_styleinspector.js
browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_672744_search_filter.js
browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_672746_default_styles.js
browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js
browser/devtools/styleinspector/test/browser/head.js
browser/devtools/styleinspector/test/browser_bug683672.js
browser/devtools/styleinspector/test/browser_styleinspector.js
browser/devtools/webconsole/test/browser/Makefile.in
browser/devtools/webconsole/test/browser/browser_gcli_inspect.html
browser/devtools/webconsole/test/browser/browser_gcli_inspect.js
browser/devtools/webconsole/test/browser/browser_gcli_integrate.js
browser/devtools/webconsole/test/browser/browser_gcli_require.js
browser/devtools/webconsole/test/browser/browser_gcli_web.js
browser/devtools/webconsole/test/browser/browser_warn_user_about_replaced_api.js
browser/devtools/webconsole/test/browser/browser_webconsole_abbreviate_source_url.js
browser/devtools/webconsole/test/browser/browser_webconsole_basic_net_logging.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_578437_page_reload.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_579412_input_focus.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580001_closing_after_completion.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580400_groups.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580454_timestamp_l10n.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_581231_close_button.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_582201_duplicate_errors.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_583816_tab_focus.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585237_line_limit.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585956_console_trace.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_keys.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_popup.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_586388_select_all.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_587617_output_copy.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_588342_document_focus.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_588730_text_node_insertion.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_588967_input_expansion.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_589162_css_filter.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_592442_closing_brackets.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_594477_clickable_output.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_594497_history_arrow_keys.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_595223_file_uri.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_external_script_errors.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_network_requests_from_chrome.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597460_filter_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_598357_jsterm_output.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_599725_response_headers.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_600183_charset.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601177_log_levels.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601352_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601667_filter_buttons.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601909_remember_height.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_602572_log_bodies_checkbox.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_603750_websocket.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_611795.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613013_console_api_iframe.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613280_jsterm_copy.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_maintain_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_prune_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_614793_jsterm_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_618078_network_exceptions.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_close_panels.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_private_browsing.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_621644_jsterm_dollar.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_622303_persistent_filters.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_626484_output_copy_order.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_630733_response_redirect_headers.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_632275_getters_document_width.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_632347_iterators_generators.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_632817.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_642108_pruneTest.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_642615_autocomplete.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_644419_log_limits.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_646025_console_file_location.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_651501_document_body_autocomplete.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_653531_highlighter_console_helper.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_659907_console_dir.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_660806_history_nav.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_663443_panel_title.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_664131_console_group.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_678816.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_704295.js
browser/devtools/webconsole/test/browser/browser_webconsole_chrome.js
browser/devtools/webconsole/test/browser/browser_webconsole_completion.js
browser/devtools/webconsole/test/browser/browser_webconsole_console_extras.js
browser/devtools/webconsole/test/browser/browser_webconsole_console_logging_api.js
browser/devtools/webconsole/test/browser/browser_webconsole_consoleonpage.js
browser/devtools/webconsole/test/browser/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
browser/devtools/webconsole/test/browser/browser_webconsole_execution_scope.js
browser/devtools/webconsole/test/browser/browser_webconsole_history.js
browser/devtools/webconsole/test/browser/browser_webconsole_hud_getters.js
browser/devtools/webconsole/test/browser/browser_webconsole_js_input_and_output_styling.js
browser/devtools/webconsole/test/browser/browser_webconsole_js_input_expansion.js
browser/devtools/webconsole/test/browser/browser_webconsole_jsterm.js
browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_of_message_types.js
browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_on_search_strings.js
browser/devtools/webconsole/test/browser/browser_webconsole_log_node_classes.js
browser/devtools/webconsole/test/browser/browser_webconsole_message_node_id.js
browser/devtools/webconsole/test/browser/browser_webconsole_netlogging.js
browser/devtools/webconsole/test/browser/browser_webconsole_network_panel.js
browser/devtools/webconsole/test/browser/browser_webconsole_notifications.js
browser/devtools/webconsole/test/browser/browser_webconsole_null_and_undefined_output.js
browser/devtools/webconsole/test/browser/browser_webconsole_output_order.js
browser/devtools/webconsole/test/browser/browser_webconsole_position_ui.js
browser/devtools/webconsole/test/browser/browser_webconsole_property_panel.js
browser/devtools/webconsole/test/browser/browser_webconsole_property_provider.js
browser/devtools/webconsole/test/browser/browser_webconsole_registries.js
browser/devtools/webconsole/test/browser/browser_webconsole_view_source.js
browser/devtools/webconsole/test/browser/browser_webconsole_window_zombie.js
browser/devtools/webconsole/test/browser/head.js
browser/devtools/webconsole/test/browser/test-bug-585956-console-trace.html
browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud-iframe.html
browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud.html
browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.html
browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.js
browser/devtools/webconsole/test/browser/test-bug-595934-canvas.html
browser/devtools/webconsole/test/browser/test-bug-595934-canvas.js
browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css
browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css^headers^
browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.html
browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.css
browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.js
browser/devtools/webconsole/test/browser/test-bug-595934-dom-events.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.js
browser/devtools/webconsole/test/browser/test-bug-595934-dom-html.html
browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.html
browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.js
browser/devtools/webconsole/test/browser/test-bug-595934-html.html
browser/devtools/webconsole/test/browser/test-bug-595934-image.html
browser/devtools/webconsole/test/browser/test-bug-595934-image.jpg
browser/devtools/webconsole/test/browser/test-bug-595934-imagemap.html
browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.html
browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.xml
browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml.xhtml
browser/devtools/webconsole/test/browser/test-bug-595934-svg.xhtml
browser/devtools/webconsole/test/browser/test-bug-595934-workers.html
browser/devtools/webconsole/test/browser/test-bug-595934-workers.js
browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.html
browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.js
browser/devtools/webconsole/test/browser/test-bug-597756-reopen-closed-tab.html
browser/devtools/webconsole/test/browser/test-bug-599725-response-headers.sjs
browser/devtools/webconsole/test/browser/test-bug-600183-charset.html
browser/devtools/webconsole/test/browser/test-bug-600183-charset.html^headers^
browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.html
browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.js
browser/devtools/webconsole/test/browser/test-bug-603750-websocket.html
browser/devtools/webconsole/test/browser/test-bug-603750-websocket.js
browser/devtools/webconsole/test/browser/test-bug-613013-console-api-iframe.html
browser/devtools/webconsole/test/browser/test-bug-618078-network-exceptions.html
browser/devtools/webconsole/test/browser/test-bug-621644-jsterm-dollar.html
browser/devtools/webconsole/test/browser/test-bug-630733-response-redirect-headers.sjs
browser/devtools/webconsole/test/browser/test-bug-632275-getters.html
browser/devtools/webconsole/test/browser/test-bug-632347-iterators-generators.html
browser/devtools/webconsole/test/browser/test-bug-644419-log-limits.html
browser/devtools/webconsole/test/browser/test-bug-646025-console-file-location.html
browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html
browser/devtools/webconsole/test/browser/test-bug-678816-content.js
browser/devtools/webconsole/test/browser/test-console-extras.html
browser/devtools/webconsole/test/browser/test-console-replaced-api.html
browser/devtools/webconsole/test/browser/test-console.html
browser/devtools/webconsole/test/browser/test-data.json
browser/devtools/webconsole/test/browser/test-duplicate-error.html
browser/devtools/webconsole/test/browser/test-encoding-ISO-8859-1.html
browser/devtools/webconsole/test/browser/test-error.html
browser/devtools/webconsole/test/browser/test-file-location.js
browser/devtools/webconsole/test/browser/test-filter.html
browser/devtools/webconsole/test/browser/test-image.png
browser/devtools/webconsole/test/browser/test-mutation.html
browser/devtools/webconsole/test/browser/test-network-request.html
browser/devtools/webconsole/test/browser/test-network.html
browser/devtools/webconsole/test/browser/test-observe-http-ajax.html
browser/devtools/webconsole/test/browser/test-own-console.html
browser/devtools/webconsole/test/browser/test-property-provider.html
browser/devtools/webconsole/test/browser/testscript.js
intl/chardet/public/nsICharsetResolver.idl
ipc/chromium/src/base/sha2.cc
ipc/chromium/src/base/sha2.h
ipc/chromium/src/base/sha2_unittest.cc
ipc/chromium/src/base/third_party/nss/README.chromium
ipc/chromium/src/base/third_party/nss/blapi.h
ipc/chromium/src/base/third_party/nss/blapit.h
ipc/chromium/src/base/third_party/nss/sha256.h
ipc/chromium/src/base/third_party/nss/sha512.cc
js/src/find-child.py
js/src/jsinttypes.h
js/src/jsotypes.h
mobile/android/base/db/BrowserProvider.java
testing/mochitest/pywebsocket/mod_pywebsocket/_stream_hybi06.py
testing/mochitest/pywebsocket/mod_pywebsocket/handshake/hybi06.py
toolkit/components/aboutmemory/tests/chrome/Makefile.in
toolkit/components/aboutmemory/tests/chrome/test_aboutmemory.xul
toolkit/components/aboutmemory/tests/chrome/test_asyncClose_leak.xul
toolkit/components/startup/tests/browser/Makefile.in
toolkit/components/startup/tests/browser/beforeunload.html
toolkit/components/startup/tests/browser/browser_bug511456.js
toolkit/components/startup/tests/browser/browser_bug537449.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_AllOS1.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_AllOS2.js
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -209,16 +209,20 @@ protected:
     static void NotifyA11yInitOrShutdown(bool aIsInit);
 
     // Static data, we do our own refcounting for our static data
     static nsIStringBundle *gStringBundle;
 
     static bool gIsFormFillEnabled;
 
 private:
+  nsAccessNode();
+  nsAccessNode(const nsAccessNode&);
+  nsAccessNode& operator =(const nsAccessNode&);
+  
   static nsApplicationAccessible *gApplicationAccessible;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsAccessNode,
                               NS_ACCESSNODE_IMPL_CID)
 
 #endif
 
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -1194,23 +1194,21 @@ nsAccessibilityService::GetOrCreateAcces
   if (!newAcc) {
     // Elements may implement nsIAccessibleProvider via XBL. This allows them to
     // say what kind of accessible to create.
     newAcc = CreateAccessibleByType(content, aWeakShell);
   }
 
   if (!newAcc) {
     // Create generic accessibles for SVG and MathML nodes.
-    if (content->GetNameSpaceID() == kNameSpaceID_SVG &&
-        content->Tag() == nsGkAtoms::svg) {
+    if (content->IsSVG(nsGkAtoms::svg)) {
       newAcc = new nsEnumRoleAccessible(content, aWeakShell,
                                         nsIAccessibleRole::ROLE_DIAGRAM);
     }
-    else if (content->GetNameSpaceID() == kNameSpaceID_MathML &&
-             content->Tag() == nsGkAtoms::math) {
+    else if (content->IsMathML(nsGkAtoms::math)) {
       newAcc = new nsEnumRoleAccessible(content, aWeakShell,
                                         nsIAccessibleRole::ROLE_EQUATION);
     }
   }
 
   if (!newAcc) {
     newAcc = CreateAccessibleForDeckChild(weakFrame.GetFrame(), content,
                                           aWeakShell);
--- a/accessible/src/mac/nsAccessibleWrap.h
+++ b/accessible/src/mac/nsAccessibleWrap.h
@@ -60,19 +60,16 @@
 #endif
 
 class nsAccessibleWrap : public nsAccessible
 {
   public: // construction, destruction
     nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
     virtual ~nsAccessibleWrap();
     
-    // creates the native accessible connected to this one.
-    virtual bool Init ();
-    
     // get the native obj-c object (mozAccessible)
     NS_IMETHOD GetNativeInterface (void **aOutAccessible);
     
     // the objective-c |Class| type that this accessible's native object
     // should be instantied with.   used on runtime to determine the
     // right type for this accessible's associated native object.
     virtual Class GetNativeType ();
 
@@ -88,32 +85,52 @@ class nsAccessibleWrap : public nsAccess
     bool HasPopup () {
       return (NativeState() & mozilla::a11y::states::HASPOPUP);
     }
     
     // return this accessible's all children, adhering to "flat" accessibles by not returning their children.
     void GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray);
     virtual already_AddRefed<nsIAccessible> GetUnignoredParent();
     
-  protected:
+protected:
 
-    virtual nsresult FirePlatformEvent(AccEvent* aEvent);
+  virtual nsresult FirePlatformEvent(AccEvent* aEvent);
 
   /**
    * Return true if the parent doesn't have children to expose to AT.
    */
   bool AncestorIsFlat();
 
   /**
-   * mozAccessible object. If we are in Objective-C, we use the actual Obj-C class.
+   * Get the native object. Create it if needed.
    */
 #if defined(__OBJC__)
+  mozAccessible* GetNativeObject();
+#else
+  id GetNativeObject();
+#endif
+
+private:
+
+  /**
+   * Our native object. Private because its creation is done lazily.
+   * Don't access it directly. Ever. Unless you are GetNativeObject() or Shutdown()
+   */
+#if defined(__OBJC__)
+  // if we are in Objective-C, we use the actual Obj-C class.
   mozAccessible* mNativeObject;
 #else
-  id mNativeObject;  
+  id mNativeObject;
 #endif
+
+  /**
+   * We have created our native. This does not mean there is one.
+   * This can never go back to false.
+   * We need it because checking whether we need a native object cost time.
+   */
+  bool mNativeInited;  
 };
 
 // Define unsupported wrap classes here
 typedef class nsHTMLTableCellAccessible    nsHTMLTableCellAccessibleWrap;
 typedef class nsHTMLTableAccessible        nsHTMLTableAccessibleWrap;
 
 #endif
--- a/accessible/src/mac/nsAccessibleWrap.mm
+++ b/accessible/src/mac/nsAccessibleWrap.mm
@@ -42,56 +42,48 @@
 #import "nsRoleMap.h"
 
 #import "mozAccessible.h"
 #import "mozActionElements.h"
 #import "mozTextAccessible.h"
 
 nsAccessibleWrap::
   nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
-  nsAccessible(aContent, aShell), mNativeObject(nil)
+  nsAccessible(aContent, aShell), mNativeObject(nil),
+  mNativeInited(false)
 {
 }
 
 nsAccessibleWrap::~nsAccessibleWrap()
 {
 }
 
-bool
-nsAccessibleWrap::Init () 
+mozAccessible* 
+nsAccessibleWrap::GetNativeObject()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
-
-  if (!nsAccessible::Init())
-    return false;
-
-  if (!mNativeObject && !AncestorIsFlat()) {
-    // Create our native object using the class type specified in GetNativeType().
+  
+  if (!mNativeInited && !mNativeObject && !IsDefunct() && !AncestorIsFlat())
     mNativeObject = [[GetNativeType() alloc] initWithAccessible:this];
-    if(!mNativeObject)
-      return false;
-  }
-
-  return true;
+  
+  mNativeInited = true;
   
-  NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
+  return mNativeObject;
+  
+  NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 NS_IMETHODIMP
 nsAccessibleWrap::GetNativeInterface (void **aOutInterface) 
 {
   NS_ENSURE_ARG_POINTER(aOutInterface);
 
-  *aOutInterface = nsnull;
-  
-  if (mNativeObject) {
-    *aOutInterface = static_cast<void*>(mNativeObject);
-    return NS_OK;
-  }
-  return NS_ERROR_FAILURE;
+  *aOutInterface = static_cast<void*>(GetNativeObject());
+    
+  return *aOutInterface ? NS_OK : NS_ERROR_FAILURE;
 }
 
 // overridden in subclasses to create the right kind of object. by default we create a generic
 // 'mozAccessible' node.
 Class
 nsAccessibleWrap::GetNativeType () 
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
@@ -139,22 +131,26 @@ nsAccessibleWrap::GetNativeType ()
 }
 
 // this method is very important. it is fired when an accessible object "dies". after this point
 // the object might still be around (because some 3rd party still has a ref to it), but it is
 // in fact 'dead'.
 void
 nsAccessibleWrap::Shutdown ()
 {
+  // this ensure we will not try to re-create the native object.
+  mNativeInited = true;
+
+  // we really intend to access the member directly.
   if (mNativeObject) {
     [mNativeObject expire];
     [mNativeObject release];
     mNativeObject = nil;
   }
-  
+
   nsAccessible::Shutdown();
 }
 
 nsresult
 nsAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
@@ -200,32 +196,32 @@ nsAccessibleWrap::FirePlatformEvent(AccE
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 void
 nsAccessibleWrap::InvalidateChildren()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
-  if (mNativeObject)
-    [mNativeObject invalidateChildren];
+  [GetNativeObject() invalidateChildren];
 
   nsAccessible::InvalidateChildren();
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 // if we for some reason have no native accessible, we should be skipped over (and traversed)
 // when fetching all unignored children, etc.  when counting unignored children, we will not be counted.
 bool 
 nsAccessibleWrap::IsIgnored() 
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
   
-  return (mNativeObject == nil) || [mNativeObject accessibilityIsIgnored];
+  mozAccessible* nativeObject = GetNativeObject();
+  return (!nativeObject) || [nativeObject accessibilityIsIgnored];
   
   NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
 }
 
 void
 nsAccessibleWrap::GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray)
 {
   // we're flat; there are no children.
--- a/accessible/src/mac/nsDocAccessibleWrap.h
+++ b/accessible/src/mac/nsDocAccessibleWrap.h
@@ -43,17 +43,11 @@
 
 class nsDocAccessibleWrap: public nsDocAccessible
 {
 public:
   nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                       nsIWeakReference *aShell);
   virtual ~nsDocAccessibleWrap();
 
-  // nsIAccessNode
-
-  /**
-   * Creates the native accessible connected to this one.
-   */
-  virtual bool Init();
 };
 
 #endif
--- a/accessible/src/mac/nsDocAccessibleWrap.mm
+++ b/accessible/src/mac/nsDocAccessibleWrap.mm
@@ -45,23 +45,8 @@ nsDocAccessibleWrap::
   nsDocAccessible(aDocument, aRootContent, aShell)
 {
 }
 
 nsDocAccessibleWrap::~nsDocAccessibleWrap()
 {
 }
 
-bool
-nsDocAccessibleWrap::Init () 
-{
-  if (!nsDocAccessible::Init())
-    return false;
-
-  if (!mNativeObject) {
-    // Create our native object using the class type specified in GetNativeType().
-    mNativeObject = [[GetNativeType() alloc] initWithAccessible:this];
-    if (!mNativeObject)
-      return false;
-  }
-
-  return true;
-}
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -61,16 +61,17 @@ pref("browser.cache.disk.smart_size.firs
 pref("browser.cache.memory.enable", true);
 pref("browser.cache.memory.capacity", 1024); // kilobytes
 
 /* image cache prefs */
 pref("image.cache.size", 1048576); // bytes
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", false);
+pref("browser.cache.offline.enable", false);
 
 /* protocol warning prefs */
 pref("network.protocol-handler.warn-external.tel", false);
 pref("network.protocol-handler.warn-external.mailto", false);
 pref("network.protocol-handler.warn-external.vnd.youtube", false);
 
 /* http prefs */
 pref("network.http.pipelining", true);
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -67,21 +67,29 @@ function startupHttpd(baseDir, port) {
   let httpd = {};
   Services.scriptloader.loadSubScript(httpdURL, httpd);
   let server = new httpd.nsHttpServer();
   server.registerDirectory('/', new LocalFile(baseDir));
   server.registerContentType('appcache', 'text/cache-manifest');
   server.start(port);
 }
 
-// XXX until we have a security model, just let the pre-installed
-// app used indexedDB.
-function allowIndexedDB(url) {
-  let uri = Services.io.newURI(url, null, null);
-  Services.perms.add(uri, 'indexedDB', Ci.nsIPermissionManager.ALLOW_ACTION);
+// FIXME Bug 707625
+// until we have a proper security model, add some rights to
+// the pre-installed web applications 
+function addPermissions(urls) {
+  let permissions = ['indexedDB', 'webapps-manage', 'offline-app'];
+  urls.forEach(function(url) {
+    let uri = Services.io.newURI(url, null, null);
+    let allow = Ci.nsIPermissionManager.ALLOW_ACTION;
+    
+    permissions.forEach(function(permission) {
+      Services.perms.add(uri, permission, allow);
+    });
+  });
 }
 
 
 var shell = {
   get home() {
     delete this.home;
     return this.home = document.getElementById('homescreen');
   },
@@ -130,17 +138,17 @@ var shell = {
         baseDir = baseDir.join('/');
 
         const SERVER_PORT = 8888;
         startupHttpd(baseDir, SERVER_PORT);
 
         let baseHost = 'http://localhost';
         homeURL = homeURL.replace(baseDir, baseHost + ':' + SERVER_PORT);
       }
-      allowIndexedDB(homeURL);
+      addPermissions([homeURL]);
     } catch (e) {
       let msg = 'Fatal error during startup: [' + e + '[' + homeURL + ']';
       return alert(msg);
     }
 
     let browser = this.home;
     browser.homePage = homeURL;
     browser.goHome();
@@ -167,17 +175,17 @@ var shell = {
 
   isCommandEnabled: function shell_isCommandEnabled(cmd) {
     return true;
   },
 
   doCommand: function shell_doCommand(cmd) {
     switch (cmd) {
       case 'cmd_close':
-        this.sendEvent(this.home.contentWindow, 'appclose');
+        this.home.contentWindow.postMessage('appclose', '*');
         break;
     }
   },
 
   handleEvent: function shell_handleEvent(evt) {
     switch (evt.type) {
       case 'keypress':
         switch (evt.keyCode) {
@@ -195,30 +203,41 @@ var shell = {
         }
         break;
       case 'load':
         this.home.removeEventListener('load', this, true);
         this.sendEvent(window, 'ContentStart');
         break;
       case 'MozApplicationManifest':
         try {
+          if (!Services.prefs.getBoolPref('browser.cache.offline.enable'))
+            return;
+
           let contentWindow = evt.originalTarget.defaultView;
           let documentElement = contentWindow.document.documentElement;
           if (!documentElement)
             return;
 
           let manifest = documentElement.getAttribute("manifest");
           if (!manifest)
             return;
 
           let documentURI = contentWindow.document.documentURIObject;
-          let manifestURI = Services.io.newURI(manifest, null, documentURI);
+          if (!Services.perms.testPermission(documentURI, 'offline-app')) {
+            if (Services.prefs.getBoolPref('browser.offline-apps.notify')) {
+              // FIXME Bug 710729 - Add a UI for offline cache notifications
+              return;
+            }
+            return;
+          }
+
           Services.perms.add(documentURI, 'offline-app',
                              Ci.nsIPermissionManager.ALLOW_ACTION);
 
+          let manifestURI = Services.io.newURI(manifest, null, documentURI);
           let updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
                               .getService(Ci.nsIOfflineCacheUpdateService);
           updateService.scheduleUpdate(manifestURI, documentURI, window);
         } catch (e) {
           dump('Error while creating offline cache: ' + e + '\n');
         }
         break;
     }
--- a/browser/Makefile.in
+++ b/browser/Makefile.in
@@ -42,16 +42,17 @@ VPATH     = @srcdir@
 
 include $(topsrcdir)/config/config.mk
 
 PARALLEL_DIRS = \
   base \
   components \
   fuel \
   locales \
+  modules \
   themes \
   $(NULL)
 
 DIRS = \
   devtools \
   app \
   $(NULL)
 
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -175,69 +175,67 @@ endif
 libs:: $(srcdir)/profile/prefs.js
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
 
 libs:: $(srcdir)/blocklist.xml
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
-APP_NAME = $(MOZ_APP_DISPLAYNAME)
+MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
 
 ifdef MOZ_DEBUG
-APP_NAME := $(APP_NAME)Debug
+MAC_APP_NAME := $(MAC_APP_NAME)Debug
 endif
 
-LOWER_APP_NAME = $(shell echo $(APP_NAME) | tr '[A-Z]' '[a-z]')
+LOWER_MAC_APP_NAME = $(shell echo $(MAC_APP_NAME) | tr '[A-Z]' '[a-z]')
 
 AB_CD = $(MOZ_UI_LOCALE)
 
 AB := $(firstword $(subst -, ,$(AB_CD)))
 
 clean clobber repackage::
-	$(RM) -r $(DIST)/$(APP_NAME).app
+	$(RM) -r $(DIST)/$(MOZ_MACBUNDLE_NAME)
 
 ifdef LIBXUL_SDK
 APPFILES = Resources
 else
 APPFILES = MacOS
 endif
 
 libs repackage:: $(PROGRAM)
-	$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/MacOS
-	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
-	$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
-	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
-	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%LOWER_APP_NAME%/$(LOWER_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
-	sed -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
-	rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
-	$(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
+	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
+	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
+	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist
+	sed -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj/InfoPlist.strings
+	rsync -a $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
+	$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/mangle $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/shlibsign
 ifdef LIBXUL_SDK
-	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox
+	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/firefox
 else
-	$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
-	rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
+	$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
+	rsync -aL $(PROGRAM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
 endif
-	-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
-	cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
-	cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns
-	printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
-#       remove CVS dirs from packaged app
-	find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;
+	-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
+	cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/firefox.icns
+	cp -RL $(DIST)/branding/document.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/document.icns
+	printf APPLMOZB > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo
 
 else
 ifdef LIBXUL_SDK
 libs::
 	cp $(LIBXUL_DIST)/bin/$(XULRUNNER_STUB_NAME)$(BIN_SUFFIX) $(DIST)/bin/firefox$(BIN_SUFFIX)
 endif
 endif
 
 ifdef LIBXUL_SDK
 ifndef SKIP_COPY_XULRUNNER
 libs::
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-	rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
+	rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Frameworks
 else
 	$(NSINSTALL) -D $(DIST)/bin/xulrunner
 	(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
 endif # cocoa
 endif # SKIP_COPY_XULRUNNER
 endif # LIBXUL_SDK
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -220,9 +220,9 @@
             <feature>DIRECT3D_9_LAYERS</feature>
       <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
       <driverVersion>7.0.0.0</driverVersion>
       <driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
     </gfxBlacklistEntry>
     </gfxItems>
 
 
-</blocklist>
\ No newline at end of file
+</blocklist>
--- a/browser/app/macbuild/Contents/Info.plist.in
+++ b/browser/app/macbuild/Contents/Info.plist.in
@@ -140,25 +140,25 @@
 			<string>HTML5 Video (WebM)</string>
 			<key>CFBundleTypeRole</key>
 			<string>Viewer</string>
 		</dict>
 	</array>
 	<key>CFBundleExecutable</key>
 	<string>firefox</string>
 	<key>CFBundleGetInfoString</key>
-	<string>%APP_NAME% %APP_VERSION%</string>
+	<string>%MAC_APP_NAME% %APP_VERSION%</string>
 	<key>CFBundleIconFile</key>
 	<string>firefox</string>
 	<key>CFBundleIdentifier</key>
-	<string>org.mozilla.%LOWER_APP_NAME%</string>
+	<string>org.mozilla.%LOWER_MAC_APP_NAME%</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>%APP_NAME%</string>
+	<string>%MAC_APP_NAME%</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<string>%APP_VERSION%</string>
 	<key>CFBundleSignature</key>
 	<string>MOZB</string>
 	<key>CFBundleURLTypes</key>
 	<array>
--- a/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
+++ b/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
@@ -1,1 +1,1 @@
-CFBundleName = "%APP_NAME%";
+CFBundleName = "%MAC_APP_NAME%";
--- a/browser/base/Makefile.in
+++ b/browser/base/Makefile.in
@@ -48,21 +48,16 @@ include $(topsrcdir)/config/config.mk
 abs_srcdir = $(call core_abspath,$(srcdir))
 
 CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
 
 ifdef ENABLE_TESTS
 DIRS += content/test
 endif
 
-EXTRA_JS_MODULES = \
-	content/openLocationLastURL.jsm \
-	content/NetworkPrioritizer.jsm \
-	$(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 PRE_RELEASE_SUFFIX := ""
 
 DEFINES += \
 	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 	-DAPP_LICENSE_BLOCK=$(abs_srcdir)/content/overrides/app-license.html \
 	-DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)" \
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -202,17 +202,17 @@ let gInitialPages = [
 #endif
 
 XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
 #ifdef XP_WIN
   const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
   if (WINTASKBAR_CONTRACTID in Cc &&
       Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
     let temp = {};
-    Cu.import("resource://gre/modules/WindowsPreviewPerTab.jsm", temp);
+    Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", temp);
     let AeroPeek = temp.AeroPeek;
     return {
       onOpenWindow: function () {
         AeroPeek.onOpenWindow(window);
       },
       onCloseWindow: function () {
         AeroPeek.onCloseWindow(window);
       }
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -221,17 +221,17 @@ function onIndexedDBClear()
 
   var permissionManager = Components.classes[PERMISSION_CONTRACTID]
                                     .getService(nsIPermissionManager);
   permissionManager.remove(gPermURI.host, "indexedDB");
   permissionManager.remove(gPermURI.host, "indexedDB-unlimited");
   initIndexedDBRow();
 }
 
-function onIndexedDBUsageCallback(uri, usage)
+function onIndexedDBUsageCallback(uri, usage, fileUsage)
 {
   if (!uri.equals(gPermURI)) {
     throw new Error("Callback received for bad URI: " + uri);
   }
 
   if (usage) {
     if (!("DownloadUtils" in window)) {
       Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -86,17 +86,16 @@ endif
 # back to the clear recent history dialog (santize.xul), if it ever is (bug
 # 480169)
 
 # browser_drag.js is disabled, as it needs to be updated for the new behavior from bug 320638.
 
 _BROWSER_FILES = \
                  browser_typeAheadFind.js \
                  browser_keywordSearch.js \
-                 browser_NetworkPrioritizer.js \
                  browser_allTabsPanel.js \
                  browser_alltabslistener.js \
                  browser_bug304198.js \
                  browser_bug321000.js \
                  title_test.svg \
                  browser_bug329212.js \
                  browser_bug356571.js \
                  browser_bug380960.js \
--- a/browser/components/Makefile.in
+++ b/browser/components/Makefile.in
@@ -64,32 +64,26 @@ PARALLEL_DIRS = \
   dirprovider \
   feeds \
   places \
   preferences \
   privatebrowsing \
   search \
   sessionstore \
   shell \
-  sidebar/src \
+  sidebar \
   tabview \
   migration \
   $(NULL)
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),windows) 
-PARALLEL_DIRS += wintaskbar
-endif
-
 ifdef MOZ_SAFE_BROWSING
 PARALLEL_DIRS += safebrowsing
 endif
 
-ifdef ENABLE_TESTS
-DIRS += test/browser
-endif
+TEST_DIRS += test
 
 DIRS += build
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DOFFICIAL_BUILD=1
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/browser/components/build/nsBrowserCompsCID.h
+++ b/browser/components/build/nsBrowserCompsCID.h
@@ -43,19 +43,16 @@
 { 0xbc15c73d, 0xc05b, 0x497b, { 0xa3, 0x73, 0x4b, 0xae, 0x6c, 0x17, 0x86, 0x31 } }
 #endif
 
 #ifdef XP_MACOSX
 #define NS_SAFARIPROFILEMIGRATOR_CID \
 { 0x29e3b139, 0xad19, 0x44f3, { 0xb2, 0xc2, 0xe9, 0xf1, 0x3b, 0xa2, 0xbb, 0xc6 } }
 #endif
 
-#define NS_OPERAPROFILEMIGRATOR_CID \
-{ 0xf34ff792, 0x722e, 0x4490, { 0xb1, 0x95, 0x47, 0xd2, 0x42, 0xed, 0xca, 0x1c } }
-
 #define NS_SHELLSERVICE_CID \
 { 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }
 
 #define NS_SHELLSERVICE_CONTRACTID \
   "@mozilla.org/browser/shell-service;1"
 
 #define NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID \
 { 0x7a024bcf, 0xedd5, 0x4d9a, { 0x86, 0x14, 0xd4, 0x4b, 0xe1, 0xda, 0xda, 0xd3 } }
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -45,19 +45,16 @@
 #include "nsWindowsShellService.h"
 #elif defined(XP_MACOSX)
 #include "nsMacShellService.h"
 #elif defined(MOZ_WIDGET_GTK2)
 #include "nsGNOMEShellService.h"
 #endif
 
 #include "nsProfileMigrator.h"
-#if !defined(XP_OS2)
-#include "nsOperaProfileMigrator.h"
-#endif
 #if defined(XP_WIN) && !defined(__MINGW32__)
 #include "nsIEProfileMigrator.h"
 #elif defined(XP_MACOSX)
 #include "nsSafariProfileMigrator.h"
 #endif
 
 #include "rdf.h"
 #include "nsFeedSniffer.h"
@@ -75,19 +72,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(Directory
 #if defined(XP_WIN)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
 #elif defined(MOZ_WIDGET_GTK2)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
 
-#if !defined(XP_OS2)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator)
-#endif
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
 #if defined(XP_WIN) && !defined(__MINGW32__)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEProfileMigrator)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafariProfileMigrator)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
@@ -104,19 +98,16 @@ NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
 NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_FIREFOX_PROFILEMIGRATOR_CID);
 #if defined(XP_WIN) && !defined(__MINGW32__)
 NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
 #elif defined(XP_MACOSX)
 NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_SAFARIPROFILEMIGRATOR_CID);
 #endif
-#if !defined(XP_OS2)
-NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID);
-#endif
 NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
 
 static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
     { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, NULL, DirectoryProviderConstructor },
 #if defined(XP_WIN)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
 #elif defined(MOZ_WIDGET_GTK2)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsGNOMEShellServiceConstructor },
@@ -125,19 +116,16 @@ static const mozilla::Module::CIDEntry k
     { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
     { &kNS_FIREFOX_PROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
 #if defined(XP_WIN) && !defined(__MINGW32__)
     { &kNS_WINIEPROFILEMIGRATOR_CID, false, NULL, nsIEProfileMigratorConstructor },
 #elif defined(XP_MACOSX)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
     { &kNS_SAFARIPROFILEMIGRATOR_CID, false, NULL, nsSafariProfileMigratorConstructor },
 #endif
-#if !defined(XP_OS2)
-    { &kNS_OPERAPROFILEMIGRATOR_CID, false, NULL, nsOperaProfileMigratorConstructor },
-#endif
     { &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
     { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
     { NS_BROWSERDIRECTORYPROVIDER_CONTRACTID, &kNS_BROWSERDIRECTORYPROVIDER_CID },
 #if defined(XP_WIN)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
@@ -162,19 +150,16 @@ static const mozilla::Module::ContractID
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
     { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_FIREFOX_PROFILEMIGRATOR_CID },
 #if defined(XP_WIN) && !defined(__MINGW32__)
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "ie", &kNS_WINIEPROFILEMIGRATOR_CID },
 #elif defined(XP_MACOSX)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "safari", &kNS_SAFARIPROFILEMIGRATOR_CID },
 #endif
-#if !defined(XP_OS2)
-    { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "opera", &kNS_OPERAPROFILEMIGRATOR_CID },
-#endif
     { NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
     { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kBrowserCategories[] = {
     { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "browser-directory-provider", NS_BROWSERDIRECTORYPROVIDER_CONTRACTID },
     { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
     { NULL }
--- a/browser/components/feeds/src/FeedWriter.js
+++ b/browser/components/feeds/src/FeedWriter.js
@@ -760,17 +760,17 @@ FeedWriter.prototype = {
         if (this._selectedApp) {
           // XXXben - we need to compare this with the running instance executable
           //          just don't know how to do that via script...
           // XXXmano TBD: can probably add this to nsIShellService
 #ifdef XP_WIN
 #expand           if (fp.file.leafName != "__MOZ_APP_NAME__.exe") {
 #else
 #ifdef XP_MACOSX
-#expand           if (fp.file.leafName != "__MOZ_APP_DISPLAYNAME__.app") {
+#expand           if (fp.file.leafName != "__MOZ_MACBUNDLE_NAME__") {
 #else
 #expand           if (fp.file.leafName != "__MOZ_APP_NAME__-bin") {
 #endif
 #endif
             this._initMenuItemWithFile(this._contentSandbox.selectedAppMenuItem,
                                        this._selectedApp);
 
             // Show and select the selected application menuitem
--- a/browser/components/feeds/src/Makefile.in
+++ b/browser/components/feeds/src/Makefile.in
@@ -45,17 +45,17 @@ MODULE = browser_feeds
 LIBRARY_NAME = browser_feeds_s
 FORCE_STATIC_LIB = 1
 ifndef MOZ_MEMORY
 USE_STATIC_LIBS = 1
 endif
 
 DEFINES += \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-	-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
+	-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
 	$(NULL)
 
 EXTRA_COMPONENTS = \
   BrowserFeeds.manifest \
   $(NULL)
 
 EXTRA_PP_COMPONENTS = \
 	FeedConverter.js \
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -328,19 +328,16 @@ var MigrationWizard = {
     singleStart.setAttribute("label", mainStr);
     singleStart.setAttribute("value", "DEFAULT");
 
     var source = null;
     switch (this._source) {
       case "ie":
         source = "sourceNameIE";
         break;
-      case "opera":
-        source = "sourceNameOpera";
-        break;
       case "safari":
         source = "sourceNameSafari";
         break;
       case "chrome":
         source = "sourceNameChrome";
         break;
     }
 
--- a/browser/components/migration/content/migration.xul
+++ b/browser/components/migration/content/migration.xul
@@ -65,24 +65,20 @@
     <description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description>
 
     <radiogroup id="importSourceGroup" align="start">
       <!-- If you are adding a migrator, please add the appropriate
            hooks to GetDefaultBrowserMigratorKey in
            browser/components/migration/src/nsProfileMigrator.cpp -->
 #ifdef XP_MACOSX
       <radio id="safari"    label="&importFromSafari.label;"    accesskey="&importFromSafari.accesskey;"/>
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
-#elifdef XP_UNIX
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
 #elifdef XP_WIN
 #ifndef NO_IE_MIGRATOR
       <radio id="ie"        label="&importFromIE.label;"        accesskey="&importFromIE.accesskey;"/>
 #endif
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
 #endif
       <radio id="chrome"    label="&importFromChrome.label;"    accesskey="&importFromChrome.accesskey;"/>
       <radio id="fromfile"  label="&importFromHTMLFile.label;"  accesskey="&importFromHTMLFile.accesskey;" hidden="true"/>
       <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
     </radiogroup>
     <label id="noSources" hidden="true">&noMigrationSources.label;</label>
   </wizardpage>
 
--- a/browser/components/migration/src/Makefile.in
+++ b/browser/components/migration/src/Makefile.in
@@ -48,20 +48,16 @@ ifndef MOZ_MEMORY
 USE_STATIC_LIBS = 1
 endif
 
 
 CPPSRCS  = nsProfileMigrator.cpp \
            nsBrowserProfileMigratorUtils.cpp \
            $(NULL)
 
-ifneq ($(OS_ARCH),OS2)
-CPPSRCS += nsOperaProfileMigrator.cpp
-endif
-
 ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
 CPPSRCS += nsIEProfileMigrator.cpp \
            $(NULL)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += nsSafariProfileMigrator.cpp \
            $(NULL)
--- a/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
+++ b/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
@@ -37,18 +37,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsBrowserProfileMigratorUtils.h"
 #include "nsINavBookmarksService.h"
 #include "nsBrowserCompsCID.h"
 #include "nsToolkitCompsCID.h"
 #include "nsIPlacesImportExportService.h"
 #include "nsIFile.h"
-#include "nsIInputStream.h"
-#include "nsILineInputStream.h"
 #include "nsIProperties.h"
 #include "nsIProfileMigrator.h"
 
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsISupportsPrimitives.h"
 
 #include "nsAppDirectoryServiceDefs.h"
@@ -160,67 +158,16 @@ GetProfilePath(nsIProfileStartup* aStart
       (do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
     if (dirSvc) {
       dirSvc->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsIFile),
                   (void**) getter_AddRefs(aProfileDir));
     }
   }
 }
 
-nsresult 
-AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
-                              nsIFile* aTargetBookmarksFile,
-                              const char* aToolbarFolderName)
-{
-  nsCOMPtr<nsIInputStream> fileInputStream;
-  nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream),
-                                           aSourceBookmarksFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIOutputStream> outputStream;
-  rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream),
-                                   aTargetBookmarksFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsILineInputStream> lineInputStream =
-    do_QueryInterface(fileInputStream, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCAutoString sourceBuffer;
-  nsCAutoString targetBuffer;
-  bool moreData = false;
-  PRUint32 bytesWritten = 0;
-  do {
-    lineInputStream->ReadLine(sourceBuffer, &moreData);
-    if (!moreData)
-      break;
-
-    PRInt32 nameOffset = sourceBuffer.Find(aToolbarFolderName);
-    if (nameOffset >= 0) {
-      // Found the personal toolbar name on a line, check to make sure it's
-      // actually a folder. 
-      NS_NAMED_LITERAL_CSTRING(folderPrefix, "<DT><H3 ");
-      PRInt32 folderPrefixOffset = sourceBuffer.Find(folderPrefix);
-      if (folderPrefixOffset >= 0)
-        sourceBuffer.Insert(NS_LITERAL_CSTRING("PERSONAL_TOOLBAR_FOLDER=\"true\" "), 
-                            folderPrefixOffset + folderPrefix.Length());
-    }
-
-    targetBuffer.Assign(sourceBuffer);
-    targetBuffer.Append("\r\n");
-    outputStream->Write(targetBuffer.get(), targetBuffer.Length(),
-                        &bytesWritten);
-  }
-  while (1);
-  
-  outputStream->Close();
-  
-  return NS_OK;
-}
-
 nsresult
 ImportBookmarksHTML(nsIFile* aBookmarksFile, 
                     bool aImportIntoRoot,
                     bool aOverwriteDefaults,
                     const PRUnichar* aImportSourceNameKey)
 {
   nsresult rv;
 
--- a/browser/components/migration/src/nsBrowserProfileMigratorUtils.h
+++ b/browser/components/migration/src/nsBrowserProfileMigratorUtils.h
@@ -94,25 +94,16 @@ void GetMigrateDataFromArray(MigrationDa
                              nsIFile* aSourceProfile, 
                              PRUint16* aResult);
 
 
 // get the base directory of the *target* profile
 // this is already cloned, modify it to your heart's content
 void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
 
-// The Netscape Bookmarks Format (bookmarks.html) is fairly standard but
-// each browser vendor seems to have their own way of identifying the 
-// Personal Toolbar Folder. This function scans for the vendor-specific
-// name in the source Bookmarks file and then writes out a normalized
-// variant into the target folder. 
-nsresult AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
-                                       nsIFile* aTargetBookmarksFile,
-                                       const char* aToolbarFolderName);
-
 // In-place import from aBookmarksFile into a folder in the user's bookmarks.
 // If the importIntoRoot parameter has a value of true, the bookmarks will be
 // imported into the bookmarks root folder. Otherwise, they'll be imported into
 // a new folder with the name "From (STR:aImportSourceNameKey)".
 // aImportSourceNameKey is a key into migration.properties with the pretty name
 // of the application.
 nsresult ImportBookmarksHTML(nsIFile* aBookmarksFile, 
                              bool aImportIntoRoot,
deleted file mode 100644
--- a/browser/components/migration/src/nsOperaProfileMigrator.cpp
+++ /dev/null
@@ -1,1459 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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 Browser Profile Migrator.
- *
- * The Initial Developer of the Original Code is Ben Goodger.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ben Goodger <ben@bengoodger.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 ***** */
-
-#include "mozilla/Util.h"
-
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsBrowserProfileMigratorUtils.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsDirectoryServiceUtils.h"
-#include "nsDocShellCID.h"
-#include "nsINavBookmarksService.h"
-#include "nsBrowserCompsCID.h"
-#include "nsIBrowserProfileMigrator.h"
-#include "nsIBrowserHistory.h"
-#include "nsICookieManager2.h"
-#include "nsIGlobalHistory.h"
-#include "nsIInputStream.h"
-#include "nsILineInputStream.h"
-#include "nsILocalFile.h"
-#include "nsINIParser.h"
-#include "nsIObserverService.h"
-#include "nsIPermissionManager.h"
-#include "nsIPrefLocalizedString.h"
-#include "nsIPrefService.h"
-#include "nsIProfileMigrator.h"
-#include "nsIProperties.h"
-#include "nsIRDFContainer.h"
-#include "nsIRDFService.h"
-#include "nsIServiceManager.h"
-#include "nsIStringBundle.h"
-#include "nsISupportsPrimitives.h"
-#include "nsNetUtil.h"
-#include "nsOperaProfileMigrator.h"
-#include "nsToolkitCompsCID.h"
-#ifdef XP_WIN
-#include <windows.h>
-#endif
-
-using namespace mozilla;
-
-#define MIGRATION_BUNDLE "chrome://browser/locale/migration/migration.properties"
-
-#ifdef XP_WIN
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr")
-#elif defined(XP_MACOSX)
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera 6 Preferences")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("Opera 6 Preferences")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("Opera Global History")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Bookmarks")
-#elif defined (XP_UNIX)
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING(".opera")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr")
-#else
-#error Need to define location of Opera Profile data.
-#endif
-
-#define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies4.dat")
-
-///////////////////////////////////////////////////////////////////////////////
-// nsBrowserProfileMigrator
-
-NS_IMPL_ISUPPORTS1(nsOperaProfileMigrator, nsIBrowserProfileMigrator)
-
-nsOperaProfileMigrator::nsOperaProfileMigrator()
-{
-  mObserverService = do_GetService("@mozilla.org/observer-service;1");
-}
-
-nsOperaProfileMigrator::~nsOperaProfileMigrator()
-{
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
-{
-  nsresult rv = NS_OK;
-  bool aReplace = aStartup ? true : false;
-
-  if (aStartup) {
-    rv = aStartup->DoStartup();
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  if (!mOperaProfile)
-    GetOperaProfile(aProfile, getter_AddRefs(mOperaProfile));
-
-  NOTIFY_OBSERVERS(MIGRATION_STARTED, nsnull);
-
-  COPY_DATA(CopyPreferences,  aReplace, nsIBrowserProfileMigrator::SETTINGS);
-  COPY_DATA(CopyCookies,      aReplace, nsIBrowserProfileMigrator::COOKIES);
-  COPY_DATA(CopyHistory,      aReplace, nsIBrowserProfileMigrator::HISTORY);
-  COPY_DATA(CopyBookmarks,    aReplace, nsIBrowserProfileMigrator::BOOKMARKS);
-
-  NOTIFY_OBSERVERS(MIGRATION_ENDED, nsnull);
-
-  return rv;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetMigrateData(const PRUnichar* aProfile, 
-                                       bool aReplace,
-                                       PRUint16* aResult)
-{
-  *aResult = 0;
-  if (!mOperaProfile) {
-    GetOperaProfile(aProfile, getter_AddRefs(mOperaProfile));
-    if (!mOperaProfile)
-      return NS_ERROR_FILE_NOT_FOUND;
-  }
-
-  MigrationData data[] = { { ToNewUnicode(OPERA_PREFERENCES_FILE_NAME),
-                             nsIBrowserProfileMigrator::SETTINGS,
-                             false },
-                           { ToNewUnicode(OPERA_COOKIES_FILE_NAME),
-                             nsIBrowserProfileMigrator::COOKIES,
-                             false },
-                           { ToNewUnicode(OPERA_HISTORY_FILE_NAME),
-                             nsIBrowserProfileMigrator::HISTORY,
-                             false },
-                           { ToNewUnicode(OPERA_BOOKMARKS_FILE_NAME),
-                             nsIBrowserProfileMigrator::BOOKMARKS,
-                             false } };
-                                                                  
-  // Frees file name strings allocated above.
-  GetMigrateDataFromArray(data, sizeof(data)/sizeof(MigrationData), 
-                          aReplace, mOperaProfile, aResult);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceExists(bool* aResult)
-{
-  nsCOMPtr<nsIArray> profiles;
-  GetSourceProfiles(getter_AddRefs(profiles));
-
-  if (profiles) { 
-    PRUint32 count;
-    profiles->GetLength(&count);
-    *aResult = count > 0;
-  }
-  else
-    *aResult = false;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
-{
-  nsCOMPtr<nsIArray> profiles;
-  GetSourceProfiles(getter_AddRefs(profiles));
-
-#ifdef XP_WIN
-  if (profiles) {
-    PRUint32 count;
-    profiles->GetLength(&count);
-    *aResult = count > 1;
-  }
-  else
-#endif
-    *aResult = false;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceProfiles(nsIArray** aResult)
-{
-  if (!mProfiles) {
-    nsresult rv;
-
-    mProfiles = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-
-    nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
-    nsCOMPtr<nsILocalFile> file;
-#ifdef XP_WIN
-    fileLocator->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-
-    // Opera profile lives under %APP_DATA%\Opera\<operaver>\profile 
-    file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-
-    nsCOMPtr<nsISimpleEnumerator> e;
-    rv = file->GetDirectoryEntries(getter_AddRefs(e));
-    if (NS_FAILED(rv))
-      return rv;
-
-    bool hasMore;
-    e->HasMoreElements(&hasMore);
-    while (hasMore) {
-      nsCOMPtr<nsILocalFile> curr;
-      e->GetNext(getter_AddRefs(curr));
-
-      bool isDirectory = false;
-      curr->IsDirectory(&isDirectory);
-      if (isDirectory) {
-        nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
-        nsAutoString leafName;
-        curr->GetLeafName(leafName);
-        string->SetData(leafName);
-        mProfiles->AppendElement(string, false);
-      }
-
-      e->HasMoreElements(&hasMore);
-    }
-#elif defined (XP_MACOSX)
-    fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-    
-    file->Append(NS_LITERAL_STRING("Preferences"));
-    file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-    
-    bool exists;
-    file->Exists(&exists);
-    
-    if (exists) {
-      nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
-      string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
-      mProfiles->AppendElement(string, false);
-    }
-#elif defined (XP_UNIX)
-    fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-    
-    file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-    
-    bool exists;
-    file->Exists(&exists);
-    
-    if (exists) {
-      nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
-      string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
-      mProfiles->AppendElement(string, false);
-    }
-#endif
-  }
-
-  *aResult = mProfiles;
-  NS_IF_ADDREF(*aResult);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
-{
-  nsresult rv;
-  nsCAutoString val;
-
-  nsCOMPtr<nsIFile> operaPrefs;
-  mOperaProfile->Clone(getter_AddRefs(operaPrefs));
-  operaPrefs->Append(OPERA_PREFERENCES_FILE_NAME);
-
-  nsCOMPtr<nsILocalFile> lf(do_QueryInterface(operaPrefs));
-  NS_ENSURE_TRUE(lf, NS_ERROR_UNEXPECTED);
-
-  nsINIParser parser;
-  rv = parser.Init(lf);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = parser.GetString("User Prefs",
-                        "Home URL",
-                        val);
-
-  if (NS_SUCCEEDED(rv))
-    aResult.Assign(val);
-
-  return NS_OK;
-}
- 
-
-#define _OPM(type) nsOperaProfileMigrator::type
-
-static
-nsOperaProfileMigrator::PrefTransform gTransforms[] = {
-  { "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), false, { -1 } },
-  { nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), false, { -1 } },
-  { nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), false, { -1 } },
-  { nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), false, { -1 } },
-
-  { "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), false, { -1 } },
-  { "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), false, { -1 } },
-  { nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), false, { -1 } },
-
-  { nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), false, { -1 } },
-
-  { "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), false, { -1 } }
-};
-
-nsresult 
-nsOperaProfileMigrator::SetFile(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  nsCOMPtr<nsILocalFile> lf(do_CreateInstance("@mozilla.org/file/local;1"));
-  lf->InitWithPath(NS_ConvertUTF8toUTF16(xform->stringValue));
-  return aBranch->SetComplexValue(xform->targetPrefName, NS_GET_IID(nsILocalFile), lf);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetCookieBehavior(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  PRInt32 val = (xform->intValue == 3) ? 0 : (xform->intValue == 0) ? 2 : 1;
-  return aBranch->SetIntPref(xform->targetPrefName, val);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetCookieLifetime(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 2 : 0);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 1 : 2);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetBool(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetBoolPref(xform->targetPrefName, xform->boolValue);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetWString(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));
-  NS_ConvertUTF8toUTF16 data(xform->stringValue); 
-  pls->SetData(data.get());
-  return aBranch->SetComplexValue(xform->targetPrefName, NS_GET_IID(nsIPrefLocalizedString), pls);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetInt(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetIntPref(xform->targetPrefName, xform->intValue);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetString(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetCharPref(xform->targetPrefName, xform->stringValue);
-}
-
-nsresult
-nsOperaProfileMigrator::CopyPreferences(bool aReplace)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> operaPrefs;
-  mOperaProfile->Clone(getter_AddRefs(operaPrefs));
-  operaPrefs->Append(OPERA_PREFERENCES_FILE_NAME);
-
-  nsCOMPtr<nsILocalFile> lf(do_QueryInterface(operaPrefs));
-  NS_ENSURE_TRUE(lf, NS_ERROR_UNEXPECTED);
-
-  nsINIParser parser;
-  rv = parser.Init(lf);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIPrefBranch> branch(do_GetService(NS_PREFSERVICE_CONTRACTID));
-
-  // Traverse the standard transforms
-  PrefTransform* transform;
-  PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform);
-
-  const char* lastSectionName = nsnull;
-  for (transform = gTransforms; transform < end; ++transform) {
-    if (transform->sectionName)
-      lastSectionName = transform->sectionName;
-
-    if (transform->type == _OPM(COLOR)) {
-      char* colorString = nsnull;
-      nsresult rv = ParseColor(parser, lastSectionName, &colorString);
-      if (NS_SUCCEEDED(rv)) {
-        transform->stringValue = colorString;
-
-        transform->prefHasValue = true;
-        transform->prefSetterFunc(transform, branch);
-      }
-      if (colorString)
-        free(colorString);
-    }
-    else {
-      nsCAutoString val;
-      rv = parser.GetString(lastSectionName,
-                            transform->keyName,
-                            val);
-      if (NS_SUCCEEDED(rv)) {
-        nsresult strerr;
-        switch (transform->type) {
-        case _OPM(STRING):
-          transform->stringValue = ToNewCString(val);
-          break;
-        case _OPM(INT): {
-            transform->intValue = val.ToInteger(&strerr);
-          }
-          break;
-        case _OPM(BOOL): {
-            transform->boolValue = val.ToInteger(&strerr) != 0;
-          }
-          break;
-        default:
-          break;
-        }
-        transform->prefHasValue = true;
-        transform->prefSetterFunc(transform, branch);
-        if (transform->type == _OPM(STRING) && transform->stringValue) {
-          NS_Free(transform->stringValue);
-          transform->stringValue = nsnull;
-        }
-      }
-    }
-  }
-  
-  // Copy Proxy Settings
-  CopyProxySettings(parser, branch);
-
-  // Copy User Content Sheet
-  if (aReplace)
-    CopyUserContentSheet(parser);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyProxySettings(nsINIParser &aParser, 
-                                          nsIPrefBranch* aBranch)
-{
-  nsresult rv;
-
-  PRInt32 networkProxyType = 0;
-
-  const char* protocols[] = { "HTTP", "HTTPS", "FTP"  };
-  const char* protocols_l[] = { "http", "https", "ftp" };
-  char toggleBuf[15], serverBuf[20], serverPrefBuf[20], 
-       serverPortPrefBuf[25];
-  PRInt32 enabled;
-  for (PRUint32 i = 0; i < ArrayLength(protocols); ++i) {
-    sprintf(toggleBuf, "Use %s", protocols[i]);
-    GetInteger(aParser, "Proxy", toggleBuf, &enabled);
-    if (enabled) {
-      // Enable the "manual configuration" setting if we have at least
-      // one protocol using a Proxy. 
-      networkProxyType = 1;
-    }
-
-    sprintf(serverBuf, "%s Server", protocols[i]);
-    nsCAutoString proxyServer;
-    rv = aParser.GetString("Proxy", serverBuf, proxyServer);
-    if (NS_FAILED(rv))
-      continue;
-
-    sprintf(serverPrefBuf, "network.proxy.%s", protocols_l[i]);
-    sprintf(serverPortPrefBuf, "network.proxy.%s_port", protocols_l[i]);
-    // strings in Opera pref. file are in UTF-8
-    SetProxyPref(NS_ConvertUTF8toUTF16(proxyServer),
-                 serverPrefBuf, serverPortPrefBuf, aBranch);
-  }
-
-  GetInteger(aParser, "Proxy", "Use Automatic Proxy Configuration", &enabled);
-  if (enabled)
-    networkProxyType = 2;
-
-  nsCAutoString configURL;
-  rv = aParser.GetString("Proxy", "Automatic Proxy Configuration URL",
-                         configURL);
-  if (NS_SUCCEEDED(rv))
-    aBranch->SetCharPref("network.proxy.autoconfig_url", configURL.get());
-
-  GetInteger(aParser, "Proxy", "No Proxy Servers Check", &enabled);
-  if (enabled) {
-    nsCAutoString servers;
-    rv = aParser.GetString("Proxy", "No Proxy Servers", servers);
-    if (NS_SUCCEEDED(rv))
-      // strings in Opera pref. file are in UTF-8
-      ParseOverrideServers(NS_ConvertUTF8toUTF16(servers), aBranch);
-  }
-
-  aBranch->SetIntPref("network.proxy.type", networkProxyType);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::GetInteger(nsINIParser &aParser, 
-                                   const char* aSectionName, 
-                                   const char* aKeyName, 
-                                   PRInt32* aResult)
-{
-  nsCAutoString val;
-
-  nsresult rv = aParser.GetString(aSectionName, aKeyName, val);
-  if (NS_FAILED(rv))
-    return rv;
-
-  *aResult = val.ToInteger(&rv);
-
-  return rv;
-}
-
-
-nsresult
-nsOperaProfileMigrator::ParseColor(nsINIParser &aParser,
-                                   const char* aSectionName, char** aResult)
-{
-  nsresult rv;
-  PRInt32 r, g, b;
-
-  rv = GetInteger(aParser, aSectionName, "Red", &r);
-  rv |= GetInteger(aParser, aSectionName, "Green", &g);
-  rv |= GetInteger(aParser, aSectionName, "Blue", &b);
-  if (NS_FAILED(rv)) 
-    return NS_OK; // This Preference has no value. Bail now before we get in trouble.
-
-  *aResult = (char*)malloc(sizeof(char) * 8);
-  if (!*aResult)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  sprintf(*aResult, "#%02X%02X%02X", r, g, b);
-
-  return NS_OK;
-}
-
-nsresult 
-nsOperaProfileMigrator::CopyUserContentSheet(nsINIParser &aParser)
-{
-  nsresult rv;
-
-  nsCAutoString userContentCSS;
-  rv = aParser.GetString("User Prefs", "Local CSS File", userContentCSS);
-  if (NS_FAILED(rv) || userContentCSS.Length() == 0)
-    return NS_OK;
-
-  // Copy the file
-  nsCOMPtr<nsILocalFile> userContentCSSFile;
-  rv = NS_NewNativeLocalFile(userContentCSS, true,
-                             getter_AddRefs(userContentCSSFile));
-  if (NS_FAILED(rv))
-    return NS_OK;
-
-  bool exists;
-  rv = userContentCSSFile->Exists(&exists);
-  if (NS_FAILED(rv) || !exists)
-    return NS_OK;
-
-  nsCOMPtr<nsIFile> profileChromeDir;
-  NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR,
-                         getter_AddRefs(profileChromeDir));
-  if (!profileChromeDir)
-    return NS_OK;
-
-  userContentCSSFile->CopyToNative(profileChromeDir,
-                                   NS_LITERAL_CSTRING("userContent.css"));
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyCookies(bool aReplace)
-{
-  nsresult rv = NS_OK;
-
-  nsCOMPtr<nsIFile> temp;
-  mOperaProfile->Clone(getter_AddRefs(temp));
-  nsCOMPtr<nsILocalFile> historyFile(do_QueryInterface(temp));
-
-  historyFile->Append(OPERA_COOKIES_FILE_NAME);
-
-  nsCOMPtr<nsIInputStream> fileStream;
-  NS_NewLocalFileInputStream(getter_AddRefs(fileStream), historyFile);
-  if (!fileStream) 
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  nsOperaCookieMigrator* ocm = new nsOperaCookieMigrator(fileStream);
-  if (!ocm)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  rv = ocm->Migrate();
-
-  if (ocm) {
-    delete ocm;
-    ocm = nsnull;
-  }
-
-  return rv;
-}
-
-nsOperaCookieMigrator::nsOperaCookieMigrator(nsIInputStream* aSourceStream) :
-  mAppVersion(0), mFileVersion(0), mTagTypeLength(0), mPayloadTypeLength(0), 
-  mCookieOpen(false), mCurrHandlingInfo(0)
-{
-  mStream = do_CreateInstance("@mozilla.org/binaryinputstream;1");
-  if (mStream)
-    mStream->SetInputStream(aSourceStream);
-
-  mCurrCookie.isSecure = false;
-  mCurrCookie.expiryTime = 0;
-}
-
-nsOperaCookieMigrator::~nsOperaCookieMigrator() 
-{ 
-  if (mStream)
-    mStream->SetInputStream(nsnull);
-}
-
-
-nsresult
-nsOperaCookieMigrator::Migrate()
-{
-  if (!mStream)
-    return NS_ERROR_FAILURE;
-
-  nsresult rv;
-
-  rv = ReadHeader();
-  if (NS_FAILED(rv)) 
-    return NS_OK;
-
-  nsCOMPtr<nsICookieManager2> manager(do_GetService(NS_COOKIEMANAGER_CONTRACTID));
-  nsCOMPtr<nsIPermissionManager> permissionManager(do_GetService("@mozilla.org/permissionmanager;1"));
-
-  PRUint8 tag;
-  PRUint16 length, segmentLength;
-
-  char* buf = nsnull;
-  do {
-    if (NS_FAILED(mStream->Read8(&tag))) 
-      return NS_OK; // EOF.
-
-    switch (tag) {
-    case BEGIN_DOMAIN_SEGMENT:
-      mStream->Read16(&length);
-      break;
-    case DOMAIN_COMPONENT: 
-      {
-        mStream->Read16(&length);
-        
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mDomainStack.AppendElement(buf);
-      }
-      break;
-    case END_DOMAIN_SEGMENT:
-      {
-        if (mCurrHandlingInfo)
-          AddCookieOverride(permissionManager);
-
-        // Pop the domain stack
-        PRUint32 count = mDomainStack.Length();
-        if (count > 0) {
-          char* segment = mDomainStack.ElementAt(count - 1);
-          if (segment) 
-            nsMemory::Free(segment);
-          mDomainStack.RemoveElementAt(count - 1);
-        }
-      }
-      break;
-
-    case BEGIN_PATH_SEGMENT:
-      mStream->Read16(&length);
-      break;
-    case PATH_COMPONENT:
-      {
-        mStream->Read16(&length);
-        
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mPathStack.AppendElement(buf);
-      }
-      break;
-    case END_PATH_SEGMENT:
-      {
-        // Add the last remaining cookie for this path.
-        if (mCookieOpen) 
-          AddCookie(manager);
-
-        // We receive one "End Path Segment" even if the path stack is empty
-        // i.e. telling us that we are done processing cookies for "/"
-
-        // Pop the path stack
-        PRUint32 count = mPathStack.Length();
-        if (count > 0) {
-          char* segment = mPathStack.ElementAt(count - 1);
-          if (segment)
-            nsMemory::Free(segment);
-          mPathStack.RemoveElementAt(count - 1);
-        }
-      }
-      break;
-
-    case FILTERING_INFO:
-      mStream->Read16(&length);
-      mStream->Read8(&mCurrHandlingInfo);
-      break;
-    case PATH_HANDLING_INFO:
-    case THIRD_PARTY_HANDLING_INFO: 
-      {
-        mStream->Read16(&length);
-        PRUint8 temp;
-        mStream->Read8(&temp);
-      }
-      break;
-
-    case BEGIN_COOKIE_SEGMENT:
-      {
-        // Be sure to save the last cookie before overwriting the buffers
-        // with data from subsequent cookies. 
-        if (mCookieOpen)
-          AddCookie(manager);
-
-        mStream->Read16(&segmentLength);
-        mCookieOpen = true;
-      }
-      break;
-    case COOKIE_ID:
-      {
-        mStream->Read16(&length);
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mCurrCookie.id.Assign(buf);
-        if (buf) {
-          nsMemory::Free(buf);
-          buf = nsnull;
-        }
-      }
-      break;
-    case COOKIE_DATA:
-      {
-        mStream->Read16(&length);
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mCurrCookie.data.Assign(buf);
-        if (buf) {
-          nsMemory::Free(buf);
-          buf = nsnull;
-        }
-      }
-      break;
-    case COOKIE_EXPIRY:
-      mStream->Read16(&length);
-      mStream->Read32(reinterpret_cast<PRUint32*>(&(mCurrCookie.expiryTime)));
-      break;
-    case COOKIE_SECURE:
-      mCurrCookie.isSecure = true;
-      break;
-
-    // We don't support any of these fields but we must read them in
-    // to advance the stream cursor. 
-    case COOKIE_LASTUSED: 
-      {
-        mStream->Read16(&length);
-        PRTime temp;
-        mStream->Read32(reinterpret_cast<PRUint32*>(&temp));
-      }
-      break;
-    case COOKIE_COMMENT:
-    case COOKIE_COMMENT_URL:
-    case COOKIE_V1_DOMAIN:
-    case COOKIE_V1_PATH:
-    case COOKIE_V1_PORT_LIMITATIONS:
-      {
-        mStream->Read16(&length);
-        mStream->ReadBytes(length, &buf);
-        if (buf) {
-          nsMemory::Free(buf);
-          buf = nsnull;
-        }
-      }
-      break;
-    case COOKIE_VERSION: 
-      {
-        mStream->Read16(&length);
-        PRUint8 temp;
-        mStream->Read8(&temp);
-      }
-      break;
-    case COOKIE_OTHERFLAG_1:
-    case COOKIE_OTHERFLAG_2:
-    case COOKIE_OTHERFLAG_3:
-    case COOKIE_OTHERFLAG_4:
-    case COOKIE_OTHERFLAG_5:
-    case COOKIE_OTHERFLAG_6: 
-      break;
-    }
-  }
-  while (1);
-  
-  // Make sure the path and domain stacks are clear. 
-  char* segment = nsnull;
-  PRUint32 i;
-  PRUint32 count = mPathStack.Length();
-  for (i = 0; i < count; ++i) {
-    segment = mPathStack.ElementAt(i);
-    if (segment) {
-      nsMemory::Free(segment);
-      segment = nsnull;
-    }
-  }
-  count = mDomainStack.Length();
-  for (i = 0; i < count; ++i) {
-    segment = mDomainStack.ElementAt(i);
-    if (segment) {
-      nsMemory::Free(segment);
-      segment = nsnull;
-    }
-  }
-  
-  return NS_OK;
-}
-
-nsresult
-nsOperaCookieMigrator::AddCookieOverride(nsIPermissionManager* aManager)
-{
-  nsresult rv;
-
-  nsCString domain;
-  SynthesizeDomain(getter_Copies(domain));
-  nsCOMPtr<nsIURI> uri(do_CreateInstance("@mozilla.org/network/standard-url;1"));
-  if (!uri)
-    return NS_ERROR_OUT_OF_MEMORY;
-  uri->SetHost(domain);
-
-  rv = aManager->Add(uri, "cookie",
-                     (mCurrHandlingInfo == 1 || mCurrHandlingInfo == 3)
-                     ? (PRUint32) nsIPermissionManager::ALLOW_ACTION
-                     : (PRUint32) nsIPermissionManager::DENY_ACTION,
-                     nsIPermissionManager::EXPIRE_NEVER,
-                     0);
-
-  mCurrHandlingInfo = 0;
-
-  return rv;
-}
-
-
-nsresult
-nsOperaCookieMigrator::AddCookie(nsICookieManager2* aManager)
-{
-  // This is where we use the information gathered in all the other 
-  // states to add a cookie to the Firebird/Firefox Cookie Manager.
-  nsCString domain;
-  SynthesizeDomain(getter_Copies(domain));
-
-  nsCString path;
-  SynthesizePath(getter_Copies(path));
-
-  mCookieOpen = false;
-  
-  nsresult rv = aManager->Add(domain, 
-                              path, 
-                              mCurrCookie.id, 
-                              mCurrCookie.data, 
-                              mCurrCookie.isSecure, 
-                              false, // isHttpOnly
-                              false, // isSession
-                              PRInt64(mCurrCookie.expiryTime));
-
-  mCurrCookie.isSecure = 0;
-  mCurrCookie.expiryTime = 0;
-
-  return rv;
-}
-
-void
-nsOperaCookieMigrator::SynthesizePath(char** aResult)
-{
-  PRUint32 count = mPathStack.Length();
-  nsCAutoString synthesizedPath("/");
-  for (PRUint32 i = 0; i < count; ++i) {
-    synthesizedPath.Append(mPathStack.ElementAt(i));
-    if (i != count-1)
-      synthesizedPath.Append("/");
-  }
-  if (synthesizedPath.IsEmpty())
-    synthesizedPath.Assign("/");
-
-  *aResult = ToNewCString(synthesizedPath);
-}
-
-void
-nsOperaCookieMigrator::SynthesizeDomain(char** aResult)
-{
-  PRUint32 count = mDomainStack.Length();
-  if (count == 0)
-    return;
-
-  nsCAutoString synthesizedDomain;
-  for (PRInt32 i = (PRInt32)count - 1; i >= 0; --i) {
-    synthesizedDomain.Append(mDomainStack.ElementAt((PRUint32)i));
-    if (i != 0)
-      synthesizedDomain.Append(".");
-  }
-
-  *aResult = ToNewCString(synthesizedDomain);
-}
-
-nsresult
-nsOperaCookieMigrator::ReadHeader()
-{
-  mStream->Read32(&mAppVersion);
-  mStream->Read32(&mFileVersion);
-
-  if (mAppVersion & 0x1000 && mFileVersion & 0x2000) {
-    mStream->Read16(&mTagTypeLength);
-    mStream->Read16(&mPayloadTypeLength);
-
-    return NS_OK;
-  }
-  return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::RunBatched(nsISupports* aUserData)
-{
-  PRUint8 batchAction;
-  nsCOMPtr<nsISupportsPRUint8> strWrapper(do_QueryInterface(aUserData));
-  NS_ASSERTION(strWrapper, "Unable to create nsISupportsPRUint8 wrapper!");
-  nsresult rv = strWrapper->GetData(&batchAction);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  switch (batchAction) {
-    case BATCH_ACTION_HISTORY:
-      rv = CopyHistoryBatched(false);
-      break;
-    case BATCH_ACTION_HISTORY_REPLACE:
-      rv = CopyHistoryBatched(true);
-      break;
-    case BATCH_ACTION_BOOKMARKS:
-      rv = CopyBookmarksBatched(false);
-      break;
-    case BATCH_ACTION_BOOKMARKS_REPLACE:
-      rv = CopyBookmarksBatched(true);
-      break;
-  }
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyHistory(bool aReplace) 
-{
-  nsresult rv;
-  nsCOMPtr<nsINavHistoryService> history =
-    do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRUint8 batchAction = aReplace ? BATCH_ACTION_HISTORY_REPLACE
-                                 : BATCH_ACTION_HISTORY;
-  nsCOMPtr<nsISupportsPRUint8> supports =
-    do_CreateInstance(NS_SUPPORTS_PRUINT8_CONTRACTID);
-  NS_ENSURE_TRUE(supports, NS_ERROR_OUT_OF_MEMORY);
-  rv = supports->SetData(batchAction);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = history->RunInBatchMode(this, supports);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
- 
-nsresult
-nsOperaProfileMigrator::CopyHistoryBatched(bool aReplace) 
-{
-  nsCOMPtr<nsIBrowserHistory> hist(do_GetService(NS_GLOBALHISTORY2_CONTRACTID));
-
-  nsCOMPtr<nsIFile> temp;
-  mOperaProfile->Clone(getter_AddRefs(temp));
-  nsCOMPtr<nsILocalFile> historyFile(do_QueryInterface(temp));
-  historyFile->Append(OPERA_HISTORY_FILE_NAME);
-
-  nsCOMPtr<nsIInputStream> fileStream;
-  NS_NewLocalFileInputStream(getter_AddRefs(fileStream), historyFile);
-  if (!fileStream) return NS_ERROR_OUT_OF_MEMORY;
-
-  nsCOMPtr<nsILineInputStream> lineStream = do_QueryInterface(fileStream);
-
-  nsCAutoString buffer, url;
-  nsAutoString title;
-  PRTime lastVisitDate;
-  bool moreData = false;
-
-  enum { TITLE, URL, LASTVISIT } state = TITLE;
-
-  // Format is "title\nurl\nlastvisitdate"
-  do {
-    nsresult rv = lineStream->ReadLine(buffer, &moreData);
-    if (NS_FAILED(rv))
-      return rv;
-
-    switch (state) {
-    case TITLE:
-      CopyUTF8toUTF16(buffer, title);
-      state = URL;
-      break;
-    case URL:
-      url = buffer;
-      state = LASTVISIT;
-      break;
-    case LASTVISIT:
-      // Opera time format is a second offset, PRTime is a microsecond offset
-      nsresult err;
-      lastVisitDate = buffer.ToInteger(&err);
-      
-      PRInt64 temp, million;
-      LL_I2L(temp, lastVisitDate);
-      LL_I2L(million, PR_USEC_PER_SEC);
-      LL_MUL(lastVisitDate, temp, million);
-
-      nsCOMPtr<nsIURI> uri;
-      NS_NewURI(getter_AddRefs(uri), url);
-      if (uri)
-        hist->AddPageWithDetails(uri, title.get(), lastVisitDate);
-      
-      state = TITLE;
-      break;
-    }
-  }
-  while (moreData);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyBookmarks(bool aReplace)
-{
-  nsresult rv;
-  nsCOMPtr<nsINavBookmarksService> bookmarks =
-    do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRUint8 batchAction = aReplace ? BATCH_ACTION_BOOKMARKS_REPLACE
-                                 : BATCH_ACTION_BOOKMARKS;
-  nsCOMPtr<nsISupportsPRUint8> supports =
-    do_CreateInstance(NS_SUPPORTS_PRUINT8_CONTRACTID);
-  NS_ENSURE_TRUE(supports, NS_ERROR_OUT_OF_MEMORY);
-  rv = supports->SetData(batchAction);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = bookmarks->RunInBatchMode(this, supports);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyBookmarksBatched(bool aReplace)
-{
-  // Find Opera Bookmarks
-  nsCOMPtr<nsIFile> operaBookmarks;
-  mOperaProfile->Clone(getter_AddRefs(operaBookmarks));
-  operaBookmarks->Append(OPERA_BOOKMARKS_FILE_NAME);
-
-  nsCOMPtr<nsIInputStream> fileInputStream;
-  NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream), operaBookmarks);
-  NS_ENSURE_TRUE(fileInputStream, NS_ERROR_OUT_OF_MEMORY);
-
-  nsCOMPtr<nsILineInputStream> lineInputStream(do_QueryInterface(fileInputStream));
-
-  nsresult rv;
-  nsCOMPtr<nsINavBookmarksService> bms =
-    do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  PRInt64 bookmarksMenuFolderId;
-  rv = bms->GetBookmarksMenuFolder(&bookmarksMenuFolderId);
-  NS_ENSURE_SUCCESS(rv, rv);
-  PRInt64 parentFolder = bookmarksMenuFolderId;
-
-  nsCOMPtr<nsIStringBundleService> bundleService =
-    do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIStringBundle> bundle;
-  rv = bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(bundle));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!aReplace) {
-    nsString sourceNameOpera;
-    rv = bundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(), 
-                                   getter_Copies(sourceNameOpera));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
-    nsString importedOperaHotlistTitle;
-    rv = bundle->FormatStringFromName(NS_LITERAL_STRING("importedBookmarksFolder").get(),
-                                      sourceNameStrings, 1, 
-                                      getter_Copies(importedOperaHotlistTitle));
-   NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = bms->CreateFolder(parentFolder,
-                           NS_ConvertUTF16toUTF8(importedOperaHotlistTitle),
-                           nsINavBookmarksService::DEFAULT_INDEX,
-                           &parentFolder);
-   NS_ENSURE_SUCCESS(rv, rv);
-  }
-  else {
-    nsCOMPtr<nsIFile> profile;
-    GetProfilePath(nsnull, profile);
-    rv = InitializeBookmarks(profile);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
-  CopySmartKeywords(bms, bundle, parentFolder);
-#endif
-
-  PRInt64 bookmarksToolbarFolderId;
-  rv = bms->GetToolbarFolder(&bookmarksToolbarFolderId);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = ParseBookmarksFolder(lineInputStream, parentFolder,
-                            bookmarksToolbarFolderId, bms);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
-nsresult
-nsOperaProfileMigrator::CopySmartKeywords(nsINavBookmarksService* aBMS, 
-                                          nsIStringBundle* aBundle,
-                                          PRInt64 aParentFolder)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> smartKeywords;
-  mOperaProfile->Clone(getter_AddRefs(smartKeywords));
-  smartKeywords->Append(NS_LITERAL_STRING("search.ini"));
-
-  nsCOMPtr<nsILocalFile> lf(do_QueryInterface(smartKeywords));
-  nsINIParser parser;
-  if (!lf || NS_FAILED(parser.Init(lf)))
-    return NS_OK;
-
-  nsString sourceNameOpera;
-  rv = aBundle->GetStringFromName(NS_LITERAL_STRING("sourceNameOpera").get(),
-                                  getter_Copies(sourceNameOpera));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  const PRUnichar* sourceNameStrings[] = { sourceNameOpera.get() };
-  nsString importedSearchUrlsTitle;
-  rv = aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchURLsFolder").get(),
-                                     sourceNameStrings, 1, 
-                                     getter_Copies(importedSearchUrlsTitle));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRInt64 keywordsFolder;
-  rv = aBMS->CreateFolder(aParentFolder,
-                          NS_ConvertUTF16toUTF8(importedSearchUrlsTitle),
-                          nsINavBookmarksService::DEFAULT_INDEX,
-                          &keywordsFolder);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRInt32 sectionIndex = 1;
-  nsCAutoString name, url, keyword;
-  do {
-    nsCAutoString section("Search Engine ");
-    section.AppendInt(sectionIndex++);
-
-    rv = parser.GetString(section.get(), "Name", name);
-    if (NS_FAILED(rv)) {
-      // No more smart keywords found, stop parsing the file.
-      break;
-    }
-    if (name.IsEmpty())
-      continue;
-
-    rv = parser.GetString(section.get(), "URL", url);
-    if (NS_FAILED(rv) || url.IsEmpty())
-      continue;
-
-    rv = parser.GetString(section.get(), "Key", keyword);
-    if (NS_FAILED(rv) || keyword.IsEmpty())
-      continue;
-
-    PRInt32 post;
-    rv = GetInteger(parser, section.get(), "Is post", &post);
-    if (NS_SUCCEEDED(rv) && post)
-      continue;
-
-    PRUint32 length = name.Length();
-    PRInt32 index = 0;
-    do {
-      index = name.FindChar('&', index);
-      if ((PRUint32)index >= length - 2)
-        break;
-
-      // Assume "&&" is an escaped ampersand in the search query title. 
-      if (name.CharAt(index + 1) == '&') {
-        name.Cut(index, 1);
-        index += 2;
-        continue;
-      }
-
-      name.Cut(index, 1);
-    }
-    while ((PRUint32)index < length);
-
-    nsCOMPtr<nsIURI> uri;
-    if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), url.get())) || !uri)
-      continue;
-
-    nsCAutoString hostCStr;
-    uri->GetHost(hostCStr);
-    NS_ConvertASCIItoUTF16 host(hostCStr);
-
-    const PRUnichar* descStrings[] = { NS_ConvertUTF8toUTF16(keyword).get(),
-                                       host.get() };
-    nsString keywordDesc;
-    rv = aBundle->FormatStringFromName(NS_LITERAL_STRING("importedSearchUrlDesc").get(),
-                                       descStrings, 2,
-                                       getter_Copies(keywordDesc));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    PRInt64 newId;
-    rv = aBMS->InsertBookmark(keywordsFolder, uri,
-                              nsINavBookmarksService::DEFAULT_INDEX,
-                              name, &newId);
-    NS_ENSURE_SUCCESS(rv, rv);
-    rv = aBMS->SetKeywordForBookmark(newId, NS_ConvertUTF8toUTF16(keyword));
-    NS_ENSURE_SUCCESS(rv, rv);
-    // TODO Bug 397771: set bookmark description to keywordDesc.
-  }
-  while (1);
-  
-  return rv;
-}
-#endif
-
-typedef enum { LineType_FOLDER, 
-               LineType_BOOKMARK, 
-               LineType_SEPARATOR, 
-               LineType_NAME, 
-               LineType_URL, 
-               LineType_KEYWORD,
-               LineType_DESCRIPTION,
-               LineType_ONTOOLBAR,
-               LineType_NL,
-               LineType_OTHER } LineType;
-
-static LineType GetLineType(nsAString& aBuffer, PRUnichar** aData)
-{
-  if (Substring(aBuffer, 0, 7).Equals(NS_LITERAL_STRING("#FOLDER")))
-    return LineType_FOLDER;
-  if (Substring(aBuffer, 0, 4).Equals(NS_LITERAL_STRING("#URL")))
-    return LineType_BOOKMARK;
-  if (Substring(aBuffer, 0, 1).Equals(NS_LITERAL_STRING("-")))
-    return LineType_SEPARATOR;
-  if (Substring(aBuffer, 1, 5).Equals(NS_LITERAL_STRING("NAME="))) {
-    const nsAString& data = Substring(aBuffer, 6, aBuffer.Length() - 6);
-    *aData = ToNewUnicode(data);
-    return LineType_NAME;
-  }
-  if (Substring(aBuffer, 1, 4).Equals(NS_LITERAL_STRING("URL="))) {
-    const nsAString& data = Substring(aBuffer, 5, aBuffer.Length() - 5);
-    *aData = ToNewUnicode(data);
-    return LineType_URL;
-  }
-  if (Substring(aBuffer, 1, 12).Equals(NS_LITERAL_STRING("DESCRIPTION="))) {
-    const nsAString& data = Substring(aBuffer, 13, aBuffer.Length() - 13);
-    *aData = ToNewUnicode(data);
-    return LineType_DESCRIPTION;
-  }
-  if (Substring(aBuffer, 1, 11).Equals(NS_LITERAL_STRING("SHORT NAME="))) {
-    const nsAString& data = Substring(aBuffer, 12, aBuffer.Length() - 12);
-    *aData = ToNewUnicode(data);
-    return LineType_KEYWORD;
-  }
-  if (Substring(aBuffer, 1, 15).Equals(NS_LITERAL_STRING("ON PERSONALBAR="))) {
-    const nsAString& data = Substring(aBuffer, 16, aBuffer.Length() - 16);
-    *aData = ToNewUnicode(data);
-    return LineType_ONTOOLBAR;
-  }
-  if (aBuffer.IsEmpty())
-    return LineType_NL; // Newlines separate bookmarks
-  return LineType_OTHER;
-}
-
-typedef enum { EntryType_BOOKMARK, EntryType_FOLDER } EntryType;
-
-nsresult
-nsOperaProfileMigrator::ParseBookmarksFolder(nsILineInputStream* aStream, 
-                                             PRInt64 aParent,
-                                             PRInt64 aToolbar,
-                                             nsINavBookmarksService* aBMS)
-{
-  nsresult rv;
-  bool moreData = false;
-  nsAutoString buffer;
-  EntryType entryType = EntryType_BOOKMARK;
-  nsAutoString keyword, description;
-  nsCAutoString url, name;
-  bool onToolbar = false;
-  do {
-    nsCAutoString cBuffer;
-    rv = aStream->ReadLine(cBuffer, &moreData);
-    if (NS_FAILED(rv)) return rv;
-    
-    CopyUTF8toUTF16(cBuffer, buffer);
-    nsString data;
-    LineType type = GetLineType(buffer, getter_Copies(data));
-    switch(type) {
-    case LineType_FOLDER:
-      entryType = EntryType_FOLDER;
-      break;
-    case LineType_BOOKMARK:
-      entryType = EntryType_BOOKMARK;
-      break;
-    case LineType_SEPARATOR:
-      // If we're here, we need to break out of the loop for the current folder, 
-      // essentially terminating this instance of ParseBookmarksFolder and return
-      // to the calling function, which is either ParseBookmarksFolder for a parent
-      // folder, or CopyBookmarks (which means we're done parsing all bookmarks).
-      goto done;
-    case LineType_NAME:
-      name.Assign(NS_ConvertUTF16toUTF8(data));
-      break;
-    case LineType_URL:
-      url.Assign(NS_ConvertUTF16toUTF8(data));
-      break;
-    case LineType_KEYWORD:
-      keyword = data;
-      break;
-    case LineType_DESCRIPTION:
-      description = data;
-      break;
-    case LineType_ONTOOLBAR:
-      if (NS_LITERAL_STRING("YES").Equals(data))
-        onToolbar = true;
-      break;
-    case LineType_NL: {
-      // XXX We don't know for sure how Opera deals with IDN hostnames in URL.
-      // Assuming it's in UTF-8 is rather safe because it covers two cases 
-      // (UTF-8 and ASCII) out of three cases (the last is a non-UTF-8
-      // multibyte encoding).
-      // XXX Todo: |description| is not saved.
-      if (entryType == EntryType_BOOKMARK) {
-        if (!name.IsEmpty() && !url.IsEmpty()) {
-          nsCOMPtr<nsIURI> uri;
-          rv = NS_NewURI(getter_AddRefs(uri), url);
-          if (NS_FAILED(rv))
-            continue;
-          PRInt64 id;
-          rv = aBMS->InsertBookmark(onToolbar ? aToolbar : aParent,
-                                    uri, nsINavBookmarksService::DEFAULT_INDEX,
-                                    name, &id);
-          if (NS_FAILED(rv))
-            continue;
-          name.Truncate();
-          url.Truncate();
-          keyword.Truncate();
-          description.Truncate();
-          onToolbar = false;
-        }
-      }
-      else if (entryType == EntryType_FOLDER) {
-        if (!name.IsEmpty()) {
-          PRInt64 newFolder;
-          rv = aBMS->CreateFolder(onToolbar ? aToolbar : aParent,
-                                  name, nsINavBookmarksService::DEFAULT_INDEX, &newFolder);
-          if (NS_FAILED(rv)) 
-            continue;
-          rv = ParseBookmarksFolder(aStream, newFolder, aToolbar, aBMS);
-          name.Truncate();
-        }
-      }
-      break;
-    }
-    case LineType_OTHER:
-      break;
-    }
-  }
-  while (moreData);
-
-done:
-  return rv;
-}
-
-void
-nsOperaProfileMigrator::GetOperaProfile(const PRUnichar* aProfile, nsILocalFile** aFile)
-{
-  nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
-  nsCOMPtr<nsILocalFile> file;
-#ifdef XP_WIN
-  fileLocator->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-
-  // Opera profile lives under %APP_DATA%\Opera\<operaver>\profile 
-  file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-  file->Append(nsDependentString(aProfile));
-  file->Append(NS_LITERAL_STRING("profile"));
-#elif defined (XP_MACOSX)
-  fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-    
-  file->Append(NS_LITERAL_STRING("Preferences"));
-  file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-#elif defined (XP_UNIX)
-  fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-    
-  file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-#endif    
-
-  *aFile = file;
-  NS_ADDREF(*aFile);
-}
-
deleted file mode 100644
--- a/browser/components/migration/src/nsOperaProfileMigrator.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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 Browser Profile Migrator.
- *
- * The Initial Developer of the Original Code is Ben Goodger.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ben Goodger <ben@bengoodger.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 ***** */
- 
-#ifndef operaprofilemigrator___h___
-#define operaprofilemigrator___h___
-
-#include "nsCOMPtr.h"
-#include "nsIBinaryInputStream.h"
-#include "nsIBrowserProfileMigrator.h"
-#include "nsIObserverService.h"
-#include "nsStringAPI.h"
-#include "nsTArray.h"
-#include "nsIMutableArray.h"
-#include "nsINavHistoryService.h"
-#include "nsIStringBundle.h"
-
-class nsICookieManager2;
-class nsILineInputStream;
-class nsILocalFile;
-class nsINIParser;
-class nsIPermissionManager;
-class nsIPrefBranch;
-class nsINavBookmarksService;
-class nsIRDFResource;
-
-class nsOperaProfileMigrator : public nsIBrowserProfileMigrator,
-                               public nsINavHistoryBatchCallback
-{
-public:
-  NS_DECL_NSIBROWSERPROFILEMIGRATOR
-  NS_DECL_NSINAVHISTORYBATCHCALLBACK
-  NS_DECL_ISUPPORTS
-
-  nsOperaProfileMigrator();
-  virtual ~nsOperaProfileMigrator();
-
-public:
-
-  typedef enum { STRING, INT, BOOL, COLOR } PrefType;
-
-  typedef nsresult(*prefConverter)(void*, nsIPrefBranch*);
-
-  struct PrefTransform {
-    const char*   sectionName;
-    const char*   keyName;
-    PrefType      type;
-    const char*   targetPrefName;
-    prefConverter prefSetterFunc;
-    bool          prefHasValue;
-    union {
-      PRInt32     intValue;
-      bool        boolValue;
-      char*       stringValue;
-    };
-  };
-
-  static nsresult SetFile(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetCookieBehavior(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetCookieLifetime(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetBool(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetWString(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetInt(void* aTransform, nsIPrefBranch* aBranch);
-  static nsresult SetString(void* aTransform, nsIPrefBranch* aBranch);
-
-protected:
-  nsresult CopyPreferences(bool aReplace);
-  nsresult ParseColor(nsINIParser &aParser, const char* aSectionName,
-                      char** aResult);
-  nsresult CopyUserContentSheet(nsINIParser &aParser);
-  nsresult CopyProxySettings(nsINIParser &aParser, nsIPrefBranch* aBranch);
-  nsresult GetInteger(nsINIParser &aParser, const char* aSectionName, 
-                      const char* aKeyName, PRInt32* aResult);
-
-  nsresult CopyCookies(bool aReplace);
-  /**
-   * Migrate history to Places.
-   * This will end up calling CopyHistoryBatched helper, that provides batch
-   * support.  Batching allows for better performances and integrity.
-   *
-   * @param aReplace
-   *        Indicates if we should replace current history or append to it.
-   */
-  nsresult CopyHistory(bool aReplace);
-  nsresult CopyHistoryBatched(bool aReplace);
-  /**
-   * Migrate bookmarks to Places.
-   * This will end up calling CopyBookmarksBatched helper, that provides batch
-   * support.  Batching allows for better performances and integrity.
-   *
-   * @param aReplace
-   *        Indicates if we should replace current bookmarks or append to them.
-   *        When appending we will usually default to bookmarks menu.
-   */
-  nsresult CopyBookmarks(bool aReplace);
-  nsresult CopyBookmarksBatched(bool aReplace);
-  void     ClearToolbarFolder(nsINavBookmarksService * aBookmarksService,
-                              PRInt64 aToolbarFolder);
-  nsresult ParseBookmarksFolder(nsILineInputStream* aStream, 
-                                PRInt64 aFolder,
-                                PRInt64 aToolbar, 
-                                nsINavBookmarksService* aBMS);
-#if defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
-  nsresult CopySmartKeywords(nsINavBookmarksService* aBMS, 
-                             nsIStringBundle* aBundle, 
-                             PRInt64 aParentFolder);
-#endif // defined(XP_WIN) || (defined(XP_UNIX) && !defined(XP_MACOSX))
-
-  void     GetOperaProfile(const PRUnichar* aProfile, nsILocalFile** aFile);
-
-private:
-  nsCOMPtr<nsILocalFile> mOperaProfile;
-  nsCOMPtr<nsIMutableArray> mProfiles;
-  nsCOMPtr<nsIObserverService> mObserverService;
-};
-
-class nsOperaCookieMigrator
-{
-public:
-  nsOperaCookieMigrator(nsIInputStream* aSourceStream);
-  virtual ~nsOperaCookieMigrator();
-
-  nsresult Migrate();
-
-  typedef enum { BEGIN_DOMAIN_SEGMENT         = 0x01,
-                 DOMAIN_COMPONENT             = 0x1E,
-                 END_DOMAIN_SEGMENT           = 0x84 | 0x80, // 0x04 | (1 << 8)
-                 
-                 BEGIN_PATH_SEGMENT           = 0x02,
-                 PATH_COMPONENT               = 0x1D,
-                 END_PATH_SEGMENT             = 0x05 | 0x80, // 0x05 | (1 << 8)
-                 
-                 FILTERING_INFO               = 0x1F,
-                 PATH_HANDLING_INFO           = 0x21,
-                 THIRD_PARTY_HANDLING_INFO    = 0x25,
-
-                 BEGIN_COOKIE_SEGMENT         = 0x03,
-                 COOKIE_ID                    = 0x10,
-                 COOKIE_DATA                  = 0x11,
-                 COOKIE_EXPIRY                = 0x12,
-                 COOKIE_LASTUSED              = 0x13,
-                 COOKIE_COMMENT               = 0x14,
-                 COOKIE_COMMENT_URL           = 0x15,
-                 COOKIE_V1_DOMAIN             = 0x16,
-                 COOKIE_V1_PATH               = 0x17,
-                 COOKIE_V1_PORT_LIMITATIONS   = 0x18,
-                 COOKIE_SECURE                = 0x19 | 0x80, 
-                 COOKIE_VERSION               = 0x1A,
-                 COOKIE_OTHERFLAG_1           = 0x1B | 0x80,
-                 COOKIE_OTHERFLAG_2           = 0x1C | 0x80,
-                 COOKIE_OTHERFLAG_3           = 0x20 | 0x80,
-                 COOKIE_OTHERFLAG_4           = 0x22 | 0x80,
-                 COOKIE_OTHERFLAG_5           = 0x23 | 0x80,
-                 COOKIE_OTHERFLAG_6           = 0x24 | 0x80
-  } TAG;
-
-protected:
-  nsOperaCookieMigrator() { }
-
-  nsresult ReadHeader();
-
-  void     SynthesizePath(char** aResult);
-  void     SynthesizeDomain(char** aResult);
-  nsresult AddCookieOverride(nsIPermissionManager* aManager);
-  nsresult AddCookie(nsICookieManager2* aManager);
-
-private:
-  nsCOMPtr<nsIBinaryInputStream> mStream;
-
-  nsTArray<char*> mDomainStack;
-  nsTArray<char*> mPathStack;
-
-  struct Cookie {
-    nsCString id;
-    nsCString data;
-    PRInt32 expiryTime;
-    bool isSecure;
-  };
-
-  PRUint32 mAppVersion;
-  PRUint32 mFileVersion;
-  PRUint16 mTagTypeLength;
-  PRUint16 mPayloadTypeLength;
-  bool     mCookieOpen;
-  Cookie   mCurrCookie;
-  PRUint8  mCurrHandlingInfo;
-};
-
-#endif
-
--- a/browser/components/migration/src/nsProfileMigrator.cpp
+++ b/browser/components/migration/src/nsProfileMigrator.cpp
@@ -134,17 +134,16 @@ nsProfileMigrator::Migrate(nsIProfileSta
 // nsProfileMigrator
 
 NS_IMPL_ISUPPORTS1(nsProfileMigrator, nsIProfileMigrator)
 
 #ifdef XP_WIN
 
 #define INTERNAL_NAME_IEXPLORE        "iexplore"
 #define INTERNAL_NAME_MOZILLA_SUITE   "apprunner"
-#define INTERNAL_NAME_OPERA           "opera"
 #define INTERNAL_NAME_CHROME          "chrome"
 #endif
 
 nsresult
 nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
                                                 nsCOMPtr<nsIBrowserProfileMigrator>& bpm)
 {
 #if XP_WIN
@@ -215,20 +214,16 @@ nsProfileMigrator::GetDefaultBrowserMigr
   nsAutoString internalName;
   if (NS_FAILED(lfw->GetVersionInfoField("InternalName", internalName)))
     return NS_ERROR_FAILURE;
 
   if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_IEXPLORE)) {
     aKey = "ie";
     return NS_OK;
   }
-  else if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_OPERA)) {
-    aKey = "opera";
-    return NS_OK;
-  }
   else if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_CHROME)) {
     aKey = "chrome";
     return NS_OK;
   }
 
 #else
   bool exists = false;
 #define CHECK_MIGRATOR(browser) do {\
@@ -238,15 +233,14 @@ nsProfileMigrator::GetDefaultBrowserMigr
   if (exists) {\
     aKey = browser;\
     return NS_OK;\
   }} while(0)
 
 #if defined(XP_MACOSX)
   CHECK_MIGRATOR("safari");
 #endif
-  CHECK_MIGRATOR("opera");
   CHECK_MIGRATOR("chrome");
 
 #undef CHECK_MIGRATOR
 #endif
   return NS_ERROR_FAILURE;
 }
--- a/browser/components/migration/src/nsSafariProfileMigrator.h
+++ b/browser/components/migration/src/nsSafariProfileMigrator.h
@@ -41,16 +41,19 @@
 
 #include "nsIBrowserProfileMigrator.h"
 #include "nsIObserverService.h"
 #include "nsStringAPI.h"
 #include "nsINavHistoryService.h"
 
 #include <CoreFoundation/CoreFoundation.h>
 
+class nsIPrefBranch;
+class nsINavBookmarksService;
+class nsIRDFResource;
 class nsIRDFDataSource;
 
 class nsSafariProfileMigrator : public nsIBrowserProfileMigrator,
                                 public nsINavHistoryBatchCallback
 {
 public:
   NS_DECL_NSIBROWSERPROFILEMIGRATOR
   NS_DECL_NSINAVHISTORYBATCHCALLBACK
--- a/browser/components/preferences/Makefile.in
+++ b/browser/components/preferences/Makefile.in
@@ -46,14 +46,14 @@ include $(DEPTH)/config/autoconf.mk
 ifdef ENABLE_TESTS
 DIRS += tests
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-	-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
+	-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
 	$(NULL)
 
 ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DHAVE_SHELL_SERVICE=1
 endif
--- a/browser/components/preferences/applications.js
+++ b/browser/components/preferences/applications.js
@@ -1347,17 +1347,17 @@ var gApplicationsPane = {
            aExecutable.isExecutable() &&
 // XXXben - we need to compare this with the running instance executable
 //          just don't know how to do that via script...
 // XXXmano TBD: can probably add this to nsIShellService
 #ifdef XP_WIN
 #expand    aExecutable.leafName != "__MOZ_APP_NAME__.exe";
 #else
 #ifdef XP_MACOSX
-#expand    aExecutable.leafName != "__MOZ_APP_DISPLAYNAME__.app";
+#expand    aExecutable.leafName != "__MOZ_MACBUNDLE_NAME__";
 #else
 #expand    aExecutable.leafName != "__MOZ_APP_NAME__-bin";
 #endif
 #endif
   },
 
   /**
    * Rebuild the actions menu for the selected entry.  Gets called by
--- a/browser/components/sessionstore/Makefile.in
+++ b/browser/components/sessionstore/Makefile.in
@@ -45,13 +45,11 @@ XPIDL_MODULE = sessionstore
 
 XPIDLSRCS = \
 	nsISessionStartup.idl \
 	nsISessionStore.idl \
   $(NULL)
 
 DIRS = src
 
-ifdef ENABLE_TESTS
-DIRS += test/browser
-endif
+TEST_DIRS = test
 
 include $(topsrcdir)/config/rules.mk
rename from browser/components/sessionstore/test/browser/Makefile.in
rename to browser/components/sessionstore/test/Makefile.in
--- a/browser/components/sessionstore/test/browser/Makefile.in
+++ b/browser/components/sessionstore/test/Makefile.in
@@ -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 *****
 
-DEPTH		= ../../../../..
+DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir  = browser/components/sessionstore/test/browser 
+relativesrcdir  = browser/components/sessionstore/test
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 # browser_506482.js is disabled because of frequent failures (bug 538672)
 # browser_526613.js is disabled because of frequent failures (bug 534489)
 
 _BROWSER_TEST_FILES = \
rename from browser/components/sessionstore/test/browser/browser_248970_a.js
rename to browser/components/sessionstore/test/browser_248970_a.js
rename from browser/components/sessionstore/test/browser/browser_248970_b.js
rename to browser/components/sessionstore/test/browser_248970_b.js
--- a/browser/components/sessionstore/test/browser/browser_248970_b.js
+++ b/browser/components/sessionstore/test/browser_248970_b.js
@@ -111,17 +111,17 @@ function test() {
 
   //////////////////////////////////////////////////////////////////
   // Test (B) : Session data restoration between modes            //
   //////////////////////////////////////////////////////////////////
 
   let rootDir = getRootDirectory(gTestPath);
   const testURL = rootDir + "browser_248970_b_sample.html";
   const testURL2 = "http://mochi.test:8888/browser/" +
-  "browser/components/sessionstore/test/browser/browser_248970_b_sample.html";
+  "browser/components/sessionstore/test/browser_248970_b_sample.html";
 
   // get closed tab count
   let count = ss.getClosedTabCount(window);
   let max_tabs_undo = gPrefService.getIntPref("browser.sessionstore.max_tabs_undo");
   ok(0 <= count && count <= max_tabs_undo,
     "getClosedTabCount should return zero or at most max_tabs_undo");
 
   // setup a state for tab (A) so we can check later that is restored
rename from browser/components/sessionstore/test/browser/browser_248970_b_sample.html
rename to browser/components/sessionstore/test/browser_248970_b_sample.html
rename from browser/components/sessionstore/test/browser/browser_339445.js
rename to browser/components/sessionstore/test/browser_339445.js
--- a/browser/components/sessionstore/test/browser/browser_339445.js
+++ b/browser/components/sessionstore/test/browser_339445.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 339445 **/
   
   waitForExplicitFinish();
   
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_339445_sample.html";
+    "browser/components/sessionstore/test/browser_339445_sample.html";
   
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     this.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
     is(doc.getElementById("storageTestItem").textContent, "PENDING",
        "sessionStorage value has been set");
     
rename from browser/components/sessionstore/test/browser/browser_339445_sample.html
rename to browser/components/sessionstore/test/browser_339445_sample.html
rename from browser/components/sessionstore/test/browser/browser_345898.js
rename to browser/components/sessionstore/test/browser_345898.js
rename from browser/components/sessionstore/test/browser/browser_346337.js
rename to browser/components/sessionstore/test/browser_346337.js
rename from browser/components/sessionstore/test/browser/browser_346337_sample.html
rename to browser/components/sessionstore/test/browser_346337_sample.html
rename from browser/components/sessionstore/test/browser/browser_350525.js
rename to browser/components/sessionstore/test/browser_350525.js
rename from browser/components/sessionstore/test/browser/browser_354894.js
rename to browser/components/sessionstore/test/browser_354894.js
rename from browser/components/sessionstore/test/browser/browser_367052.js
rename to browser/components/sessionstore/test/browser_367052.js
rename from browser/components/sessionstore/test/browser/browser_393716.js
rename to browser/components/sessionstore/test/browser_393716.js
rename from browser/components/sessionstore/test/browser/browser_394759_basic.js
rename to browser/components/sessionstore/test/browser_394759_basic.js
rename from browser/components/sessionstore/test/browser/browser_394759_behavior.js
rename to browser/components/sessionstore/test/browser_394759_behavior.js
rename from browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js
rename to browser/components/sessionstore/test/browser_394759_privatebrowsing.js
rename from browser/components/sessionstore/test/browser/browser_394759_purge.js
rename to browser/components/sessionstore/test/browser_394759_purge.js
rename from browser/components/sessionstore/test/browser/browser_408470.js
rename to browser/components/sessionstore/test/browser_408470.js
rename from browser/components/sessionstore/test/browser/browser_408470_sample.html
rename to browser/components/sessionstore/test/browser_408470_sample.html
rename from browser/components/sessionstore/test/browser/browser_423132.js
rename to browser/components/sessionstore/test/browser_423132.js
--- a/browser/components/sessionstore/test/browser/browser_423132.js
+++ b/browser/components/sessionstore/test/browser_423132.js
@@ -43,17 +43,17 @@ function test() {
   let cs = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
   cs.removeAll();
 
   // make sure that sessionstore.js can be forced to be created by setting
   // the interval pref to 0
   gPrefService.setIntPref("browser.sessionstore.interval", 0);
 
   const testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_423132_sample.html";
+    "browser/components/sessionstore/test/browser_423132_sample.html";
 
   // open a new window
   let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", "about:blank");
 
   // make sure sessionstore saves the cookie data, then close the window
   newWin.addEventListener("load", function (aEvent) {
     newWin.removeEventListener("load", arguments.callee, false);
 
rename from browser/components/sessionstore/test/browser/browser_423132_sample.html
rename to browser/components/sessionstore/test/browser_423132_sample.html
rename from browser/components/sessionstore/test/browser/browser_447951.js
rename to browser/components/sessionstore/test/browser_447951.js
--- a/browser/components/sessionstore/test/browser/browser_447951.js
+++ b/browser/components/sessionstore/test/browser_447951.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 447951 **/
   
   waitForExplicitFinish();
   const baseURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_447951_sample.html#";
+    "browser/components/sessionstore/test/browser_447951_sample.html#";
     
   let tab = gBrowser.addTab();
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     
     let tabState = { entries: [] };
     let max_entries = gPrefService.getIntPref("browser.sessionhistory.max_entries");
     for (let i = 0; i < max_entries; i++)
rename from browser/components/sessionstore/test/browser/browser_447951_sample.html
rename to browser/components/sessionstore/test/browser_447951_sample.html
rename from browser/components/sessionstore/test/browser/browser_448741.js
rename to browser/components/sessionstore/test/browser_448741.js
rename from browser/components/sessionstore/test/browser/browser_454908.js
rename to browser/components/sessionstore/test/browser_454908.js
rename from browser/components/sessionstore/test/browser/browser_454908_sample.html
rename to browser/components/sessionstore/test/browser_454908_sample.html
rename from browser/components/sessionstore/test/browser/browser_456342.js
rename to browser/components/sessionstore/test/browser_456342.js
rename from browser/components/sessionstore/test/browser/browser_456342_sample.xhtml
rename to browser/components/sessionstore/test/browser_456342_sample.xhtml
rename from browser/components/sessionstore/test/browser/browser_459906.js
rename to browser/components/sessionstore/test/browser_459906.js
--- a/browser/components/sessionstore/test/browser/browser_459906.js
+++ b/browser/components/sessionstore/test/browser_459906.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 459906 **/
 
   waitForExplicitFinish();
 
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_459906_sample.html";
+    "browser/components/sessionstore/test/browser_459906_sample.html";
   let uniqueValue = "<b>Unique:</b> " + Date.now();
 
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 2)
       return;
rename from browser/components/sessionstore/test/browser/browser_459906_empty.html
rename to browser/components/sessionstore/test/browser_459906_empty.html
rename from browser/components/sessionstore/test/browser/browser_459906_sample.html
rename to browser/components/sessionstore/test/browser_459906_sample.html
rename from browser/components/sessionstore/test/browser/browser_461634.js
rename to browser/components/sessionstore/test/browser_461634.js
rename from browser/components/sessionstore/test/browser/browser_461743.js
rename to browser/components/sessionstore/test/browser_461743.js
--- a/browser/components/sessionstore/test/browser/browser_461743.js
+++ b/browser/components/sessionstore/test/browser_461743.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 461743 **/
 
   waitForExplicitFinish();
 
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_461743_sample.html";
+    "browser/components/sessionstore/test/browser_461743_sample.html";
 
   let frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // Wait for all frames to load completely.
     if (frameCount++ < 2)
       return;
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
rename from browser/components/sessionstore/test/browser/browser_461743_sample.html
rename to browser/components/sessionstore/test/browser_461743_sample.html
rename from browser/components/sessionstore/test/browser/browser_463205.js
rename to browser/components/sessionstore/test/browser_463205.js
--- a/browser/components/sessionstore/test/browser/browser_463205.js
+++ b/browser/components/sessionstore/test/browser_463205.js
@@ -93,17 +93,17 @@ function test() {
     
     let uniqueValue = "Unique: " + Math.random();
     let win = tab.linkedBrowser.contentWindow;
     typeText(win.frames[0].document.getElementById("original"), uniqueValue);
     typeText(win.frames[1].document.getElementById("original"), uniqueValue);
 
     mainURL = testURL;
     frame1URL = "http://mochi.test:8888/browser/" +
-      "browser/components/sessionstore/test/browser/browser_463205_helper.html";
+      "browser/components/sessionstore/test/browser_463205_helper.html";
     frame2URL = rootDir + "browser_463205_helper.html";
     frame3URL = "data:text/html,mark2";
 
     frameCount = 0;
 
     let tab2 = gBrowser.duplicateTab(tab);
     tab2.linkedBrowser.addEventListener("load", function(aEvent) {
       // wait for all frames to load (and reload!) completely
rename from browser/components/sessionstore/test/browser/browser_463205_helper.html
rename to browser/components/sessionstore/test/browser_463205_helper.html
rename from browser/components/sessionstore/test/browser/browser_463205_sample.html
rename to browser/components/sessionstore/test/browser_463205_sample.html
--- a/browser/components/sessionstore/test/browser/browser_463205_sample.html
+++ b/browser/components/sessionstore/test/browser_463205_sample.html
@@ -13,13 +13,13 @@
     frames[2].removeEventListener("DOMContentLoaded", arguments.callee, false);
     
     if (frames[2].document.location.href == "data:text/html,mark1") {
       frames[2].document.location = "data:text/html,mark2";
     }
     else {
       frames[1].document.location.hash = "#original";
       frames[0].document.location = "http://mochi.test:8888/browser/" +
-        "browser/components/sessionstore/test/browser/browser_463205_helper.html";
+        "browser/components/sessionstore/test/browser_463205_helper.html";
     }
   }, false);
 </script>
 </body>
rename from browser/components/sessionstore/test/browser/browser_463206.js
rename to browser/components/sessionstore/test/browser_463206.js
--- a/browser/components/sessionstore/test/browser/browser_463206.js
+++ b/browser/components/sessionstore/test/browser_463206.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 463206 **/
   
   waitForExplicitFinish();
   
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_463206_sample.html";
+    "browser/components/sessionstore/test/browser_463206_sample.html";
   
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 5)
       return;
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
rename from browser/components/sessionstore/test/browser/browser_463206_sample.html
rename to browser/components/sessionstore/test/browser_463206_sample.html
rename from browser/components/sessionstore/test/browser/browser_464199.js
rename to browser/components/sessionstore/test/browser_464199.js
rename from browser/components/sessionstore/test/browser/browser_464620_a.html
rename to browser/components/sessionstore/test/browser_464620_a.html
--- a/browser/components/sessionstore/test/browser/browser_464620_a.html
+++ b/browser/components/sessionstore/test/browser_464620_a.html
@@ -2,17 +2,17 @@
 
 <title>Test for bug 464620 (injection on input)</title>
 
 <iframe></iframe>
 <iframe onload="setup()"></iframe>
 
 <script>
   var targetUrl = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_464620_xd.html";
+    "browser/components/sessionstore/test/browser_464620_xd.html";
   var firstPass;
   
   function setup() {
     if (firstPass !== undefined)
       return;
     firstPass = frames[1].location.href == "about:blank";
     if (firstPass) {
       frames[0].location = 'data:text/html,<body onload="if (parent.firstPass) parent.step();"><input id="x" oninput="parent.xss()">XXX</body>';
rename from browser/components/sessionstore/test/browser/browser_464620_a.js
rename to browser/components/sessionstore/test/browser_464620_a.js
--- a/browser/components/sessionstore/test/browser/browser_464620_a.js
+++ b/browser/components/sessionstore/test/browser_464620_a.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 464620 (injection on input) **/
   
   waitForExplicitFinish();
   
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_464620_a.html";
+    "browser/components/sessionstore/test/browser_464620_a.html";
   
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 4)
       return;
     this.removeEventListener("load", arguments.callee, true);
rename from browser/components/sessionstore/test/browser/browser_464620_b.html
rename to browser/components/sessionstore/test/browser_464620_b.html
--- a/browser/components/sessionstore/test/browser/browser_464620_b.html
+++ b/browser/components/sessionstore/test/browser_464620_b.html
@@ -3,17 +3,17 @@
 <title>Test for bug 464620 (injection on DOM node insertion)</title>
 
 <iframe></iframe>
 <iframe></iframe>
 <iframe onload="setup()"></iframe>
 
 <script>
   var targetUrl = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_464620_xd.html";
+    "browser/components/sessionstore/test/browser_464620_xd.html";
   var firstPass;
   
   function setup() {
     if (firstPass !== undefined)
       return;
     firstPass = frames[2].location.href == "about:blank";
     if (firstPass) {
       frames[0].location = 'data:text/html,<body onload="parent.step()">a</body>';
rename from browser/components/sessionstore/test/browser/browser_464620_b.js
rename to browser/components/sessionstore/test/browser_464620_b.js
--- a/browser/components/sessionstore/test/browser/browser_464620_b.js
+++ b/browser/components/sessionstore/test/browser_464620_b.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 464620 (injection on DOM node insertion) **/
   
   waitForExplicitFinish();
   
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_464620_b.html";
+    "browser/components/sessionstore/test/browser_464620_b.html";
   
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 6)
       return;
     this.removeEventListener("load", arguments.callee, true);
rename from browser/components/sessionstore/test/browser/browser_464620_xd.html
rename to browser/components/sessionstore/test/browser_464620_xd.html
rename from browser/components/sessionstore/test/browser/browser_465215.js
rename to browser/components/sessionstore/test/browser_465215.js
rename from browser/components/sessionstore/test/browser/browser_465223.js
rename to browser/components/sessionstore/test/browser_465223.js
rename from browser/components/sessionstore/test/browser/browser_466937.js
rename to browser/components/sessionstore/test/browser_466937.js
--- a/browser/components/sessionstore/test/browser/browser_466937.js
+++ b/browser/components/sessionstore/test/browser_466937.js
@@ -42,17 +42,17 @@ function test() {
   var file = Components.classes["@mozilla.org/file/directory_service;1"]
              .getService(Components.interfaces.nsIProperties)
              .get("TmpD", Components.interfaces.nsILocalFile);
   file.append("466937_test.file");
   file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0666);
   let testPath = file.path;
   
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_466937_sample.html";
+    "browser/components/sessionstore/test/browser_466937_sample.html";
   
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
     doc.getElementById("reverse_thief").value = "/home/user/secret2";
     doc.getElementById("bystander").value = testPath;
     
rename from browser/components/sessionstore/test/browser/browser_466937_sample.html
rename to browser/components/sessionstore/test/browser_466937_sample.html
rename from browser/components/sessionstore/test/browser/browser_467409-backslashplosion.js
rename to browser/components/sessionstore/test/browser_467409-backslashplosion.js
rename from browser/components/sessionstore/test/browser/browser_477657.js
rename to browser/components/sessionstore/test/browser_477657.js
rename from browser/components/sessionstore/test/browser/browser_480148.js
rename to browser/components/sessionstore/test/browser_480148.js
rename from browser/components/sessionstore/test/browser/browser_480893.js
rename to browser/components/sessionstore/test/browser_480893.js
rename from browser/components/sessionstore/test/browser/browser_483330.js
rename to browser/components/sessionstore/test/browser_483330.js
rename from browser/components/sessionstore/test/browser/browser_485482.js
rename to browser/components/sessionstore/test/browser_485482.js
rename from browser/components/sessionstore/test/browser/browser_485482_sample.html
rename to browser/components/sessionstore/test/browser_485482_sample.html
rename from browser/components/sessionstore/test/browser/browser_485563.js
rename to browser/components/sessionstore/test/browser_485563.js
rename from browser/components/sessionstore/test/browser/browser_490040.js
rename to browser/components/sessionstore/test/browser_490040.js
rename from browser/components/sessionstore/test/browser/browser_491168.js
rename to browser/components/sessionstore/test/browser_491168.js
rename from browser/components/sessionstore/test/browser/browser_491577.js
rename to browser/components/sessionstore/test/browser_491577.js
rename from browser/components/sessionstore/test/browser/browser_493467.js
rename to browser/components/sessionstore/test/browser_493467.js
rename from browser/components/sessionstore/test/browser/browser_495495.js
rename to browser/components/sessionstore/test/browser_495495.js
rename from browser/components/sessionstore/test/browser/browser_500328.js
rename to browser/components/sessionstore/test/browser_500328.js
rename from browser/components/sessionstore/test/browser/browser_506482.js
rename to browser/components/sessionstore/test/browser_506482.js
rename from browser/components/sessionstore/test/browser/browser_514751.js
rename to browser/components/sessionstore/test/browser_514751.js
rename from browser/components/sessionstore/test/browser/browser_522375.js
rename to browser/components/sessionstore/test/browser_522375.js
rename from browser/components/sessionstore/test/browser/browser_522545.js
rename to browser/components/sessionstore/test/browser_522545.js
rename from browser/components/sessionstore/test/browser/browser_524745.js
rename to browser/components/sessionstore/test/browser_524745.js
rename from browser/components/sessionstore/test/browser/browser_526613.js
rename to browser/components/sessionstore/test/browser_526613.js
rename from browser/components/sessionstore/test/browser/browser_528776.js
rename to browser/components/sessionstore/test/browser_528776.js
rename from browser/components/sessionstore/test/browser/browser_579868.js
rename to browser/components/sessionstore/test/browser_579868.js
rename from browser/components/sessionstore/test/browser/browser_579879.js
rename to browser/components/sessionstore/test/browser_579879.js
rename from browser/components/sessionstore/test/browser/browser_580512.js
rename to browser/components/sessionstore/test/browser_580512.js
rename from browser/components/sessionstore/test/browser/browser_581593.js
rename to browser/components/sessionstore/test/browser_581593.js
rename from browser/components/sessionstore/test/browser/browser_581937.js
rename to browser/components/sessionstore/test/browser_581937.js
rename from browser/components/sessionstore/test/browser/browser_586068-cascaded_restore.js
rename to browser/components/sessionstore/test/browser_586068-cascaded_restore.js
rename from browser/components/sessionstore/test/browser/browser_586147.js
rename to browser/components/sessionstore/test/browser_586147.js
rename from browser/components/sessionstore/test/browser/browser_588426.js
rename to browser/components/sessionstore/test/browser_588426.js
rename from browser/components/sessionstore/test/browser/browser_589246.js
rename to browser/components/sessionstore/test/browser_589246.js
rename from browser/components/sessionstore/test/browser/browser_590268.js
rename to browser/components/sessionstore/test/browser_590268.js
rename from browser/components/sessionstore/test/browser/browser_590563.js
rename to browser/components/sessionstore/test/browser_590563.js
rename from browser/components/sessionstore/test/browser/browser_595601-restore_hidden.js
rename to browser/components/sessionstore/test/browser_595601-restore_hidden.js
rename from browser/components/sessionstore/test/browser/browser_597071.js
rename to browser/components/sessionstore/test/browser_597071.js
rename from browser/components/sessionstore/test/browser/browser_597315.js
rename to browser/components/sessionstore/test/browser_597315.js
rename from browser/components/sessionstore/test/browser/browser_597315_a.html
rename to browser/components/sessionstore/test/browser_597315_a.html
rename from browser/components/sessionstore/test/browser/browser_597315_b.html
rename to browser/components/sessionstore/test/browser_597315_b.html
rename from browser/components/sessionstore/test/browser/browser_597315_c.html
rename to browser/components/sessionstore/test/browser_597315_c.html
rename from browser/components/sessionstore/test/browser/browser_597315_c1.html
rename to browser/components/sessionstore/test/browser_597315_c1.html
rename from browser/components/sessionstore/test/browser/browser_597315_c2.html
rename to browser/components/sessionstore/test/browser_597315_c2.html
rename from browser/components/sessionstore/test/browser/browser_597315_index.html
rename to browser/components/sessionstore/test/browser_597315_index.html
rename from browser/components/sessionstore/test/browser/browser_599909.js
rename to browser/components/sessionstore/test/browser_599909.js
rename from browser/components/sessionstore/test/browser/browser_600545.js
rename to browser/components/sessionstore/test/browser_600545.js
rename from browser/components/sessionstore/test/browser/browser_601955.js
rename to browser/components/sessionstore/test/browser_601955.js
rename from browser/components/sessionstore/test/browser/browser_607016.js
rename to browser/components/sessionstore/test/browser_607016.js
rename from browser/components/sessionstore/test/browser/browser_615394-SSWindowState_events.js
rename to browser/components/sessionstore/test/browser_615394-SSWindowState_events.js
rename from browser/components/sessionstore/test/browser/browser_618151.js
rename to browser/components/sessionstore/test/browser_618151.js
rename from browser/components/sessionstore/test/browser/browser_623779.js
rename to browser/components/sessionstore/test/browser_623779.js
rename from browser/components/sessionstore/test/browser/browser_624727.js
rename to browser/components/sessionstore/test/browser_624727.js
rename from browser/components/sessionstore/test/browser/browser_625016.js
rename to browser/components/sessionstore/test/browser_625016.js
rename from browser/components/sessionstore/test/browser/browser_625257.js
rename to browser/components/sessionstore/test/browser_625257.js
rename from browser/components/sessionstore/test/browser/browser_628270.js
rename to browser/components/sessionstore/test/browser_628270.js
rename from browser/components/sessionstore/test/browser/browser_635418.js
rename to browser/components/sessionstore/test/browser_635418.js
rename from browser/components/sessionstore/test/browser/browser_636279.js
rename to browser/components/sessionstore/test/browser_636279.js
rename from browser/components/sessionstore/test/browser/browser_644409-scratchpads.js
rename to browser/components/sessionstore/test/browser_644409-scratchpads.js
rename from browser/components/sessionstore/test/browser/browser_645428.js
rename to browser/components/sessionstore/test/browser_645428.js
rename from browser/components/sessionstore/test/browser/browser_659591.js
rename to browser/components/sessionstore/test/browser_659591.js
rename from browser/components/sessionstore/test/browser/browser_662812.js
rename to browser/components/sessionstore/test/browser_662812.js
rename from browser/components/sessionstore/test/browser/browser_665702-state_session.js
rename to browser/components/sessionstore/test/browser_665702-state_session.js
rename from browser/components/sessionstore/test/browser/browser_682507.js
rename to browser/components/sessionstore/test/browser_682507.js
rename from browser/components/sessionstore/test/browser/browser_687710.js
rename to browser/components/sessionstore/test/browser_687710.js
rename from browser/components/sessionstore/test/browser/browser_687710_2.js
rename to browser/components/sessionstore/test/browser_687710_2.js
rename from browser/components/sessionstore/test/browser/browser_694378.js
rename to browser/components/sessionstore/test/browser_694378.js
rename from browser/components/sessionstore/test/browser/browser_705597.js
rename to browser/components/sessionstore/test/browser_705597.js
rename from browser/components/sessionstore/test/browser/browser_form_restore_events.js
rename to browser/components/sessionstore/test/browser_form_restore_events.js
--- a/browser/components/sessionstore/test/browser/browser_form_restore_events.js
+++ b/browser/components/sessionstore/test/browser_form_restore_events.js
@@ -39,17 +39,17 @@ function test() {
 
   waitForExplicitFinish();
 
   let file = Components.classes["@mozilla.org/file/directory_service;1"]
              .getService(Components.interfaces.nsIProperties)
              .get("TmpD", Components.interfaces.nsIFile);
 
   let testURL = "http://mochi.test:8888/browser/" +
-    "browser/components/sessionstore/test/browser/browser_form_restore_events_sample.html";
+    "browser/components/sessionstore/test/browser_form_restore_events_sample.html";
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
 
     // text fields
     doc.getElementById("modify01").value += Math.random();
     doc.getElementById("modify02").value += " " + Date.now();
rename from browser/components/sessionstore/test/browser/browser_form_restore_events_sample.html
rename to browser/components/sessionstore/test/browser_form_restore_events_sample.html
rename from browser/components/sessionstore/test/browser/head.js
rename to browser/components/sessionstore/test/head.js
rename from browser/components/sidebar/src/Makefile.in
rename to browser/components/sidebar/Makefile.in
--- a/browser/components/sidebar/src/Makefile.in
+++ b/browser/components/sidebar/Makefile.in
@@ -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 *****
 
-DEPTH		= ../../../..
+DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 EXTRA_COMPONENTS = nsSidebar.manifest
 EXTRA_PP_COMPONENTS = nsSidebar.js
rename from browser/components/sidebar/src/nsSidebar.js
rename to browser/components/sidebar/nsSidebar.js
rename from browser/components/sidebar/src/nsSidebar.manifest
rename to browser/components/sidebar/nsSidebar.manifest
rename from browser/components/test/browser/Makefile.in
rename to browser/components/test/Makefile.in
--- a/browser/components/test/browser/Makefile.in
+++ b/browser/components/test/Makefile.in
@@ -30,21 +30,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 *****
 
-DEPTH     = ../../../..
+DEPTH     = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir  = browser/components/test/browser
+relativesrcdir  = browser/components/test
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_TEST_FILES = \
   browser_bug538331.js \
   $(NULL)
 
rename from browser/components/test/browser/browser_bug538331.js
rename to browser/components/test/browser_bug538331.js
--- a/browser/config/mozconfigs/macosx-universal/nightly
+++ b/browser/config/mozconfigs/macosx-universal/nightly
@@ -11,8 +11,10 @@ ac_add_options --disable-install-strip
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 mk_add_options MOZ_MAKE_FLAGS="-j4"
+
+ac_add_options --with-macbundlename-prefix=Firefox
--- a/browser/config/mozconfigs/macosx32/debug
+++ b/browser/config/mozconfigs/macosx32/debug
@@ -2,8 +2,10 @@
 ac_add_options --enable-debug
 ac_add_options --enable-trace-malloc
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
+
+ac_add_options --with-macbundlename-prefix=Firefox
--- a/browser/config/mozconfigs/macosx64/debug
+++ b/browser/config/mozconfigs/macosx64/debug
@@ -4,8 +4,10 @@ ac_add_options --enable-debug
 ac_add_options --enable-trace-malloc
 ac_add_options --enable-accessibility
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
+
+ac_add_options --with-macbundlename-prefix=Firefox
--- a/browser/devtools/styleinspector/Makefile.in
+++ b/browser/devtools/styleinspector/Makefile.in
@@ -38,16 +38,14 @@
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifdef ENABLE_TESTS
-DIRS += test/browser
-endif
+TEST_DIRS = test
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	$(NSINSTALL) $(srcdir)/*.jsm $(FINAL_TARGET)/modules/devtools
rename from browser/devtools/styleinspector/test/browser/Makefile.in
rename to browser/devtools/styleinspector/test/Makefile.in
--- a/browser/devtools/styleinspector/test/browser/Makefile.in
+++ b/browser/devtools/styleinspector/test/Makefile.in
@@ -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 *****
 
-DEPTH     = ../../../../..
+DEPTH     = ../../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir  = browser/devtools/styleinspector/test/browser
+relativesrcdir  = browser/devtools/styleinspector/test
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_TEST_FILES = \
   browser_styleinspector.js \
   browser_bug683672.js \
   browser_styleinspector_bug_672746_default_styles.js \
rename from browser/devtools/styleinspector/test/browser/browser_bug683672.html
rename to browser/devtools/styleinspector/test/browser_bug683672.html
rename from browser/devtools/styleinspector/test/browser/browser_bug683672.js
rename to browser/devtools/styleinspector/test/browser_bug683672.js
--- a/browser/devtools/styleinspector/test/browser/browser_bug683672.js
+++ b/browser/devtools/styleinspector/test/browser_bug683672.js
@@ -2,17 +2,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that the style inspector works properly
 
 let doc;
 let stylePanel;
 
-const TEST_URI = "http://example.com/browser/browser/devtools/styleinspector/test/browser/browser_bug683672.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/styleinspector/test/browser_bug683672.html";
 
 Cu.import("resource:///modules/devtools/CssHtmlTree.jsm");
 
 function test()
 {
   waitForExplicitFinish();
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
rename from browser/devtools/styleinspector/test/browser/browser_bug_692400_element_style.js
rename to browser/devtools/styleinspector/test/browser_bug_692400_element_style.js
rename from browser/devtools/styleinspector/test/browser/browser_csslogic_inherited.js
rename to browser/devtools/styleinspector/test/browser_csslogic_inherited.js
rename from browser/devtools/styleinspector/test/browser/browser_ruleview_editor.js
rename to browser/devtools/styleinspector/test/browser_ruleview_editor.js
rename from browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js
rename to browser/devtools/styleinspector/test/browser_ruleview_inherit.js
rename from browser/devtools/styleinspector/test/browser/browser_ruleview_manipulation.js
rename to browser/devtools/styleinspector/test/browser_ruleview_manipulation.js
rename from browser/devtools/styleinspector/test/browser/browser_ruleview_override.js
rename to browser/devtools/styleinspector/test/browser_ruleview_override.js
rename from browser/devtools/styleinspector/test/browser/browser_ruleview_ui.js
rename to browser/devtools/styleinspector/test/browser_ruleview_ui.js
rename from browser/devtools/styleinspector/test/browser/browser_styleinspector.js
rename to browser/devtools/styleinspector/test/browser_styleinspector.js
rename from browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_672744_search_filter.js
rename to browser/devtools/styleinspector/test/browser_styleinspector_bug_672744_search_filter.js
rename from browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_672746_default_styles.js
rename to browser/devtools/styleinspector/test/browser_styleinspector_bug_672746_default_styles.js
rename from browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js
rename to browser/devtools/styleinspector/test/browser_styleinspector_bug_689759_no_results_placeholder.js
rename from browser/devtools/styleinspector/test/browser/head.js
rename to browser/devtools/styleinspector/test/head.js
--- a/browser/devtools/webconsole/Makefile.in
+++ b/browser/devtools/webconsole/Makefile.in
@@ -51,13 +51,11 @@ EXTRA_JS_MODULES = \
 		gcli.jsm \
 		GcliCommands.jsm \
 		$(NULL)
 
 EXTRA_PP_JS_MODULES = \
 		HUDService.jsm \
 		$(NULL)
 
-ifdef ENABLE_TESTS
-DIRS += test/browser
-endif
+TEST_DIRS = test
 
 include $(topsrcdir)/config/rules.mk
rename from browser/devtools/webconsole/test/browser/Makefile.in
rename to browser/devtools/webconsole/test/Makefile.in
--- a/browser/devtools/webconsole/test/browser/Makefile.in
+++ b/browser/devtools/webconsole/test/Makefile.in
@@ -33,21 +33,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 *****
 
-DEPTH			= ../../../../..
+DEPTH			= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH			= @srcdir@
-relativesrcdir  = browser/devtools/webconsole/test/browser
+relativesrcdir  = browser/devtools/webconsole/test
 
 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 browser/devtools/webconsole/test/browser/browser_gcli_inspect.html
rename to browser/devtools/webconsole/test/browser_gcli_inspect.html
rename from browser/devtools/webconsole/test/browser/browser_gcli_inspect.js
rename to browser/devtools/webconsole/test/browser_gcli_inspect.js
--- a/browser/devtools/webconsole/test/browser/browser_gcli_inspect.js
+++ b/browser/devtools/webconsole/test/browser_gcli_inspect.js
@@ -13,17 +13,17 @@ registerCleanupFunction(function() {
   gcliterm = undefined;
   requisition = undefined;
 
   Services.prefs.clearUserPref("devtools.gcli.enable");
 });
 
 function test() {
   Services.prefs.setBoolPref("devtools.gcli.enable", true);
-  addTab("http://example.com/browser/browser/devtools/webconsole/test/browser/browser_gcli_inspect.html");
+  addTab("http://example.com/browser/browser/devtools/webconsole/test/browser_gcli_inspect.html");
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 let gcliterm;
 let requisition;
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from browser/devtools/webconsole/test/browser/browser_gcli_integrate.js
rename to browser/devtools/webconsole/test/browser_gcli_integrate.js
--- a/browser/devtools/webconsole/test/browser/browser_gcli_integrate.js
+++ b/browser/devtools/webconsole/test/browser_gcli_integrate.js
@@ -6,17 +6,17 @@
 // - https://wiki.mozilla.org/DevTools/Features/GCLI
 
 // Tests that source URLs in the Web Console can be clicked to display the
 // standard View Source window.
 
 Components.utils.import("resource:///modules/gcli.jsm");
 let require = gcli._internal.require;
 
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
 
 registerCleanupFunction(function() {
   require = undefined;
   Services.prefs.clearUserPref("devtools.gcli.enable");
 });
 
 function test() {
   Services.prefs.setBoolPref("devtools.gcli.enable", true);
rename from browser/devtools/webconsole/test/browser/browser_gcli_require.js
rename to browser/devtools/webconsole/test/browser_gcli_require.js
rename from browser/devtools/webconsole/test/browser/browser_gcli_web.js
rename to browser/devtools/webconsole/test/browser_gcli_web.js
--- a/browser/devtools/webconsole/test/browser/browser_gcli_web.js
+++ b/browser/devtools/webconsole/test/browser_gcli_web.js
@@ -1933,17 +1933,17 @@ registerCleanupFunction(function() {
   obj = undefined;
   define = undefined;
   console = undefined;
   Node = undefined;
 });
 
 function test() {
   Services.prefs.setBoolPref("devtools.gcli.enable", true);
-  addTab("http://example.com/browser/browser/devtools/webconsole/test/browser/test-console.html");
+  addTab("http://example.com/browser/browser/devtools/webconsole/test/test-console.html");
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
   var failed = false;
 
   try {
rename from browser/devtools/webconsole/test/browser/browser_warn_user_about_replaced_api.js
rename to browser/devtools/webconsole/test/browser_warn_user_about_replaced_api.js
--- a/browser/devtools/webconsole/test/browser/browser_warn_user_about_replaced_api.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console-replaced-api.html";
+const TEST_REPLACED_API_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_abbreviate_source_url.js
rename to browser/devtools/webconsole/test/browser_webconsole_abbreviate_source_url.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_basic_net_logging.js
rename to browser/devtools/webconsole/test/browser_webconsole_basic_net_logging.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_basic_net_logging.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-network.html" + "?_date=" + Date.now();
+const TEST_NETWORK_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_578437_page_reload.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_578437_page_reload.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_578437_page_reload.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_579412_input_focus.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_579412_input_focus.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_579412_input_focus.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testInputFocus, false);
 }
 
 function testInputFocus() {
   browser.removeEventListener("DOMContentLoaded", testInputFocus, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_580001_closing_after_completion.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_580001_closing_after_completion.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580001_closing_after_completion.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testClosingAfterCompletion,
                            false);
 }
 
 function testClosingAfterCompletion() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_580030_errors_after_page_reload.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-error.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-error.html";
 
 function test() {
   expectUncaughtException();
   addTab(TEST_URI);
   browser.addEventListener("load", onLoad, true);
 }
 
 // see bug 580030: the error handler fails silently after page reload.
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_580400_groups.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_580400_groups.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580400_groups.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testGroups, false);
 }
 
 function testGroups() {
   browser.removeEventListener("DOMContentLoaded", testGroups, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_580454_timestamp_l10n.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_580454_timestamp_l10n.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_580454_timestamp_l10n.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testTimestamp, false);
 
   function testTimestamp()
   {
     browser.removeEventListener("DOMContentLoaded", testTimestamp, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_581231_close_button.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_581231_close_button.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_581231_close_button.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testCloseButton, false);
 }
 
 function testCloseButton() {
   browser.removeEventListener("DOMContentLoaded", testCloseButton, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_582201_duplicate_errors.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_582201_duplicate_errors.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_582201_duplicate_errors.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-duplicate-error.html";
+const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-duplicate-error.html";
 
 function test() {
   expectUncaughtException();
   addTab(TEST_DUPLICATE_ERROR_URI);
   browser.addEventListener("DOMContentLoaded", testDuplicateErrors, false);
 }
 
 function testDuplicateErrors() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_583816_tab_focus.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_583816_tab_focus.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_583816_tab_focus.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 let HUD, inputNode;
 
 function tabLoad(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   waitForFocus(function() {
     openConsole();
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_585237_line_limit.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_585237_line_limit.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_585237_line_limit.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testLineLimit,
                                             false);
 }
 
 function testLineLimit() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_585956_console_trace.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_585956_console_trace.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_585956_console_trace.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-585956-console-trace.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_keys.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_popup.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_popup.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_586388_select_all.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_586388_select_all.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_587617_output_copy.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_587617_output_copy.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_587617_output_copy.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded() {
   browser.removeEventListener("load", tabLoaded, true);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_588342_document_focus.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_588342_document_focus.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_588730_text_node_insertion.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_588730_text_node_insertion.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_588730_text_node_insertion.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_588967_input_expansion.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_588967_input_expansion.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_588967_input_expansion.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testInputExpansion, false);
 }
 
 function testInputExpansion() {
   browser.removeEventListener("DOMContentLoaded", testInputExpansion, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_589162_css_filter.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_589162_css_filter.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_592442_closing_brackets.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_592442_closing_brackets.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_593003_iframe_wrong_hud.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-593003-iframe-wrong-hud.html";
 
-const TEST_IFRAME_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud-iframe.html";
+const TEST_IFRAME_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-593003-iframe-wrong-hud-iframe.html";
 
-const TEST_DUMMY_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_DUMMY_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 let tab1, tab2;
 
 function test() {
   addTab(TEST_URI);
   tab1 = tab;
   browser.addEventListener("load", tab1Loaded, true);
 }
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_594477_clickable_output.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_594477_clickable_output.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_594477_clickable_output.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 let HUD;
 
 let outputItem;
 
 function tabLoad1(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   openConsole();
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_594497_history_arrow_keys.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_594497_history_arrow_keys.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_595223_file_uri.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_595223_file_uri.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_595934_message_categories.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/";
+const TESTS_PATH = "http://example.com/browser/browser/devtools/webconsole/test//";
 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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_external_script_errors.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_597136_external_script_errors.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_external_script_errors.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_597136_external_script_errors.js
@@ -4,17 +4,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  *
  * Contributor(s):
  *  Patrick Walton <pcwalton@mozilla.com>
  *
  * ***** END LICENSE BLOCK ***** */
 
 const TEST_URI = "http://example.com/browser/browser/devtools/" +
-                 "webconsole/test/browser/test-bug-597136-external-script-" +
+                 "webconsole/test/test-bug-597136-external-script-" +
                  "errors.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded(aEvent) {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_network_requests_from_chrome.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_597136_network_requests_from_chrome.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_597460_filter_scroll.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_597460_filter_scroll.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597460_filter_scroll.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-network.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_597756_reopen_closed_tab.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-597756-reopen-closed-tab.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_598357_jsterm_output.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_598357_jsterm_output.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_598357_jsterm_output.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 let testEnded = false;
 let pos = -1;
 
 let dateNow = Date.now();
 
 let inputValues = [
   // [showsPropertyPanel?, input value, expected output format,
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_599725_response_headers.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_599725_response_headers.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_599725_response_headers.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-599725-response-headers.sjs";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-599725-response-headers.sjs";
 
 let lastFinishedRequest = null;
 
 function requestDoneCallback(aHttpRequest)
 {
   lastFinishedRequest = aHttpRequest;
 }
 
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_600183_charset.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_600183_charset.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_600183_charset.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-600183-charset.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-600183-charset.html";
 
 let lastFinishedRequest = null;
 
 function requestDoneCallback(aHttpRequest)
 {
   lastFinishedRequest = aHttpRequest;
 }
 
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_601177_log_levels.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_601177_log_levels.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_601177_log_levels.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-601177-log-levels.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_601352_scroll.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_601352_scroll.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_601667_filter_buttons.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_601667_filter_buttons.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_601909_remember_height.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_601909_remember_height.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_602572_log_bodies_checkbox.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_602572_log_bodies_checkbox.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_603750_websocket.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_603750_websocket.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_603750_websocket.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-603750-websocket.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_611795.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_611795.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_613013_console_api_iframe.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_613013_console_api_iframe.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_613013_console_api_iframe.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-613013-console-api-iframe.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_613280_jsterm_copy.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_maintain_scroll.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_613642_maintain_scroll.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_prune_scroll.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_613642_prune_scroll.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_614793_jsterm_scroll.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_614793_jsterm_scroll.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_618078_network_exceptions.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_618078_network_exceptions.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_618078_network_exceptions.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-618078-network-exceptions.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-618078-network-exceptions.html";
 
 let testEnded = false;
 
 let TestObserver = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
   observe: function test_observe(aSubject)
   {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_close_panels.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_618311_close_panels.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_close_panels.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", function() {
     browser.removeEventListener("load", arguments.callee, true);
 
     openConsole();
     content.location.reload();
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_private_browsing.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_618311_private_browsing.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_private_browsing.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_621644_jsterm_dollar.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_621644_jsterm_dollar.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_621644_jsterm_dollar.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-621644-jsterm-dollar.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_622303_persistent_filters.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_622303_persistent_filters.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_626484_output_copy_order.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_626484_output_copy_order.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_630733_response_redirect_headers.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_630733_response_redirect_headers.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_630733_response_redirect_headers.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-630733-response-redirect-headers.sjs";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_632275_getters_document_width.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_632275_getters_document_width.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_632275_getters_document_width.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-632275-getters.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-632275-getters.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("load", tabLoaded, true);
 }
 
 function tabLoaded() {
   browser.removeEventListener("load", tabLoaded, true);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_632347_iterators_generators.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_632347_iterators_generators.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_632347_iterators_generators.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-632347-iterators-generators.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_632817.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_632817.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_632817.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-network-request.html";
+const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-network-request.html";
 
-const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-image.png";
+const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_642108_pruneTest.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_642108_pruneTest.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_642615_autocomplete.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_642615_autocomplete.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_644419_log_limits.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_644419_log_limits.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_644419_log_limits.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_644419_log_limits.js
@@ -3,17 +3,17 @@
  * 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/browser/devtools/" +
-                 "webconsole/test/browser/test-bug-644419-log-limits.html";
+                 "webconsole/test/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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_646025_console_file_location.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_646025_console_file_location.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_646025_console_file_location.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_646025_console_file_location.js
@@ -38,17 +38,17 @@
  * 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/browser/devtools/" +
-                 "webconsole/test/browser/" +
+                 "webconsole/test/" +
                  "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 browser/devtools/webconsole/test/browser/browser_webconsole_bug_651501_document_body_autocomplete.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_651501_document_body_autocomplete.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_653531_highlighter_console_helper.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_653531_highlighter_console_helper.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_658368_time_methods.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_658368_time_methods.js
@@ -3,17 +3,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests that the Console API implements the time() and timeEnd() methods.
 
 function test() {
   addTab("http://example.com/browser/browser/devtools/webconsole/" +
-         "test/browser/test-bug-658368-time-methods.html");
+         "test/test-bug-658368-time-methods.html");
   openConsole();
   browser.addEventListener("load", onLoad, true);
 }
 
 function onLoad(aEvent) {
   browser.removeEventListener(aEvent.type, onLoad, true);
 
   let hudId = HUDService.getHudIdByWindow(content);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_659907_console_dir.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_659907_console_dir.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_660806_history_nav.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_660806_history_nav.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_663443_panel_title.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_663443_panel_title.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_664131_console_group.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_664131_console_group.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_678816.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_678816.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_678816.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_678816.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/browser/test-console.html";
-const FRAME_SCRIPT_URI ="chrome://mochitests/content/browser/browser/devtools/webconsole/test/browser/test-bug-678816-content.js";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
+const FRAME_SCRIPT_URI ="chrome://mochitests/content/browser/browser/devtools/webconsole/test/test-bug-678816-content.js";
 
 let HUD;
 let outputItem;
 
 function tabLoad1(aEvent) {
   browser.removeEventListener(aEvent.type, arguments.callee, true);
 
   openConsole();
rename from browser/devtools/webconsole/test/browser/browser_webconsole_bug_704295.js
rename to browser/devtools/webconsole/test/browser_webconsole_bug_704295.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_704295.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_704295.js
@@ -33,17 +33,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 for bug 704295
 
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testCompletion, false);
 }
 
 function testCompletion() {
   browser.removeEventListener("DOMContentLoaded", testCompletion, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_chrome.js
rename to browser/devtools/webconsole/test/browser_webconsole_chrome.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_completion.js
rename to browser/devtools/webconsole/test/browser_webconsole_completion.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_completion.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testCompletion, false);
 }
 
 function testCompletion() {
   browser.removeEventListener("DOMContentLoaded", testCompletion, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_console_extras.js
rename to browser/devtools/webconsole/test/browser_webconsole_console_extras.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_console_extras.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console-extras.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console-extras.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_console_logging_api.js
rename to browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_console_logging_api.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_consoleonpage.js
rename to browser/devtools/webconsole/test/browser_webconsole_consoleonpage.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_consoleonpage.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-own-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-own-console.html";
 
 function test()
 {
   addTab(TEST_URI);
   browser.addEventListener("load", function() {
     browser.removeEventListener("load", arguments.callee, true);
     testOpenWebConsole();
   }, true);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
rename to browser/devtools/webconsole/test/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_execution_scope.js
rename to browser/devtools/webconsole/test/browser_webconsole_execution_scope.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_execution_scope.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testExecutionScope, false);
 }
 
 function testExecutionScope() {
   browser.removeEventListener("DOMContentLoaded", testExecutionScope,
rename from browser/devtools/webconsole/test/browser/browser_webconsole_history.js
rename to browser/devtools/webconsole/test/browser_webconsole_history.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_history.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_hud_getters.js
rename to browser/devtools/webconsole/test/browser_webconsole_hud_getters.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_hud_getters.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testHUDGetters, false);
 }
 
 function testHUDGetters() {
   browser.removeEventListener("DOMContentLoaded", testHUDGetters, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_js_input_and_output_styling.js
rename to browser/devtools/webconsole/test/browser_webconsole_js_input_and_output_styling.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_js_input_and_output_styling.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testJSInputAndOutputStyling,
                            false);
 }
 
 function testJSInputAndOutputStyling() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_js_input_expansion.js
rename to browser/devtools/webconsole/test/browser_webconsole_js_input_expansion.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_js_input_expansion.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testJSInputExpansion, false);
 }
 
 function testJSInputExpansion() {
   browser.removeEventListener("DOMContentLoaded", testJSInputExpansion,
rename from browser/devtools/webconsole/test/browser/browser_webconsole_jsterm.js
rename to browser/devtools/webconsole/test/browser_webconsole_jsterm.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_jsterm.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 let jsterm;
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testJSTerm, false);
 }
 
rename from browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_of_message_types.js
rename to browser/devtools/webconsole/test/browser_webconsole_live_filtering_of_message_types.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_of_message_types.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded",
                               testLiveFilteringOfMessageTypes, false);
 }
 
 function testLiveFilteringOfMessageTypes() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_on_search_strings.js
rename to browser/devtools/webconsole/test/browser_webconsole_live_filtering_on_search_strings.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_on_search_strings.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded",
                            testLiveFilteringOnSearchStrings, false);
 }
 
 function testLiveFilteringOnSearchStrings() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_log_node_classes.js
rename to browser/devtools/webconsole/test/browser_webconsole_log_node_classes.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_log_node_classes.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testLogNodeClasses, false);
 }
 
 function testLogNodeClasses() {
   browser.removeEventListener("DOMContentLoaded", testLogNodeClasses,
rename from browser/devtools/webconsole/test/browser/browser_webconsole_message_node_id.js
rename to browser/devtools/webconsole/test/browser_webconsole_message_node_id.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_message_node_id.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function onLoad() {
   browser.removeEventListener("DOMContentLoaded", onLoad, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_netlogging.js
rename to browser/devtools/webconsole/test/browser_webconsole_netlogging.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_netlogging.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-network-request.html";
+const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-network-request.html";
 
-const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-image.png";
+const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/browser_webconsole_network_panel.js
rename to browser/devtools/webconsole/test/browser_webconsole_network_panel.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_network_panel.js
+++ b/browser/devtools/webconsole/test/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/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";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
+const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test//test-image.png";
+const TEST_ENCODING_ISO_8859_1 = "http://example.com/browser/browser/devtools/webconsole/test//test-encoding-ISO-8859-1.html";
 
 let testDriver;
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testNetworkPanel, false);
 }
 
rename from browser/devtools/webconsole/test/browser/browser_webconsole_notifications.js
rename to browser/devtools/webconsole/test/browser_webconsole_notifications.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_notifications.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   observer.init();
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", onLoad, false);
 }
 
 function webConsoleCreated(aID)
rename from browser/devtools/webconsole/test/browser/browser_webconsole_null_and_undefined_output.js
rename to browser/devtools/webconsole/test/browser_webconsole_null_and_undefined_output.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_null_and_undefined_output.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testNullAndUndefinedOutput,
                            false);
 }
 
 function testNullAndUndefinedOutput() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_output_order.js
rename to browser/devtools/webconsole/test/browser_webconsole_output_order.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_output_order.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testOutputOrder, false);
 }
 
 function testOutputOrder() {
   browser.removeEventListener("DOMContentLoaded", testOutputOrder, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_position_ui.js
rename to browser/devtools/webconsole/test/browser_webconsole_position_ui.js
rename from browser/devtools/webconsole/test/browser/browser_webconsole_property_panel.js
rename to browser/devtools/webconsole/test/browser_webconsole_property_panel.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_property_panel.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testPropertyPanel, false);
 }
 
 function testPropertyPanel() {
   browser.removeEventListener("DOMContentLoaded", testPropertyPanel, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_property_provider.js
rename to browser/devtools/webconsole/test/browser_webconsole_property_provider.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_property_provider.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testPropertyProvider, false);
 }
 
 function testPropertyProvider() {
   browser.removeEventListener("DOMContentLoaded", testPropertyProvider,
rename from browser/devtools/webconsole/test/browser/browser_webconsole_registries.js
rename to browser/devtools/webconsole/test/browser_webconsole_registries.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_registries.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-console.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
 
 function test() {
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testRegistries, false);
 }
 
 function testRegistries() {
   browser.removeEventListener("DOMContentLoaded", testRegistries, false);
rename from browser/devtools/webconsole/test/browser/browser_webconsole_view_source.js
rename to browser/devtools/webconsole/test/browser_webconsole_view_source.js
--- a/browser/devtools/webconsole/test/browser/browser_webconsole_view_source.js
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-error.html";
+const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-error.html";
 
 function test() {
   expectUncaughtException();
   addTab(TEST_URI);
   browser.addEventListener("DOMContentLoaded", testViewSource, false);
 }
 
 function testViewSource() {
rename from browser/devtools/webconsole/test/browser/browser_webconsole_window_zombie.js
rename to browser/devtools/webconsole/test/browser_webconsole_window_zombie.js
rename from browser/devtools/webconsole/test/browser/head.js
rename to browser/devtools/webconsole/test/head.js
rename from browser/devtools/webconsole/test/browser/test-bug-585956-console-trace.html
rename to browser/devtools/webconsole/test/test-bug-585956-console-trace.html
rename from browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud-iframe.html
rename to browser/devtools/webconsole/test/test-bug-593003-iframe-wrong-hud-iframe.html
rename from browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud.html
rename to browser/devtools/webconsole/test/test-bug-593003-iframe-wrong-hud.html
--- a/browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud.html
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud-iframe.html"></iframe>
+       src="http://example.com/browser/browser/devtools/webconsole/test//test-bug-593003-iframe-wrong-hud-iframe.html"></iframe>
    </body>
  </html>
rename from browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.html
rename to browser/devtools/webconsole/test/test-bug-595934-canvas-css.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.js
rename to browser/devtools/webconsole/test/test-bug-595934-canvas-css.js
rename from browser/devtools/webconsole/test/browser/test-bug-595934-canvas.html
rename to browser/devtools/webconsole/test/test-bug-595934-canvas.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-canvas.js
rename to browser/devtools/webconsole/test/test-bug-595934-canvas.js
rename from browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css
rename to browser/devtools/webconsole/test/test-bug-595934-css-loader.css
rename from browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css^headers^
rename to browser/devtools/webconsole/test/test-bug-595934-css-loader.css^headers^
rename from browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.html
rename to browser/devtools/webconsole/test/test-bug-595934-css-loader.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.css
rename to browser/devtools/webconsole/test/test-bug-595934-css-parser.css
rename from browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.html
rename to browser/devtools/webconsole/test/test-bug-595934-css-parser.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.html
rename to browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.js
rename to browser/devtools/webconsole/test/test-bug-595934-dom-events-external2.js
rename from browser/devtools/webconsole/test/browser/test-bug-595934-dom-events.html
rename to browser/devtools/webconsole/test/test-bug-595934-dom-events.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.html
rename to browser/devtools/webconsole/test/test-bug-595934-dom-html-external.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.js
rename to browser/devtools/webconsole/test/test-bug-595934-dom-html-external.js
rename from browser/devtools/webconsole/test/browser/test-bug-595934-dom-html.html
rename to browser/devtools/webconsole/test/test-bug-595934-dom-html.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.html
rename to browser/devtools/webconsole/test/test-bug-595934-empty-getelementbyid.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.js
rename to browser/devtools/webconsole/test/test-bug-595934-empty-getelementbyid.js
rename from browser/devtools/webconsole/test/browser/test-bug-595934-html.html
rename to browser/devtools/webconsole/test/test-bug-595934-html.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-image.html
rename to browser/devtools/webconsole/test/test-bug-595934-image.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-image.jpg
rename to browser/devtools/webconsole/test/test-bug-595934-image.jpg
rename from browser/devtools/webconsole/test/browser/test-bug-595934-imagemap.html
rename to browser/devtools/webconsole/test/test-bug-595934-imagemap.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.html
rename to browser/devtools/webconsole/test/test-bug-595934-malformedxml-external.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.xml
rename to browser/devtools/webconsole/test/test-bug-595934-malformedxml-external.xml
rename from browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml.xhtml
rename to browser/devtools/webconsole/test/test-bug-595934-malformedxml.xhtml
rename from browser/devtools/webconsole/test/browser/test-bug-595934-svg.xhtml
rename to browser/devtools/webconsole/test/test-bug-595934-svg.xhtml
rename from browser/devtools/webconsole/test/browser/test-bug-595934-workers.html
rename to browser/devtools/webconsole/test/test-bug-595934-workers.html
rename from browser/devtools/webconsole/test/browser/test-bug-595934-workers.js
rename to browser/devtools/webconsole/test/test-bug-595934-workers.js
rename from browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.html
rename to browser/devtools/webconsole/test/test-bug-597136-external-script-errors.html
rename from browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.js
rename to browser/devtools/webconsole/test/test-bug-597136-external-script-errors.js
rename from browser/devtools/webconsole/test/browser/test-bug-597756-reopen-closed-tab.html
rename to browser/devtools/webconsole/test/test-bug-597756-reopen-closed-tab.html
rename from browser/devtools/webconsole/test/browser/test-bug-599725-response-headers.sjs
rename to browser/devtools/webconsole/test/test-bug-599725-response-headers.sjs
rename from browser/devtools/webconsole/test/browser/test-bug-600183-charset.html
rename to browser/devtools/webconsole/test/test-bug-600183-charset.html
rename from browser/devtools/webconsole/test/browser/test-bug-600183-charset.html^headers^
rename to browser/devtools/webconsole/test/test-bug-600183-charset.html^headers^
rename from browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.html
rename to browser/devtools/webconsole/test/test-bug-601177-log-levels.html
rename from browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.js
rename to browser/devtools/webconsole/test/test-bug-601177-log-levels.js
rename from browser/devtools/webconsole/test/browser/test-bug-603750-websocket.html
rename to browser/devtools/webconsole/test/test-bug-603750-websocket.html
rename from browser/devtools/webconsole/test/browser/test-bug-603750-websocket.js
rename to browser/devtools/webconsole/test/test-bug-603750-websocket.js
rename from browser/devtools/webconsole/test/browser/test-bug-613013-console-api-iframe.html
rename to browser/devtools/webconsole/test/test-bug-613013-console-api-iframe.html
rename from browser/devtools/webconsole/test/browser/test-bug-618078-network-exceptions.html
rename to browser/devtools/webconsole/test/test-bug-618078-network-exceptions.html
rename from browser/devtools/webconsole/test/browser/test-bug-621644-jsterm-dollar.html
rename to browser/devtools/webconsole/test/test-bug-621644-jsterm-dollar.html
rename from browser/devtools/webconsole/test/browser/test-bug-630733-response-redirect-headers.sjs
rename to browser/devtools/webconsole/test/test-bug-630733-response-redirect-headers.sjs
rename from browser/devtools/webconsole/test/browser/test-bug-632275-getters.html
rename to browser/devtools/webconsole/test/test-bug-632275-getters.html
rename from browser/devtools/webconsole/test/browser/test-bug-632347-iterators-generators.html
rename to browser/devtools/webconsole/test/test-bug-632347-iterators-generators.html
rename from browser/devtools/webconsole/test/browser/test-bug-644419-log-limits.html
rename to browser/devtools/webconsole/test/test-bug-644419-log-limits.html
rename from browser/devtools/webconsole/test/browser/test-bug-646025-console-file-location.html
rename to browser/devtools/webconsole/test/test-bug-646025-console-file-location.html
rename from browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html
rename to browser/devtools/webconsole/test/test-bug-658368-time-methods.html
rename from browser/devtools/webconsole/test/browser/test-bug-678816-content.js
rename to browser/devtools/webconsole/test/test-bug-678816-content.js
rename from browser/devtools/webconsole/test/browser/test-console-extras.html
rename to browser/devtools/webconsole/test/test-console-extras.html
rename from browser/devtools/webconsole/test/browser/test-console-replaced-api.html
rename to browser/devtools/webconsole/test/test-console-replaced-api.html
rename from browser/devtools/webconsole/test/browser/test-console.html
rename to browser/devtools/webconsole/test/test-console.html
rename from browser/devtools/webconsole/test/browser/test-data.json
rename to browser/devtools/webconsole/test/test-data.json
rename from browser/devtools/webconsole/test/browser/test-duplicate-error.html
rename to browser/devtools/webconsole/test/test-duplicate-error.html
rename from browser/devtools/webconsole/test/browser/test-encoding-ISO-8859-1.html
rename to browser/devtools/webconsole/test/test-encoding-ISO-8859-1.html
rename from browser/devtools/webconsole/test/browser/test-error.html
rename to browser/devtools/webconsole/test/test-error.html
rename from browser/devtools/webconsole/test/browser/test-file-location.js
rename to browser/devtools/webconsole/test/test-file-location.js
rename from browser/devtools/webconsole/test/browser/test-filter.html
rename to browser/devtools/webconsole/test/test-filter.html
rename from browser/devtools/webconsole/test/browser/test-image.png
rename to browser/devtools/webconsole/test/test-image.png
rename from browser/devtools/webconsole/test/browser/test-mutation.html
rename to browser/devtools/webconsole/test/test-mutation.html
rename from browser/devtools/webconsole/test/browser/test-network-request.html
rename to browser/devtools/webconsole/test/test-network-request.html
--- a/browser/devtools/webconsole/test/browser/test-network-request.html
+++ b/browser/devtools/webconsole/test/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/browser/devtools/webconsole/test//browser/test-network-request.html" method="post">
+    <form action="http://example.com/browser/browser/devtools/webconsole/test//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 browser/devtools/webconsole/test/browser/test-network.html
rename to browser/devtools/webconsole/test/test-network.html
rename from browser/devtools/webconsole/test/browser/test-observe-http-ajax.html
rename to browser/devtools/webconsole/test/test-observe-http-ajax.html
rename from browser/devtools/webconsole/test/browser/test-own-console.html
rename to browser/devtools/webconsole/test/test-own-console.html
rename from browser/devtools/webconsole/test/browser/test-property-provider.html
rename to browser/devtools/webconsole/test/test-property-provider.html
rename from browser/devtools/webconsole/test/browser/testscript.js
rename to browser/devtools/webconsole/test/testscript.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -53,16 +53,17 @@
 #endif
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 @BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
 #else
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 #endif
 #ifdef XP_WIN32
+@BINPATH@/@DLL_PREFIX@gkmedias@DLL_SUFFIX@
 #if _MSC_VER == 1400
 @BINPATH@/Microsoft.VC80.CRT.manifest
 @BINPATH@/msvcm80.dll
 @BINPATH@/msvcp80.dll
 @BINPATH@/msvcr80.dll
 #elif _MSC_VER == 1500
 @BINPATH@/Microsoft.VC90.CRT.manifest
 @BINPATH@/msvcm90.dll
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -389,17 +389,17 @@
 ; The IconHandler reference for FirefoxHTML can end up in an inconsistent state
 ; due to changes not being detected by the IconHandler for side by side
 ; installs (see bug 268512). The symptoms can be either an incorrect icon or no
 ; icon being displayed for files associated with Firefox (does not use SHCTX).
 !macro FixShellIconHandler
   ClearErrors
   ReadRegStr $1 HKLM "Software\Classes\FirefoxHTML\ShellEx\IconHandler" ""
   ${Unless} ${Errors}
-    ReadRegStr $1 HKLM "Software\Classes\FirefoxHTML\" ""
+    ReadRegStr $1 HKLM "Software\Classes\FirefoxHTML\DefaultIcon" ""
     ${GetLongPath} "$INSTDIR\${FileMainEXE}" $2
     ${If} "$1" != "$2,1"
       WriteRegStr HKLM "Software\Classes\FirefoxHTML\DefaultIcon" "" "$2,1"
     ${EndIf}
   ${EndUnless}
 !macroend
 !define FixShellIconHandler "!insertmacro FixShellIconHandler"
 
--- a/browser/locales/en-US/chrome/browser/migration/migration.dtd
+++ b/browser/locales/en-US/chrome/browser/migration/migration.dtd
@@ -4,18 +4,16 @@
 <!ENTITY importFrom.label               "Import Options, Bookmarks, History, Passwords and other data from:">
 <!ENTITY importFromUnix.label           "Import Preferences, Bookmarks, History, Passwords and other data from:">
 <!ENTITY importFromBookmarks.label      "Import Bookmarks from:">
 
 <!ENTITY importFromIE.label             "Microsoft Internet Explorer">
 <!ENTITY importFromIE.accesskey         "M">
 <!ENTITY importFromNothing.label        "Don't import anything">
 <!ENTITY importFromNothing.accesskey    "D">
-<!ENTITY importFromOpera.label          "Opera">
-<!ENTITY importFromOpera.accesskey      "O">
 <!ENTITY importFromSafari.label         "Safari">
 <!ENTITY importFromSafari.accesskey     "S">
 <!ENTITY importFromChrome.label         "Chrome">
 <!ENTITY importFromChrome.accesskey     "C">
 <!ENTITY importFromHTMLFile.label       "From an HTML File">
 <!ENTITY importFromHTMLFile.accesskey   "F">
 
 <!ENTITY noMigrationSources.label       "No programs that contain bookmarks, history or password data could be found.">
--- a/browser/locales/en-US/chrome/browser/migration/migration.properties
+++ b/browser/locales/en-US/chrome/browser/migration/migration.properties
@@ -1,53 +1,43 @@
 profileName_format=%S %S
 
 # Browser Specific
 sourceNameIE=Internet Explorer
-sourceNameOpera=Opera
 sourceNameSafari=Safari
 sourceNameChrome=Google Chrome
 
 importedBookmarksFolder=From %S
 importedSearchURLsFolder=Keyword Searches (From %S)
 importedSearchURLsTitle=Search on %S
 importedSearchUrlDesc=Type "%S <search query>" in the Location Bar to perform a search on %S.
 
 importedSafariBookmarks=From Safari
-importedOperaHotlistTitle=From Opera
-importedOperaSearchUrls=Keyword Searches (From Opera)
 
 # Import Sources
 1_ie=Internet Options
-1_opera=Preferences
 1_safari=Preferences
 1_chrome=Preferences
 
 2_ie=Cookies
-2_opera=Cookies
 2_safari=Cookies
 2_chrome=Cookies
 
 4_ie=Browsing History
-4_opera=Browsing History
 4_safari=Browsing History
 4_chrome=Browsing History
 
 8_ie=Saved Form History
-8_opera=Saved Form History
 8_safari=Saved Form History
 8_chrome=Saved Form History
 
 16_ie=Saved Passwords
-16_opera=Saved Passwords
 16_safari=Saved Passwords
 16_chrome=Saved Passwords
 
 32_ie=Favorites
-32_opera=Bookmarks
 32_safari=Bookmarks
 32_chrome=Bookmarks
 
 64_ie=Other Data
-64_opera=Other Data
 64_safari=Other Data
 64_chrome=Other Data
 
--- a/browser/makefiles.sh
+++ b/browser/makefiles.sh
@@ -57,17 +57,17 @@ browser/components/migration/src/Makefil
 browser/components/places/Makefile
 browser/components/places/src/Makefile
 browser/components/preferences/Makefile
 browser/components/privatebrowsing/Makefile
 browser/components/privatebrowsing/src/Makefile
 browser/components/search/Makefile
 browser/components/sessionstore/Makefile
 browser/components/sessionstore/src/Makefile
-browser/components/sidebar/src/Makefile
+browser/components/sidebar/Makefile
 browser/components/shell/Makefile
 browser/components/shell/public/Makefile
 browser/components/shell/src/Makefile
 browser/components/tabview/Makefile
 browser/devtools/Makefile
 browser/devtools/highlighter/Makefile
 browser/devtools/scratchpad/Makefile
 browser/devtools/shared/Makefile
@@ -75,32 +75,30 @@ browser/devtools/sourceeditor/Makefile
 browser/devtools/styleeditor/Makefile
 browser/devtools/styleinspector/Makefile
 browser/devtools/webconsole/Makefile
 browser/fuel/Makefile
 browser/fuel/public/Makefile
 browser/fuel/src/Makefile
 browser/installer/Makefile
 browser/locales/Makefile
+browser/modules/Makefile
 browser/themes/Makefile
 $MOZ_BRANDING_DIRECTORY/Makefile
 $MOZ_BRANDING_DIRECTORY/content/Makefile
 $MOZ_BRANDING_DIRECTORY/locales/Makefile
 "
 
 if [ "$MOZ_SAFE_BROWSING" ]; then
   add_makefiles "
     browser/components/safebrowsing/Makefile
   "
 fi
 
 if [ "$MOZ_WIDGET_TOOLKIT" = "windows" ]; then
-  add_makefiles "
-    browser/components/wintaskbar/Makefile
-  "
   if [ "$MOZ_INSTALLER" ]; then
     add_makefiles "
       browser/installer/windows/Makefile
     "
   fi
 fi
 
 if [ "$MOZ_WIDGET_TOOLKIT" = "gtk2" -o "$MOZ_WIDGET_TOOLKIT" = "qt" ]; then
@@ -122,39 +120,35 @@ fi
 
 if [ "$ENABLE_TESTS" ]; then
   add_makefiles "
     browser/base/content/test/Makefile
     browser/components/certerror/test/Makefile
     browser/components/dirprovider/tests/Makefile
     browser/components/preferences/tests/Makefile
     browser/components/search/test/Makefile
-    browser/components/sessionstore/test/browser/Makefile
+    browser/components/sessionstore/test/Makefile
     browser/components/shell/test/Makefile
     browser/components/feeds/test/Makefile
     browser/components/feeds/test/chrome/Makefile
     browser/components/places/tests/Makefile
     browser/components/places/tests/chrome/Makefile
     browser/components/places/tests/browser/Makefile
     browser/components/privatebrowsing/test/Makefile
     browser/components/privatebrowsing/test/browser/Makefile
     browser/components/tabview/test/Makefile
-    browser/components/test/browser/Makefile
+    browser/components/test/Makefile
     browser/devtools/highlighter/test/Makefile
     browser/devtools/scratchpad/test/Makefile
     browser/devtools/shared/test/Makefile
     browser/devtools/sourceeditor/test/Makefile
     browser/devtools/styleeditor/test/Makefile
-    browser/devtools/styleinspector/test/browser/Makefile
-    browser/devtools/webconsole/test/browser/Makefile
+    browser/devtools/styleinspector/test/Makefile
+    browser/devtools/webconsole/test/Makefile
     browser/fuel/test/Makefile
+    browser/modules/test/Makefile
   "
   if [ "$MOZ_SAFE_BROWSING" ]; then
     add_makefiles "
       browser/components/safebrowsing/content/test/Makefile
     "
   fi
-  if [ "$MOZ_WIDGET_TOOLKIT" = "windows" ]; then
-    add_makefiles "
-      browser/components/wintaskbar/test/Makefile
-    "
-  fi
 fi
copy from browser/base/Makefile.in
copy to browser/modules/Makefile.in
--- a/browser/base/Makefile.in
+++ b/browser/modules/Makefile.in
@@ -1,9 +1,8 @@
-#
 # ***** 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/
 #
@@ -40,46 +39,25 @@ DEPTH   = ../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH   = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-abs_srcdir = $(call core_abspath,$(srcdir))
-
-CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
-
 ifdef ENABLE_TESTS
-DIRS += content/test
+DIRS += test
 endif
 
 EXTRA_JS_MODULES = \
-	content/openLocationLastURL.jsm \
-	content/NetworkPrioritizer.jsm \
-	$(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-PRE_RELEASE_SUFFIX := ""
-
-DEFINES += \
-	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
-	-DAPP_LICENSE_BLOCK=$(abs_srcdir)/content/overrides/app-license.html \
-	-DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)" \
+	openLocationLastURL.jsm \
+	NetworkPrioritizer.jsm \
 	$(NULL)
 
-ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DHAVE_SHELL_SERVICE=1
-endif
-
-ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1
+ifeq ($(MOZ_WIDGET_TOOLKIT),windows) 
+EXTRA_JS_MODULES += \
+	WindowsPreviewPerTab.jsm \
+	WindowsJumpLists.jsm \
+	$(NULL)
 endif
 
-ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DCAN_DRAW_IN_TITLEBAR=1
-endif
-
-ifneq (,$(filter windows gtk2, $(MOZ_WIDGET_TOOLKIT)))
-DEFINES += -DMENUBAR_CAN_AUTOHIDE=1
-endif
+include $(topsrcdir)/config/rules.mk
rename from browser/base/content/NetworkPrioritizer.jsm
rename to browser/modules/NetworkPrioritizer.jsm
rename from browser/components/wintaskbar/WindowsJumpLists.jsm
rename to browser/modules/WindowsJumpLists.jsm
rename from browser/components/wintaskbar/WindowsPreviewPerTab.jsm
rename to browser/modules/WindowsPreviewPerTab.jsm
rename from browser/base/content/openLocationLastURL.jsm
rename to browser/modules/openLocationLastURL.jsm
new file mode 100644
--- /dev/null
+++ b/browser/modules/test/Makefile.in
@@ -0,0 +1,57 @@
+# ***** 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
+# Mozilla Foundation.
+# Portions created by the Initial Developer are Copyright (C) 2007
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# 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		= ../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+relativesrcdir  = browser/modules/test
+
+include $(DEPTH)/config/autoconf.mk
+include $(topsrcdir)/config/rules.mk
+
+_BROWSER_FILES = \
+                 browser_NetworkPrioritizer.js \
+                 $(NULL)
+
+ifeq ($(MOZ_WIDGET_TOOLKIT),windows) 
+_BROWSER_FILES += \
+                 browser_taskbar_preview.js \
+                 $(NULL)
+endif
+
+libs::	$(_BROWSER_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
rename from browser/base/content/test/browser_NetworkPrioritizer.js
rename to browser/modules/test/browser_NetworkPrioritizer.js
rename from browser/components/wintaskbar/test/browser_taskbar_preview.js
rename to browser/modules/test/browser_taskbar_preview.js
--- a/browser/components/wintaskbar/test/browser_taskbar_preview.js
+++ b/browser/modules/test/browser_taskbar_preview.js
@@ -9,17 +9,17 @@ function test() {
 
   is(!!Win7Features, isWin7OrHigher, "Win7Features available when it should be");
   if (!isWin7OrHigher)
     return;
 
   const ENABLE_PREF_NAME = "browser.taskbar.previews.enable";
 
   let temp = {};
-  Cu.import("resource://gre/modules/WindowsPreviewPerTab.jsm", temp);
+  Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", temp);
   let AeroPeek = temp.AeroPeek;
 
   waitForExplicitFinish();
 
   gPrefService.setBoolPref(ENABLE_PREF_NAME, true);
 
   is(1, AeroPeek.windows.length, "Got the expected number of windows");
 
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -393,16 +393,21 @@ user_pref("urlclassifier.updateinterval"
 user_pref("browser.safebrowsing.provider.0.gethashURL", "http://%(server)s/safebrowsing-dummy/gethash");
 user_pref("browser.safebrowsing.provider.0.keyURL", "http://%(server)s/safebrowsing-dummy/newkey");
 user_pref("browser.safebrowsing.provider.0.updateURL", "http://%(server)s/safebrowsing-dummy/update");
 // Point update checks to the local testing server for fast failures
 user_pref("extensions.update.url", "http://%(server)s/extensions-dummy/updateURL");
 user_pref("extensions.blocklist.url", "http://%(server)s/extensions-dummy/blocklistURL");
 // Make sure opening about:addons won't hit the network
 user_pref("extensions.webservice.discoverURL", "http://%(server)s/extensions-dummy/discoveryURL");
+// Make sure AddonRepository won't hit the network
+user_pref("extensions.getAddons.maxResults", 0);
+user_pref("extensions.getAddons.get.url", "http://%(server)s/extensions-dummy/repositoryGetURL");
+user_pref("extensions.getAddons.search.browseURL", "http://%(server)s/extensions-dummy/repositoryBrowseURL");
+user_pref("extensions.getAddons.search.url", "http://%(server)s/extensions-dummy/repositorySearchURL");
 """ % { "server" : self.webServer + ":" + str(self.httpPort) }
     prefs.append(part)
 
     if useServerLocations == False:
       part = """
 user_pref("capability.principal.codebase.p1.granted",
           "UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite \
            UniversalPreferencesRead UniversalPreferencesWrite \
--- a/build/binary-location.mk
+++ b/build/binary-location.mk
@@ -48,17 +48,13 @@ endif
 endif
 
 TARGET_DIST = $(TARGET_DEPTH)/dist
 
 ifeq ($(MOZ_BUILD_APP),camino)
 browser_path = $(TARGET_DIST)/Camino.app/Contents/MacOS/Camino
 else
 ifeq ($(OS_ARCH),Darwin)
-ifdef MOZ_DEBUG
-browser_path = $(TARGET_DIST)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)
-else
-browser_path = $(TARGET_DIST)/$(MOZ_APP_DISPLAYNAME).app/Contents/MacOS/$(PROGRAM)
-endif
+browser_path = $(TARGET_DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
 else
 browser_path = $(TARGET_DIST)/bin/$(PROGRAM)
 endif
 endif
new file mode 100644
--- /dev/null
+++ b/build/link.py
@@ -0,0 +1,79 @@
+# ***** 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 cl.py: a python wrapper for cl to automatically generate
+# dependency information.
+#
+# 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):
+#   Ted Mielczarek <ted@mielczarek.org>
+#
+# 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 *****
+
+from __future__ import with_statement
+import os, platform, subprocess, sys, threading, time
+from win32 import procmem
+
+def measure_vsize_threadfunc(proc, output_file):
+    """
+    Measure the virtual memory usage of |proc| at regular intervals
+    until it exits, then print the maximum value and write it to
+    |output_file|.
+    """
+    maxvsize = 0
+    while proc.returncode is None:
+        maxvsize, vsize = procmem.get_vmsize(proc._handle)
+        time.sleep(0.5)
+    print "linker max virtual size: %d" % maxvsize
+    with open(output_file, "w") as f:
+        f.write("%d\n" % maxvsize)
+
+def measure_link_vsize(output_file, args):
+    """
+    Execute |args|, and measure the maximum virtual memory usage of the process,
+    printing it to stdout when finished.
+    """
+    proc = subprocess.Popen(args)
+    t = threading.Thread(target=measure_vsize_threadfunc,
+                         args=(proc, output_file))
+    t.start()
+    # Wait for the linker to finish.
+    exitcode = proc.wait()
+    # ...and then wait for the background thread to finish.
+    t.join()
+    return exitcode
+
+if __name__ == "__main__":
+    if platform.system() != "Windows":
+        print >>sys.stderr, "link.py is only for use on Windows!"
+        sys.exit(1)
+    if len(sys.argv) < 3:
+        print >>sys.stderr, "Usage: link.py <output filename> <commandline>"
+        sys.exit(1)
+    sys.exit(measure_link_vsize(sys.argv[1], sys.argv[2:]))
--- a/build/macosx/js-icc-flight.mk
+++ b/build/macosx/js-icc-flight.mk
@@ -1,16 +1,10 @@
 OBJDIR_ICC = $(MOZ_OBJDIR)/js-icc
 OBJDIR_X86 = $(MOZ_OBJDIR)/i386
 
 include $(OBJDIR_X86)/config/autoconf.mk
 include $(TOPSRCDIR)/config/config.mk
 
-ifdef MOZ_DEBUG
-DBGTAG = Debug
-else
-DBGTAG =
-endif
-
 # Just copy the icc-produced libmozjs.dylib over
 postflight_all:
 	echo "Postflight: copying libmozjs.dylib..."
-	$(INSTALL) $(OBJDIR_ICC)/dist/bin/libmozjs.dylib $(OBJDIR_X86)/dist/$(MOZ_APP_DISPLAYNAME)$(DBGTAG).app/Contents/MacOS/
+	$(INSTALL) $(OBJDIR_ICC)/dist/bin/libmozjs.dylib $(OBJDIR_X86)/dist/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/
--- a/build/macosx/universal/flight.mk
+++ b/build/macosx/universal/flight.mk
@@ -46,36 +46,30 @@ DIST_ARCH_2 = $(OBJDIR_ARCH_2)/dist
 DIST_UNI = $(DIST_ARCH_1)/universal
 OBJDIR = $(OBJDIR_ARCH_1)
 endif
 
 include $(OBJDIR)/config/autoconf.mk
 
 DIST = $(OBJDIR)/dist
 
-ifdef MOZ_DEBUG
-DBGTAG = Debug
-else
-DBGTAG =
-endif
-
 ifdef LIBXUL_SDK # {
 APP_CONTENTS = Contents/Frameworks/XUL.framework
 else # } {
 APP_CONTENTS = Contents/MacOS
 endif # } LIBXUL_SDK
 
 ifeq ($(MOZ_BUILD_APP),camino) # {
 INSTALLER_DIR = camino/installer
 MOZ_PKG_APPNAME = camino
 APPNAME = Camino.app
 BUILDCONFIG_BASE = Contents/MacOS/chrome
 else # } {
 MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
-APPNAME = $(MOZ_APP_DISPLAYNAME)$(DBGTAG).app
+APPNAME = $(MOZ_MACBUNDLE_NAME)
 INSTALLER_DIR = $(MOZ_BUILD_APP)/installer
 ifeq ($(MOZ_BUILD_APP),xulrunner) # {
 INSTALLER_DIR = xulrunner/installer/mac
 APPNAME = XUL.framework
 APP_CONTENTS = Versions/Current
 endif # } xulrunner
 BUILDCONFIG_BASE = $(APP_CONTENTS)/chrome
 endif # } !camino
--- a/build/pgo/Makefile.in
+++ b/build/pgo/Makefile.in
@@ -50,26 +50,24 @@ DIRS = \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 # We install to _profile/pgo
 TARGET_DEPTH = ../..
 include $(topsrcdir)/build/automation-build.mk
 
+# Need to override the browser_path from binary-location.mk (included via automation-build.mk)
+# since we want to run from e.g. dist/firefox rather than dist/bin
 ifeq ($(OS_ARCH),Darwin)
-ifdef MOZ_DEBUG
-browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)\"
-else
-browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)/$(MOZ_APP_DISPLAYNAME).app/Contents/MacOS/$(PROGRAM)\"
-endif
+browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)\"
 else
 browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)/$(PROGRAM)\"
 endif
-
+   
 # Stuff to make a build with a profile
 
 _PGO_FILES = 	\
   automation.py \
   $(topsrcdir)/build/automationutils.py \
   profileserver.py \
   genpgocert.py \
   index.html \
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/build/win32/procmem.py
@@ -0,0 +1,82 @@
+# ***** 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 cl.py: a python wrapper for cl to automatically generate
+# dependency information.
+#
+# 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):
+#   Ted Mielczarek <ted@mielczarek.org>
+#
+# 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 *****
+
+import os, sys, ctypes, ctypes.wintypes
+
+class VM_COUNTERS(ctypes.Structure):
+    _fields_ = [("PeakVirtualSize", ctypes.wintypes.ULONG),
+                ("VirtualSize", ctypes.wintypes.ULONG),
+                ("PageFaultCount", ctypes.wintypes.ULONG),
+                ("PeakWorkingSetSize", ctypes.wintypes.ULONG),
+                ("WorkingSetSize", ctypes.wintypes.ULONG),
+                ("QuotaPeakPagedPoolUsage", ctypes.wintypes.ULONG),
+                ("QuotaPagedPoolUsage", ctypes.wintypes.ULONG),
+                ("QuotaPeakNonPagedPoolUsage", ctypes.wintypes.ULONG),
+                ("QuotaNonPagedPoolUsage", ctypes.wintypes.ULONG),
+                ("PagefileUsage", ctypes.wintypes.ULONG),
+                ("PeakPagefileUsage", ctypes.wintypes.ULONG)
+                ]
+
+def get_vmsize(handle):
+    """
+    Return (peak_virtual_size, virtual_size) for the process |handle|.
+    """
+    ProcessVmCounters = 3
+    vmc = VM_COUNTERS()
+    if ctypes.windll.ntdll.NtQueryInformationProcess(int(handle),
+                                                     ProcessVmCounters,
+                                                     ctypes.byref(vmc),
+                                                     ctypes.sizeof(vmc),
+                                                     None) == 0:
+       return (vmc.PeakVirtualSize, vmc.VirtualSize)
+
+    return (-1, -1)
+
+if __name__ == '__main__':
+    PROCESS_QUERY_INFORMATION = 0x0400
+    for pid in sys.argv[1:]:
+        handle = ctypes.windll.kernel32.OpenProcess(PROCESS_QUERY_INFORMATION,
+                                                    0, # no inherit
+                                                    int(pid))
+        if handle:
+            print "Process %s:" % pid
+            vsize, peak_vsize = get_vmsize(handle)
+            print "peak vsize: %d" % peak_vsize
+            ctypes.windll.kernel32.CloseHandle(handle)
+        else:
+            print "Couldn't open process %s" % pid
--- a/caps/src/nsJSPrincipals.cpp
+++ b/caps/src/nsJSPrincipals.cpp
@@ -105,17 +105,17 @@ nsTranscodeJSPrincipals(JSXDRState *xdr,
 {
     nsresult rv;
 
     if (xdr->mode == JSXDR_ENCODE) {
         nsIObjectOutputStream *stream =
             reinterpret_cast<nsIObjectOutputStream*>(xdr->userdata);
 
         // Flush xdr'ed data to the underlying object output stream.
-        uint32 size;
+        uint32_t size;
         char *data = (char*) ::JS_XDRMemGetData(xdr, &size);
 
         rv = stream->Write32(size);
         if (NS_SUCCEEDED(rv)) {
             rv = stream->WriteBytes(data, size);
             if (NS_SUCCEEDED(rv)) {
                 ::JS_XDRMemResetData(xdr);
 
@@ -138,17 +138,17 @@ nsTranscodeJSPrincipals(JSXDRState *xdr,
             PRUint32 size;
             rv = stream->Read32(&size);
             if (NS_SUCCEEDED(rv)) {
                 char *data = nsnull;
                 if (size != 0)
                     rv = stream->ReadBytes(size, &data);
                 if (NS_SUCCEEDED(rv)) {
                     char *olddata;
-                    uint32 oldsize;
+                    uint32_t oldsize;
 
                     // Any decode-mode JSXDRState whose userdata points to an
                     // nsIObjectInputStream instance must use nsMemory to Alloc
                     // and Free its data buffer.  Swap the new buffer we just
                     // read for the old, exhausted data.
                     olddata = (char*) ::JS_XDRMemGetData(xdr, &oldsize);
                     nsMemory::Free(olddata);
                     ::JS_XDRMemSetData(xdr, data, size);
--- a/client.mk
+++ b/client.mk
@@ -209,19 +209,19 @@ everything: clean build
 #  application until all the build passes and postflight scripts have run.
 ifdef MOZ_OBJDIR
   PGO_OBJDIR = $(MOZ_OBJDIR)
 else
   PGO_OBJDIR := $(TOPSRCDIR)
 endif
 
 profiledbuild::
-	$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1
-	$(MAKE) -C $(PGO_OBJDIR) stage-package
-	OBJDIR=${PGO_OBJDIR} JARLOG_DIR=${PGO_OBJDIR}/jarlog/en-US $(PROFILE_GEN_SCRIPT)
+	$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1 MOZ_PGO_INSTRUMENTED=1
+	$(MAKE) -C $(PGO_OBJDIR) stage-package MOZ_PGO_INSTRUMENTED=1
+	MOZ_PGO_INSTRUMENTED=1 OBJDIR=${PGO_OBJDIR} JARLOG_DIR=${PGO_OBJDIR}/jarlog/en-US $(PROFILE_GEN_SCRIPT)
 	$(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
 	$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1
 
 #####################################################
 # Build date unification
 
 ifdef MOZ_UNIFY_BDATE
 ifndef MOZ_BUILD_DATE
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -53,16 +53,17 @@ MOZ_APP_BASENAME = @MOZ_APP_BASENAME@
 MOZ_APP_VENDOR = @MOZ_APP_VENDOR@
 MOZ_APP_PROFILE = @MOZ_APP_PROFILE@
 MOZ_APP_ID = @MOZ_APP_ID@
 MOZ_PROFILE_MIGRATOR = @MOZ_PROFILE_MIGRATOR@
 MOZ_EXTENSION_MANAGER = @MOZ_EXTENSION_MANAGER@
 MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@
 MOZ_APP_VERSION = @MOZ_APP_VERSION@
 MOZ_UA_BUILDID = @MOZ_UA_BUILDID@
+MOZ_MACBUNDLE_NAME = @MOZ_MACBUNDLE_NAME@
 MOZ_APP_STATIC_INI = @MOZ_APP_STATIC_INI@
 
 MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
 
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
 includedir	= @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
--- a/config/system-headers
+++ b/config/system-headers
@@ -1032,8 +1032,19 @@ pixman.h
 #endif
 #if MOZ_ENABLE_MEEGOTOUCHSHARE
 shareuiinterface.h
 #endif
 #if MOZ_NATIVE_LIBVPX==1
 vpx/vpx_decoder.h
 vpx/vp8dx.h
 #endif
+#ifdef XP_WIN
+vpx/vpx_decoder.h
+vpx/vp8dx.h
+sydneyaudio/sydney_audio.h
+vorbis/codec.h
+theora/theoradec.h
+tremor/ivorbiscodec.h
+ogg/ogg.h
+ogg/os_types.h
+nestegg/nestegg.h
+#endif
--- a/configure.in
+++ b/configure.in
@@ -8467,16 +8467,36 @@ AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
 AC_SUBST(USE_DEPENDENT_LIBS)
 
 AC_SUBST(MOZ_BUILD_ROOT)
 AC_SUBST(MOZ_OS2_TOOLS)
 
 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 
+dnl ========================================================
+dnl = Mac bundle name prefix
+dnl ========================================================
+MOZ_ARG_WITH_STRING(macbundlename-prefix,
+[  --with-macbundlename-prefix=prefix
+                          Prefix for MOZ_MACBUNDLE_NAME],
+[ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
+
+MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '`
+if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
+  MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
+fi
+
+if test "$MOZ_DEBUG"; then
+  MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app
+else
+  MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
+fi
+AC_SUBST(MOZ_MACBUNDLE_NAME)
+
 # The following variables are available to branding and application
 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
 # impacts profile location and user-visible fields.
 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
 # versions of a given application (e.g. Aurora and Firefox both use
 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
 # for application.ini's "Name" field, which controls profile location in
new file mode 100644
--- /dev/null
+++ b/content/base/crashtests/709384.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<script>
+  mozCancelRequestAnimationFrame(mozRequestAnimationFrame(function() {}));
+  mozRequestAnimationFrame(function() {});
+</script>
--- a/content/base/crashtests/crashtests.list
+++ b/content/base/crashtests/crashtests.list
@@ -97,8 +97,9 @@ load 679459.html
 load 679689-1.html
 load 682463.html
 load 693212.xhtml
 load 698974-1.html
 load 700090-1.html
 load 700090-2.html
 load 700512.html
 load xhr_html_nullresponse.html
+load 709384.html
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -734,83 +734,59 @@ public:
    */
   static nsIXPConnect *XPConnect()
   {
     return sXPConnect;
   }
 
   /**
    * Report a localized error message to the error console.
+   *   @param aErrorFlags See nsIScriptError.
+   *   @param aCategory Name of module reporting error.
+   *   @param aDocument Reference to the document which triggered the message.
    *   @param aFile Properties file containing localized message.
    *   @param aMessageName Name of localized message.
-   *   @param aParams Parameters to be substituted into localized message.
-   *   @param aParamsLength Length of aParams.
-   *   @param aURI URI of resource containing error (may be null).
-   *   @param aSourceLine The text of the line that contains the error (may be
-              empty).
-   *   @param aLineNumber Line number within resource containing error.
-   *   @param aColumnNumber Column number within resource containing error.
-   *   @param aErrorFlags See nsIScriptError.
-   *   @param aCategory Name of module reporting error.
-   *   @param [aInnerWindowId=0] (Optional) The window ID of the inner window
-   *          the message originates from.
+   *   @param [aParams=nsnull] (Optional) Parameters to be substituted into
+              localized message.
+   *   @param [aParamsLength=0] (Optional) Length of aParams.
+   *   @param [aURI=nsnull] (Optional) URI of resource containing error.
+   *   @param [aSourceLine=EmptyString()] (Optional) The text of the line that
+              contains the error (may be empty).
+   *   @param [aLineNumber=0] (Optional) Line number within resource
+              containing error.
+   *   @param [aColumnNumber=0] (Optional) Column number within resource
+              containing error.
+              If aURI is null, then aDocument->GetDocumentURI() is used.
    */
   enum PropertiesFile {
     eCSS_PROPERTIES,
     eXBL_PROPERTIES,
     eXUL_PROPERTIES,
     eLAYOUT_PROPERTIES,
     eFORMS_PROPERTIES,
     ePRINTING_PROPERTIES,
     eDOM_PROPERTIES,
     eHTMLPARSER_PROPERTIES,
     eSVG_PROPERTIES,
     eBRAND_PROPERTIES,
     eCOMMON_DIALOG_PROPERTIES,
     PropertiesFile_COUNT
   };
-  static nsresult ReportToConsole(PropertiesFile aFile,
-                                  const char *aMessageName,
-                                  const PRUnichar **aParams,
-                                  PRUint32 aParamsLength,
-                                  nsIURI* aURI,
-                                  const nsAFlatString& aSourceLine,
-                                  PRUint32 aLineNumber,
-                                  PRUint32 aColumnNumber,
-                                  PRUint32 aErrorFlags,
+  static nsresult ReportToConsole(PRUint32 aErrorFlags,
                                   const char *aCategory,
-                                  PRUint64 aInnerWindowId = 0);
-
-  /**
-   * Report a localized error message to the error console.
-   *   @param aFile Properties file containing localized message.
-   *   @param aMessageName Name of localized message.
-   *   @param aParams Parameters to be substituted into localized message.
-   *   @param aParamsLength Length of aParams.
-   *   @param aURI URI of resource containing error (may be null).
-   *   @param aSourceLine The text of the line that contains the error (may be
-              empty).
-   *   @param aLineNumber Line number within resource containing error.
-   *   @param aColumnNumber Column number within resource containing error.
-   *   @param aErrorFlags See nsIScriptError.
-   *   @param aCategory Name of module reporting error.
-   *   @param aDocument Reference to the document which triggered the message.
-              If aURI is null, then aDocument->GetDocumentURI() is used.
-   */
-  static nsresult ReportToConsole(PropertiesFile aFile,
+                                  nsIDocument* aDocument,
+                                  PropertiesFile aFile,
                                   const char *aMessageName,
-                                  const PRUnichar **aParams,
-                                  PRUint32 aParamsLength,
-                                  nsIURI* aURI,
-                                  const nsAFlatString& aSourceLine,
-                                  PRUint32 aLineNumber,
-                                  PRUint32 aColumnNumber,
-                                  PRUint32 aErrorFlags,
-                                  const char *aCategory,
-                                  nsIDocument* aDocument);
+                                  const PRUnichar **aParams = nsnull,
+                                  PRUint32 aParamsLength = 0,
+                                  nsIURI* aURI = nsnull,
+                                  const nsAFlatString& aSourceLine
+                                    = EmptyString(),
+                                  PRUint32 aLineNumber = 0,
+                                  PRUint32 aColumnNumber = 0);
 
   /**
    * Get the localized string named |aKey| in properties file |aFile|.
    */
   static nsresult GetLocalizedString(PropertiesFile aFile,
                                      const char* aKey,
                                      nsXPIDLString& aResult);
 
@@ -1621,16 +1597,22 @@ public:
                              // while there's a ref to it
                              nsIXPConnectJSObjectHolder** aHolder = nsnull,
                              bool aAllowWrapping = false)
   {
     return WrapNative(cx, scope, native, cache, nsnull, vp, aHolder,
                       aAllowWrapping);
   }
 
+  /**
+   * Creates an arraybuffer from a binary string.
+   */
+  static nsresult CreateArrayBuffer(JSContext *aCx, const nsACString& aData,
+                                    JSObject** aResult);
+
   static void StripNullChars(const nsAString& aInStr, nsAString& aOutStr);
 
   /**
    * Strip all \n, \r and nulls from the given string
    * @param aString the string to remove newlines from [in/out]
    */
   static void RemoveNewlines(nsString &aString);
 
@@ -2180,9 +2162,26 @@ public:
     return GetParameter(nsnull, aResult);
   }
 
 private:
   NS_ConvertUTF16toUTF8 mString;
   nsIMIMEHeaderParam*   mService;
 };
 
+class nsDocElementCreatedNotificationRunner : public nsRunnable
+{
+public:
+    nsDocElementCreatedNotificationRunner(nsIDocument* aDoc)
+        : mDoc(aDoc)
+    {
+    }
+
+    NS_IMETHOD Run()
+    {
+        nsContentSink::NotifyDocElementCreated(mDoc);
+        return NS_OK;
+    }
+
+    nsCOMPtr<nsIDocument> mDoc;
+};
+
 #endif /* nsContentUtils_h___ */
--- a/content/base/public/nsDOMFile.h
+++ b/content/base/public/nsDOMFile.h
@@ -48,36 +48,40 @@
 #include "nsIJSNativeInitializer.h"
 #include "nsIMutable.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIXMLHttpRequest.h"
 #include "prmem.h"
 #include "nsAutoPtr.h"
+#include "mozilla/dom/indexedDB/FileInfo.h"
+#include "mozilla/dom/indexedDB/FileManager.h"
+#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
 
 #include "mozilla/GuardObjects.h"
 
 #ifndef PR_UINT64_MAX
 #define PR_UINT64_MAX (~(PRUint64)(0))
 #endif
 
 class nsIFile;
 class nsIInputStream;
 class nsIClassInfo;
 class nsIBlobBuilder;
 
 nsresult NS_NewBlobBuilder(nsISupports* *aSupports);
 
+using namespace mozilla::dom;
+
 class nsDOMFileBase : public nsIDOMFile,
                       public nsIXHRSendable,
                       public nsIMutable
 {
 public:
-
   nsDOMFileBase(const nsAString& aName, const nsAString& aContentType,
                 PRUint64 aLength)
     : mIsFile(true), mImmutable(false), mContentType(aContentType),
       mName(aName), mStart(0), mLength(aLength)
   {
     // Ensure non-null mContentType by default
     mContentType.SetIsVoid(false);
   }
@@ -114,54 +118,93 @@ public:
   NS_DECL_NSIMUTABLE
 
 protected:
   bool IsSizeUnknown()
   {
     return mLength == PR_UINT64_MAX;
   }
 
+  virtual bool IsStoredFile()
+  {
+    return false;
+  }
+
+  virtual bool IsWholeFile()
+  {
+    NS_NOTREACHED("Should only be called on dom blobs backed by files!");
+    return false;
+  }
+
+  indexedDB::FileInfo*
+  GetFileInfoInternal(indexedDB::FileManager* aFileManager,
+                      PRUint32 aStartIndex);
+
   bool mIsFile;
   bool mImmutable;
   nsString mContentType;
   nsString mName;
 
   PRUint64 mStart;
   PRUint64 mLength;
+
+  // Protected by IndexedDatabaseManager::FileMutex()
+  nsTArray<nsRefPtr<indexedDB::FileInfo> > mFileInfos;
 };
 
 class nsDOMFileFile : public nsDOMFileBase,
                       public nsIJSNativeInitializer
 {
 public:
   // Create as a file
   nsDOMFileFile(nsIFile *aFile)
     : nsDOMFileBase(EmptyString(), EmptyString(), PR_UINT64_MAX),
-      mFile(aFile), mWholeFile(true)
+      mFile(aFile), mWholeFile(true), mStoredFile(false)
   {
     NS_ASSERTION(mFile, "must have file");
     // Lazily get the content type and size
     mContentType.SetIsVoid(true);
     mFile->GetLeafName(mName);
   }
 
   // Create as a blob
   nsDOMFileFile(nsIFile *aFile, const nsAString& aContentType,
                 nsISupports *aCacheToken = nsnull)
     : nsDOMFileBase(aContentType, PR_UINT64_MAX),
-      mFile(aFile), mWholeFile(true),
+      mFile(aFile), mWholeFile(true), mStoredFile(false),
       mCacheToken(aCacheToken)
   {
     NS_ASSERTION(mFile, "must have file");
   }
 
+  // Create as a stored file
+  nsDOMFileFile(const nsAString& aName, const nsAString& aContentType,
+                PRUint64 aLength, nsIFile* aFile,
+                indexedDB::FileInfo* aFileInfo)
+    : nsDOMFileBase(aName, aContentType, aLength),
+      mFile(aFile), mWholeFile(true), mStoredFile(true)
+  {
+    NS_ASSERTION(mFile, "must have file");
+    mFileInfos.AppendElement(aFileInfo);
+  }
+
+  // Create as a stored blob
+  nsDOMFileFile(const nsAString& aContentType, PRUint64 aLength,
+                nsIFile* aFile, indexedDB::FileInfo* aFileInfo)
+    : nsDOMFileBase(aContentType, aLength),
+      mFile(aFile), mWholeFile(true), mStoredFile(true)
+  {
+    NS_ASSERTION(mFile, "must have file");
+    mFileInfos.AppendElement(aFileInfo);
+  }
+
   // Create as a file to be later initialized
   nsDOMFileFile()
     : nsDOMFileBase(EmptyString(), EmptyString(), PR_UINT64_MAX),
-      mWholeFile(true)
+      mWholeFile(true), mStoredFile(false)
   {
     // Lazily get the content type and size
     mContentType.SetIsVoid(true);
     mName.SetIsVoid(true);
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
@@ -183,27 +226,57 @@ public:
   NewFile(nsISupports* *aNewObject);
 
 protected:
   // Create slice
   nsDOMFileFile(const nsDOMFileFile* aOther, PRUint64 aStart, PRUint64 aLength,
                 const nsAString& aContentType)
     : nsDOMFileBase(aContentType, aOther->mStart + aStart, aLength),
       mFile(aOther->mFile), mWholeFile(false),
-      mCacheToken(aOther->mCacheToken)
+      mStoredFile(aOther->mStoredFile), mCacheToken(aOther->mCacheToken)
   {
     NS_ASSERTION(mFile, "must have file");
     mImmutable = aOther->mImmutable;
+
+    if (mStoredFile) {
+      indexedDB::FileInfo* fileInfo;
+
+      if (!indexedDB::IndexedDatabaseManager::IsClosed()) {
+        indexedDB::IndexedDatabaseManager::FileMutex().Lock();
+      }
+
+      NS_ASSERTION(!aOther->mFileInfos.IsEmpty(),
+                   "A stored file must have at least one file info!");
+
+      fileInfo = aOther->mFileInfos.ElementAt(0);
+
+      if (!indexedDB::IndexedDatabaseManager::IsClosed()) {
+        indexedDB::IndexedDatabaseManager::FileMutex().Unlock();
+      }
+
+      mFileInfos.AppendElement(fileInfo);
+    }
   }
   virtual already_AddRefed<nsIDOMBlob>
   CreateSlice(PRUint64 aStart, PRUint64 aLength,
               const nsAString& aContentType);
 
+  virtual bool IsStoredFile()
+  {
+    return mStoredFile;
+  }
+
+  virtual bool IsWholeFile()
+  {
+    return mWholeFile;
+  }
+
   nsCOMPtr<nsIFile> mFile;
   bool mWholeFile;
+  bool mStoredFile;
   nsCOMPtr<nsISupports> mCacheToken;
 };
 
 class nsDOMMemoryFile : public nsDOMFileBase
 {
 public:
   // Create as file
   nsDOMMemoryFile(void *aMemoryBuffer,
--- a/content/base/public/nsDeprecatedOperationList.h
+++ b/content/base/public/nsDeprecatedOperationList.h
@@ -70,8 +70,9 @@ DEPRECATED_OPERATION(Normalize)
 DEPRECATED_OPERATION(IsSupported)
 DEPRECATED_OPERATION(IsEqualNode)
 DEPRECATED_OPERATION(TextContent)
 DEPRECATED_OPERATION(EnablePrivilege)
 DEPRECATED_OPERATION(Position)
 DEPRECATED_OPERATION(TotalSize)
 DEPRECATED_OPERATION(GlobalStorage)
 DEPRECATED_OPERATION(InputEncoding)
+DEPRECATED_OPERATION(MozBeforePaint)
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -73,18 +73,18 @@ enum nsLinkState {
   eLinkState_Unknown    = 0,
   eLinkState_Unvisited  = 1,
   eLinkState_Visited    = 2,
   eLinkState_NotLink    = 3
 };
 
 // IID for the nsIContent interface
 #define NS_ICONTENT_IID \
-{ 0xed40a3e5, 0xd7ed, 0x473e, \
- { 0x85, 0xe3, 0x82, 0xc3, 0xf0, 0x41, 0xdb, 0x52 } }
+{ 0xdc68f070, 0x226d, 0x11e1, \
+ { 0xbf, 0xc2, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
 
 /**
  * A node of content in a document's content model. This interface
  * is supported by all content objects.
  */
 class nsIContent : public nsINode {
 public:
   typedef mozilla::widget::IMEState IMEState;
@@ -322,24 +322,32 @@ public:
   inline bool IsHTML(nsIAtom* aTag) const {
     return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
   }
 
   inline bool IsSVG() const {
     return IsInNamespace(kNameSpaceID_SVG);
   }
 
+  inline bool IsSVG(nsIAtom* aTag) const {
+    return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
+  }
+
   inline bool IsXUL() const {
     return IsInNamespace(kNameSpaceID_XUL);
   }
 
   inline bool IsMathML() const {
     return IsInNamespace(kNameSpaceID_MathML);
   }
 
+  inline bool IsMathML(nsIAtom* aTag) const {
+    return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
+  }
+
   /**
    * Returns an atom holding the name of the attribute of type ID on
    * this content node (if applicable).  Returns null for non-element
    * content nodes.
    */
   virtual nsIAtom *GetIDAttributeName() const = 0;
 
   /**
--- a/content/base/public/nsIDOMFile.idl
+++ b/content/base/public/nsIDOMFile.idl
@@ -34,38 +34,63 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "domstubs.idl"
 
 %{C++
 #include "jsapi.h"
+
+namespace mozilla {
+namespace dom {
+namespace indexedDB {
+class FileInfo;
+class FileManager;
+}
+}
+}
+
 %}
 
+[ptr] native FileInfo(mozilla::dom::indexedDB::FileInfo);
+[ptr] native FileManager(mozilla::dom::indexedDB::FileManager);
+
 interface nsIDOMFileError;
 interface nsIInputStream;
 interface nsIURI;
 interface nsIPrincipal;
 interface nsIDOMBlob;
 
-[scriptable, builtinclass, uuid(d5237f31-443a-460b-9e42-449a135346f0)]
+[scriptable, builtinclass, uuid(f62c6887-e3bc-495a-802c-287e12e969a0)]
 interface nsIDOMBlob : nsISupports
 {
   readonly attribute unsigned long long size;
   readonly attribute DOMString type;
 
   [noscript] readonly attribute nsIInputStream internalStream;
   // The caller is responsible for releasing the internalUrl from the
   // moz-filedata: protocol handler
   [noscript] DOMString getInternalUrl(in nsIPrincipal principal);
 
   [optional_argc] nsIDOMBlob mozSlice([optional] in long long start,
                                       [optional] in long long end,
                                       [optional] in DOMString contentType);
+
+  // Get internal id of stored file. Returns -1 if it is not a stored file.
+  // Intended only for testing. It can be called on any thread.
+  [notxpcom] long long getFileId();
+
+  // Called when the blob was successfully stored in a database or when
+  // the blob is initialized from a database. It can be called on any thread.
+  [notxpcom] void addFileInfo(in FileInfo aFileInfo);
+
+  // Called before the blob is stored in a database to decide if it can be
+  // shared or needs to be copied. It can be called on any thread.
+  [notxpcom] FileInfo getFileInfo(in FileManager aFileManager);
 };
 
 [scriptable, builtinclass, uuid(b096ef67-7b77-47f8-8e70-5d8ee36416bf)]
 interface nsIDOMFile : nsIDOMBlob
 {
   readonly attribute DOMString name;
   readonly attribute DOMString mozFullPath;
 
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -1596,16 +1596,30 @@ public:
 #include "nsDeprecatedOperationList.h"
     eDeprecatedOperationCount
   };
 #undef DEPRECATED_OPERATION
   void WarnOnceAbout(DeprecatedOperations aOperation);
 
   virtual void PostVisibilityUpdateEvent() = 0;
 
+  void SetNeedLayoutFlush() {
+    mNeedLayoutFlush = true;
+    if (mDisplayDocument) {
+      mDisplayDocument->SetNeedLayoutFlush();
+    }
+  }
+
+  void SetNeedStyleFlush() {
+    mNeedStyleFlush = true;
+    if (mDisplayDocument) {
+      mDisplayDocument->SetNeedStyleFlush();
+    }
+  }
+
 private:
   PRUint64 mWarnedAbout;
 
 protected:
   ~nsIDocument()
   {
     // XXX The cleanup of mNodeInfoManager (calling DropDocumentReference and
     //     releasing it) happens in the nsDocument destructor. We'd prefer to
@@ -1760,16 +1774,22 @@ protected:
 
   // True is this document is synthetic : stand alone image, video, audio
   // file, etc.
   bool mIsSyntheticDocument;
 
   // True if this document has links whose state needs updating
   bool mHasLinksToUpdate;
 
+  // True if a layout flush might not be a no-op
+  bool mNeedLayoutFlush;
+
+  // True if a style flush might not be a no-op
+  bool mNeedStyleFlush;
+
   // The document's script global object, the object from which the
   // document can get its script context and scope. This is the
   // *inner* window object.
   nsCOMPtr<nsIScriptGlobalObject> mScriptGlobalObject;
 
   // If mIsStaticDocument is true, mOriginalDocument points to the original
   // document.
   nsCOMPtr<nsIDocument> mOriginalDocument;
--- a/content/base/public/nsIMozWebSocket.idl
+++ b/content/base/public/nsIMozWebSocket.idl
@@ -39,60 +39,66 @@
 
 #include "nsISupports.idl"
 
 interface nsIDOMEventListener;
 interface nsIPrincipal;
 interface nsIScriptContext;
 interface nsPIDOMWindow;
 interface nsIDOMDOMStringList;
+interface nsIVariant;
 
 %{C++
 #include "nsTArray.h"
 class nsString;
 %}
 [ref] native nsStringTArrayRef(nsTArray<nsString>);
 
 /**
  * The nsIMozWebSocket interface enables Web applications to maintain
  * bidirectional communications with server-side processes as described in:
  *
  * http://dev.w3.org/html5/websockets/
  *
  */
-[scriptable, uuid(5b124f54-7d46-4bc0-8507-e58ed22c19b9)]
+[scriptable, uuid(f463b9b5-1408-4057-9224-e4f5bc33f17b)]
 interface nsIMozWebSocket : nsISupports
 {
   readonly attribute DOMString url;
   readonly attribute DOMString extensions;
   readonly attribute DOMString protocol;
 
   //ready state
   const unsigned short CONNECTING = 0;
   const unsigned short OPEN = 1;
   const unsigned short CLOSING = 2;
   const unsigned short CLOSED = 3;
   readonly attribute unsigned short readyState;
 
   readonly attribute unsigned long bufferedAmount;
 
+  // "blob" by default: can set to "blob" or "arraybuffer": setting to other
+  // values will throw SYNTAX_ERR exception.
+  attribute DOMString binaryType;
+
   // event handler attributes
   attribute nsIDOMEventListener onopen;
   attribute nsIDOMEventListener onmessage;
   attribute nsIDOMEventListener onerror;
   attribute nsIDOMEventListener onclose;
 
   /**
-   * Transmits data using the connection.
-   *
-   * @param data The data to be transmited.
-   * @return if the connection is still established (and the data was queued or
-   *         sent successfully).
+   * Transmits data to other end of the connection.
+   * @param data The data to be transmitted.  Arraybuffers and Blobs are sent as
+   * binary data.  Strings are sent as UTF-8 text data.  Other types are
+   * converted to a String and sent as a String.
+   * @return if the connection is still established and the data was queued or
+   *         sent successfully.
    */
-  void send(in DOMString data);
+  void send(in nsIVariant data);
 
   /**
    * Closes the Web Socket connection or connection attempt, if any.
    * If the connection is already closed, it does nothing.
    */
   [optional_argc] void close([optional] in unsigned short code,
                              [optional] in DOMString reason);
 
--- a/content/base/public/nsIObjectLoadingContent.idl
+++ b/content/base/public/nsIObjectLoadingContent.idl
@@ -46,17 +46,17 @@ interface nsIDOMClientRect;
 %{C++
 #include "nsNPAPIPluginInstance.h"
 %}
 [ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
 
 /**
  * This interface represents a content node that loads objects.
  */
-[scriptable, uuid(107e8048-d00f-4711-bd21-97184ccae0b1)]
+[scriptable, uuid(e5330f90-91a3-41d7-b29e-af38a23a6602)]
 interface nsIObjectLoadingContent : nsISupports
 {
   const unsigned long TYPE_LOADING  = 0;
   const unsigned long TYPE_IMAGE    = 1;
   const unsigned long TYPE_PLUGIN   = 2;
   const unsigned long TYPE_DOCUMENT = 3;
   const unsigned long TYPE_NULL     = 4;
 
@@ -120,9 +120,15 @@ interface nsIObjectLoadingContent : nsIS
    * not in the static clone.
    */
   [noscript] nsIFrame getPrintFrame();
 
   [noscript] void pluginCrashed(in nsIPluginTag pluginTag,
                                 in AString pluginDumpID,
                                 in AString browserDumpID,
                                 in boolean submittedCrashReport);
+
+  /**
+   * This method will play a plugin that has been stopped by the
+   * click-to-play plugins feature.
+   */
+  void playPlugin();
 };
--- a/content/base/src/nsCSPService.cpp
+++ b/content/base/src/nsCSPService.cpp
@@ -296,17 +296,17 @@ CSPService::AsyncOnChannelRedirect(nsICh
   }
 
   // The redirecting channel isn't a writable property bag, we won't be able
   // to enforce the load policy if it redirects again, so we stop it now.
   nsCAutoString newUriSpec;
   newUri->GetSpec(newUriSpec);
   const PRUnichar *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() };
   if (NS_SUCCEEDED(rv)) {
-    nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                   "InvalidRedirectChannelWarning",
-                                    formatParams, 1, nsnull, EmptyString(),
-                                    0, 0, nsIScriptError::warningFlag,
-                                    "Redirect Error");
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "Redirect Error", nsnull,
+                                    nsContentUtils::eDOM_PROPERTIES,
+                                    "InvalidRedirectChannelWarning",
+                                    formatParams, 1);
   }
 
   return NS_BINDING_FAILED;
 }
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -210,16 +210,18 @@ nsContentAreaDragDropDataProvider::SaveU
 
   // we rely on the fact that the WPB is refcounted by the channel etc,
   // so we don't keep a ref to it. It will die when finished.
   nsCOMPtr<nsIWebBrowserPersist> persist =
     do_CreateInstance("@mozilla.org/embedding/browser/nsWebBrowserPersist;1",
                       &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
+  persist->SetPersistFlags(nsIWebBrowserPersist::PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION);
+
   return persist->SaveURI(sourceURI, nsnull, nsnull, nsnull, nsnull, inDestFile);
 }
 
 // This is our nsIFlavorDataProvider callback. There are several
 // assumptions here that make this work:
 //
 // 1. Someone put a kFilePromiseURLMime flavor into the transferable
 //    with the source URI of the file to save (as a string). We did
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -40,16 +40,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 /* A namespace class for static layout utilities. */
 
 #include "mozilla/Util.h"
 
 #include "jsapi.h"
 #include "jsdbgapi.h"
+#include "jstypedarray.h"
 
 #include "nsJSUtils.h"
 #include "nsCOMPtr.h"
 #include "nsAString.h"
 #include "nsPrintfCString.h"
 #include "nsUnicharUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIScriptGlobalObject.h"
@@ -2780,32 +2781,40 @@ nsresult nsContentUtils::FormatLocalized
   nsIStringBundle *bundle = sStringBundles[aFile];
 
   return bundle->FormatStringFromName(NS_ConvertASCIItoUTF16(aKey).get(),
                                       aParams, aParamsLength,
                                       getter_Copies(aResult));
 }
 
 /* static */ nsresult
-nsContentUtils::ReportToConsole(PropertiesFile aFile,
+nsContentUtils::ReportToConsole(PRUint32 aErrorFlags,
+                                const char *aCategory,
+                                nsIDocument* aDocument,
+                                PropertiesFile aFile,
                                 const char *aMessageName,
                                 const PRUnichar **aParams,
                                 PRUint32 aParamsLength,
                                 nsIURI* aURI,
                                 const nsAFlatString& aSourceLine,
                                 PRUint32 aLineNumber,
-                                PRUint32 aColumnNumber,
-                                PRUint32 aErrorFlags,
-                                const char *aCategory,
-                                PRUint64 aInnerWindowId)
+                                PRUint32 aColumnNumber)
 {
   NS_ASSERTION((aParams && aParamsLength) || (!aParams && !aParamsLength),
                "Supply either both parameters and their number or no"
                "parameters and 0.");
 
+  PRUint64 innerWindowID = 0;
+  if (aDocument) {
+    if (!aURI) {
+      aURI = aDocument->GetDocumentURI();
+    }
+    innerWindowID = aDocument->InnerWindowID();
+  }
+
   nsresult rv;
   if (!sConsoleService) { // only need to bother null-checking here
     rv = CallGetService(NS_CONSOLESERVICE_CONTRACTID, &sConsoleService);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   nsXPIDLString errorText;
   if (aParams) {
@@ -2825,50 +2834,23 @@ nsContentUtils::ReportToConsole(Properti
       do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = errorObject->InitWithWindowID(errorText.get(),
                                      NS_ConvertUTF8toUTF16(spec).get(), // file name
                                      aSourceLine.get(),
                                      aLineNumber, aColumnNumber,
                                      aErrorFlags, aCategory,
-                                     aInnerWindowId);
+                                     innerWindowID);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIScriptError> logError = do_QueryInterface(errorObject);
   return sConsoleService->LogMessage(logError);
 }
 
-/* static */ nsresult
-nsContentUtils::ReportToConsole(PropertiesFile aFile,
-                                const char *aMessageName,
-                                const PRUnichar **aParams,
-                                PRUint32 aParamsLength,
-                                nsIURI* aURI,
-                                const nsAFlatString& aSourceLine,
-                                PRUint32 aLineNumber,
-                                PRUint32 aColumnNumber,
-                                PRUint32 aErrorFlags,
-                                const char *aCategory,
-                                nsIDocument* aDocument)
-{
-  nsIURI* uri = aURI;
-  PRUint64 innerWindowID = 0;
-  if (aDocument) {
-    if (!uri) {
-      uri = aDocument->GetDocumentURI();
-    }
-    innerWindowID = aDocument->InnerWindowID();
-  }
-
-  return ReportToConsole(aFile, aMessageName, aParams, aParamsLength, uri,
-                         aSourceLine, aLineNumber, aColumnNumber, aErrorFlags,
-                         aCategory, innerWindowID);
-}
-
 bool
 nsContentUtils::IsChromeDoc(nsIDocument *aDocument)
 {
   if (!aDocument) {
     return false;
   }
   
   nsCOMPtr<nsIPrincipal> systemPrincipal;
@@ -5270,16 +5252,39 @@ nsContentUtils::WrapNative(JSContext *cx
   }
   else {
     sXPConnect->Release();
   }
 
   return rv;
 }
 
+nsresult
+nsContentUtils::CreateArrayBuffer(JSContext *aCx, const nsACString& aData,
+                                  JSObject** aResult)
+{
+  if (!aCx) {
+    return NS_ERROR_FAILURE;
+  }
+
+  PRInt32 dataLen = aData.Length();
+  *aResult = js_CreateArrayBuffer(aCx, dataLen);
+  if (!*aResult) {
+    return NS_ERROR_FAILURE;
+  }
+
+  if (dataLen > 0) {
+    JSObject *abuf = js::ArrayBuffer::getArrayBuffer(*aResult);
+    NS_ASSERTION(abuf, "What happened?");
+    memcpy(JS_GetArrayBufferData(abuf), aData.BeginReading(), dataLen);
+  }
+
+  return NS_OK;
+}
+
 void
 nsContentUtils::StripNullChars(const nsAString& aInStr, nsAString& aOutStr)
 {
   // In common cases where we don't have nulls in the
   // string we can simple simply bypass the checking code.
   PRInt32 firstNullPos = aInStr.FindChar('\0');
   if (firstNullPos == kNotFound) {
     aOutStr.Assign(aInStr);
--- a/content/base/src/nsDOMAttribute.cpp
+++ b/content/base/src/nsDOMAttribute.cpp
@@ -695,23 +695,17 @@ nsDOMAttribute::AppendChildTo(nsIContent
 
 nsresult
 nsDOMAttribute::RemoveChildAt(PRUint32 aIndex, bool aNotify)
 {
   if (aIndex != 0 || !mChild) {
     return NS_OK;
   }
 
-  {
-    nsCOMPtr<nsIContent> child = mChild;
-    nsMutationGuard::DidMutate();
-    mozAu